Ignore:
Timestamp:
07/11/24 17:15:51 (4 months ago)
Author:
Maciej Komosinski
Message:

Color mutations in f1 and f4, and a new syntax for "allowed modifiers" (opposite to previous "excluded modifiers") with optional probabilities for each modifier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f4/f4_conv.cpp

    r1274 r1313  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2023  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    189189        }
    190190
    191         char tmpLine[100];
     191        char tmpLine[256];
    192192        MultiRange range = C->genoRange;
    193193
     
    200200                        // new part object for firstend
    201201                        // coordinates are left to be computed by Model
    202                         sprintf(tmpLine, "fr=%g,ing=%g,as=%g",
    203                                 /*1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation
     202                        sprintf(tmpLine, "fr=%g,ing=%g,as=%g,vr=%g,vg=%g,vb=%g",
     203                                /*1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation, C->P.cred, C->P.cgreen, C->P.cblue
    204204                                //C->firstend.x, C->firstend.y, C->firstend.z
    205205                        );
     
    216216                }
    217217                // new part object for lastend
    218                 sprintf(tmpLine, "fr=%g,ing=%g,as=%g",
     218                sprintf(tmpLine, "fr=%g,ing=%g,as=%g,vr=%g,vg=%g,vb=%g",
    219219                        //C->lastend.x, C->lastend.y, C->lastend.z
    220                         /*"vol=" 1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation
     220                        /*"vol=" 1.0/C->P.mass,*/ C->P.friction, C->P.ingestion, C->P.assimilation, C->P.cred, C->P.cgreen, C->P.cblue
    221221                );
    222222                C->p2_refno = addFromString(PartType, tmpLine, &range);
     
    241241                C->joint_refno = addFromString(JointType, tmpLine, &range);
    242242                if (C->joint_refno < 0) return -13;
     243                getJoint(C->joint_refno)->vcolor = (getPart(jj_p1_refno)->vcolor + getPart(jj_p2_refno)->vcolor) / 2; //joint gets the average color of both connected parts
    243244                this->checkpoint();
    244245        }
Note: See TracChangeset for help on using the changeset viewer.