Changeset 528 for cpp/frams


Ignore:
Timestamp:
07/18/16 04:14:37 (8 years ago)
Author:
Maciej Komosinski
Message:
  • Part.m removed
  • Part.h becomes XPROP
  • validate more part and joint properties in Model.internalcheck()
Location:
cpp/frams
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/config/f0-SDK.def

    r507 r528  
    1313PROP(y,0,1024,position.y,f,,,,p.y)
    1414PROP(z,0,1024,position.z,f,,,,p.z)
    15 XPROP(m,1,0,mass,f,0.1,999.0,1.0,mass)
    1615PROP(sh,1,0,shape,d,0,3,0,shape)
    1716PROP(s,1,0,size,f,0.1,10.0,1.0,size)
     
    1918PROP(sy,1,0,scale.y,f,0.001,1000.0,1.0,scale.y)
    2019PROP(sz,1,0,scale.z,f,0.001,1000.0,1.0,scale.z)
    21 PROP(h,1,0,hollow,f,0,1,0,hollow)
     20XPROP(h,1,0,hollow,f,0,1,0,hollow)
    2221XPROP(dn,1,0,density,f,0.2,5.0,1.0,density)
    2322XPROP(fr,1,0,friction,f,0.0,4.0,0.4,friction)
  • cpp/frams/config/f0.def

    r507 r528  
    1313PROP(y,0,1024,position.y,f,,,,p.y)
    1414PROP(z,0,1024,position.z,f,,,,p.z)
    15 XPROP(m,1,0,mass,f,0.1,999.0,1.0,mass)
    1615PROP(sh,1,0,shape,d,0,3,0,shape)
    1716PROP(s,1,0,size,f,0.1,10.0,1.0,size)
     
    1918PROP(sy,1,0,scale.y,f,0.001,1000.0,1.0,scale.y)
    2019PROP(sz,1,0,scale.z,f,0.001,1000.0,1.0,scale.z)
    21 PROP(h,1,0,hollow,f,0,1,0,hollow)
     20XPROP(h,1,0,hollow,f,0,1,0,hollow)
    2221XPROP(dn,1,0,density,f,0.2,5.0,1.0,density)
    2322XPROP(fr,1,0,friction,f,0.0,4.0,0.4,friction)
  • cpp/frams/genetics/f1/conv_f1.cpp

    r514 r528  
    316316int Builder::growPart(F1Props &c,const char *g)
    317317{
    318 sprintf(tmp,"p:m=1,dn=%lg,fr=%lg,ing=%lg,as=%lg,vs=%g,vr=%g,vg=%g,vb=%g",
     318sprintf(tmp,"p:dn=%lg,fr=%lg,ing=%lg,as=%lg,vs=%g,vr=%g,vg=%g,vb=%g",
    319319        1.0/c.masa,c.tarcie,c.wchl,c.asym, c.grub, c.cred,c.cgreen,c.cblue);
    320320return model.singleStepBuild(tmp,makeRange(g));
  • cpp/frams/genetics/f4/conv_f4.cpp

    r375 r528  
    178178                        // new part object for firstend
    179179                        // coordinates are left to be computed by Model
    180                         sprintf(tmpLine, "p:m=1,fr=%g,ing=%g,as=%g",
     180                        sprintf(tmpLine, "p:fr=%g,ing=%g,as=%g",
    181181                                /*1.0/C->P.mass,*/ C->P.friction, C->P.ingest, C->P.assim
    182182                                //C->firstend.x, C->firstend.y, C->firstend.z
     
    194194                }
    195195                // new part object for lastend
    196                 sprintf(tmpLine, "p:m=1,fr=%g,ing=%g,as=%g",
     196                sprintf(tmpLine, "p:fr=%g,ing=%g,as=%g",
    197197                        //C->lastend.x, C->lastend.y, C->lastend.z
    198198                        /*"vol=" 1.0/C->P.mass,*/ C->P.friction, C->P.ingest, C->P.assim
  • cpp/frams/model/defassign-f0-SDK.h

    r507 r528  
    99void Part::defassign()
    1010{
    11 mass=1.0;
    1211shape=0;
    1312size=1.0;
  • cpp/frams/model/f0-SDK-classes.h

    r507 r528  
    2424ParamEntry f0_part_paramtab[]=
    2525{
    26  {"Geometry",3,23,"p" },
     26 {"Geometry",3,22,"p" },
    2727 {"Other properties",},
    2828 {"Visual",},
     
    3030 {"y",0,1024,"position.y","f",FIELD(p.y),},
    3131 {"z",0,1024,"position.z","f",FIELD(p.z),},
    32  {"m",1,0,"mass","f 0.1 999.0 1.0",FIELD(mass),},
    3332 {"sh",1,0,"shape","d 0 3 0",FIELD(shape),},
    3433 {"s",1,0,"size","f 0.1 10.0 1.0",FIELD(size),},
     
    5554{
    5655 {"Extra properties",1,9,"p"},
    57  {"m",0,0,"mass","f 0.1 999.0 1.0",FIELD(mass),},
     56 {"h",0,0,"hollow","f 0 1 0",FIELD(hollow),},
    5857 {"dn",0,0,"density","f 0.2 5.0 1.0",FIELD(density),},
    5958 {"fr",0,0,"friction","f 0.0 4.0 0.4",FIELD(friction),},
  • cpp/frams/model/model.cpp

    r522 r528  
    923923                                        p->mass = 0.0;
    924924                        }
    925                         //      VALIDMINMAX(p,part,mass);
     925                        //VALIDMINMAX(p,part,mass);//mass is very special
     926                        // VALIDMINMAX are managed manually when adding part properties in f0-def!
     927                        // (could be made dynamic but not really worth the effort)
    926928                        VALIDMINMAX(p, Part, size);
     929                        VALIDMINMAX(p, Part, scale.x);
     930                        VALIDMINMAX(p, Part, scale.y);
     931                        VALIDMINMAX(p, Part, scale.z);
     932                        VALIDMINMAX(p, Part, hollow);
    927933                        VALIDMINMAX(p, Part, density);
    928934                        VALIDMINMAX(p, Part, friction);
    929935                        VALIDMINMAX(p, Part, ingest);
    930936                        VALIDMINMAX(p, Part, assim);
     937                        VALIDMINMAX(p, Part, vsize);
     938                        VALIDMINMAX(p, Part, vcolor.x);
     939                        VALIDMINMAX(p, Part, vcolor.y);
     940                        VALIDMINMAX(p, Part, vcolor.z);
    931941                        p->flags &= ~LINKFLAG; // for delta joint cycle detection
    932942                        if (p->p.x - p->size < bbmin.x) bbmin.x = p->p.x - p->size;
     
    951961                {
    952962                        j = (Joint*)joints(i);
     963                        // VALIDMINMAX are managed manually when adding joint properties in f0-def!
     964                        // (could be made dynamic but not really worth the effort)
    953965                        VALIDMINMAX(j, Joint, stamina);
    954966                        VALIDMINMAX(j, Joint, stif);
    955967                        VALIDMINMAX(j, Joint, rotstif);
     968                        VALIDMINMAX(p, Part, vcolor.x);
     969                        VALIDMINMAX(p, Part, vcolor.y);
     970                        VALIDMINMAX(p, Part, vcolor.z);
    956971                        j->refno = i;
    957972                        j->owner = this;
     
    10391054        {
    10401055                n = (Neuro*)neurons(i);
    1041                 VALIDMINMAX(n, Neuro, state);
    10421056#ifdef MODEL_V1_COMPATIBLE
    10431057                VALIDMINMAX(n,Neuro,inertia);
  • cpp/frams/model/modelparts.cpp

    r292 r528  
    643643defassign();
    644644shape=s;
     645mass=1;
    645646}
    646647
Note: See TracChangeset for help on using the changeset viewer.