Shapes class in Global context

This object defines appearance of the elements of creatures (applies to the 'wireframe' display mode). Default shape definitions make food's "p:" look like a sphere, and manipulator's "p:" look like a robot hand. The model's Vstyle property is the name of the shape. Developers of experiment definitions can introduce new Vstyle(s) for their expdef and provide appropriate shape definitions by calling Shapes.set(...) in the onExpDefLoad() function.

2 members:

function clear
doesn't return a value

Clear

function clear()
function set
doesn't return a value

Id

function set(string id, string definition, integer color)

Arguments:

- "id" - can be
"1p_STYLENAME": affects a single-Part creature (without Joints)
"p_STYLENAME": affects all normal Parts
"j_STYLENAME": affects Joints
(STYLENAME corresponds to the Model.Vstyle value, and it can be empty).

- "definition" is a genotype describing the object shape

- "color" can be 0xRRGGBB or one of the special values: -3 = default creature color, -4 = default food color, -5 = default manipulator color

Examples:
Shapes.set("j_predator","X",0xff0000);//make all predators (i.e. creatures with Vstyle=predator) red
Shapes.set("1p_food","...some...genotype...",-4);//change food appearance
Shapes.set("p_","//0\np:0,0,0\np:-0.1,0,0\np:0.1,0,0\np:0,-0.1,0\np:0,0.1,0\np:0,0,-0.1\np:0,0,0.1\nj:0,1\nj:0,2\nj:0,3\nj:0,4\nj:0,5\nj:0,6\n",0);//make Parts' orientation axes visible


Global context