Changeset 582 for experiments/frams


Ignore:
Timestamp:
08/18/16 14:41:35 (8 years ago)
Author:
Maciej Komosinski
Message:

Added comments and TODOs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experiments/frams/foraminifera/data/scripts/foraminifera.expdef

    r581 r582  
    525525}
    526526
    527 function fence(pos, zone)
     527function fence(pos, zone) //TODO consider sizes (bboxes) of creatures and nutrients consistently throughout this expdef
    528528{
    529529        return Math.min(Math.max(0,pos),World.wrldsiz);
     
    532532function foramMove(cr)
    533533{
    534         //TODO moving inside sediment?
    535 
    536534        //adjustment in z axis
    537535        var change_direction = 0;
    538536        var new_x = fence(cr.pos_x, getZoneRange(cr, 1));
    539         var new_y = fence(cr.pos_y,getZoneRange(cr, 1));
     537        var new_y = fence(cr.pos_y, getZoneRange(cr, 1));
    540538
    541539        if ((new_x != cr.pos_x) || (new_y != cr.pos_y) || (cr.data->lifeparams->dir_counter >= int(secToSimSteps(ExpProperties.dir_change_sec))))
     
    544542        }
    545543
    546         cr.moveAbs(new_x, new_y, -cr.getPart(cr.numparts-1).sx);
     544        cr.moveAbs(new_x, new_y, -cr.getPart(cr.numparts-1).sx); //place slightly under the bottom surface ("z" value depends on the size of the last=largest chamber)
    547545
    548546        //are there any nutrients in zone 1 or 2?
     
    780778                var nut = Populations[2].add("//0\nm:Vstyle=nutrient_visual\np:sh=2,sx="+nutsize+",sy="+nutsize+",sz="+nutsize+",ry=1.5,vr=0.0,1.0,0.0");
    781779                cr.data->reticulopodiacreature = nut;
    782                 nut.moveAbs(cr.pos_x-1.5*nutsize, cr.pos_y-1.5*nutsize, -nutsize);
     780                nut.moveAbs(cr.pos_x-1.5*nutsize, cr.pos_y-1.5*nutsize, -nutsize); //TODO replace -1.5 with the properly calculated value, now nutsize=1, cr.size=0.28284271
    783781        }
    784782}
Note: See TracChangeset for help on using the changeset viewer.