Changeset 973 for cpp/frams/genetics/f9
- Timestamp:
- 07/03/20 00:37:13 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f9/f9_conv.cpp
r779 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 18Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 32 32 m.open(using_checkpoints); 33 33 int recently_added = addSegment(m, 0, vertices, current, 0xDead); 34 for (int i = 0; i < in.len (); i++)34 for (int i = 0; i < in.length(); i++) 35 35 { 36 36 char command = in[i]; … … 119 119 double d1 = ind - indpre; 120 120 double d2 = indpost - ind; 121 double v = indpre == indpost ? v1 : d2 *v1 + d1*v2; //d1+d2==1121 double v = indpre == indpost ? v1 : d2 * v1 + d1 * v2; //d1+d2==1 122 122 return v; 123 123 } … … 136 136 Joint *j = m.getJoint(i); 137 137 double x = joints_count < 2 ? 0 : (double)i / (joints_count - 1); //0..1, postion in the rainbow 138 double ind = x *maxind;138 double ind = x * maxind; 139 139 j->vcolor.x = mix(r, maxind, ind); 140 140 j->vcolor.y = mix(g, maxind, ind); … … 153 153 averagecolor += j->vcolor; 154 154 p->vcolor = averagecolor / count; 155 if (count >5) count = 5; //avoid too fat...155 if (count > 5) count = 5; //avoid too fat... 156 156 p->vsize = 0.3 + count / 15.0; //the more Joints is attached to a Part, the fatter it is 157 157 } … … 169 169 ((3 * i + 5) % 10) - 4.5, 170 170 ((7 * i + 2) % 10) - 4.5 171 171 ); //-4.5 .. 4.5 in each axis 172 172 p->p += noise / 1000; 173 173 }
Note: See TracChangeset
for help on using the changeset viewer.