1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
void importGeometries()
{
//set al diabolos to the right place (they all start at position (0,0,0))
string selectString;
for( int i = 0; i <= (amountDiabolos-1); i++)
{
for (int a = 0; a < 2; a++) //loop for diabolos and rings
{
string ArrayDiabolo[2] = { ("diaboloL("+ to_string((_ULonglong)i)+")"), ("diaboloR("+ to_string((_ULonglong)i)+")")};
selectString = ArrayDiabolo[a];
coupling.getGeometryId(selectString.c_str(),selected);
C3dValue move = C3dValue( cos(diaboloAngle)*(i-1)*diaboloDist, //movement in x direction
0, //movement in y direction
sin(diaboloAngle)*(i-1)*diaboloDist); //movement in z direction
coupling.setGeometryMotion(selected,move,zeroMatrix,zeroVector,zeroVector,0);
if ( i % 2== 0 ) //loop for Rings (only on even positions)
{
string ArrayRing[2] = { ("ringL("+ to_string((_ULonglong)i/2)+")"), ("ringR("+ to_string((_ULonglong)i/2)+")")}; //i/2 to call voor Ring(0)Ring(1).. instea (0)(2) etc
selectString = ArrayRing[a];
coupling.getGeometryId(selectString.c_str(),selected);
C3dValue move = C3dValue( cos(diaboloAngle)*(i-1)*diaboloDist, //movement in x direction
0, //movement in y direction
sin(diaboloAngle)*(i-1)*diaboloDist); //movement in z direction
coupling.setGeometryMotion(selected,move,zeroMatrix,zeroVector,zeroVector,0);
}
}
}
}
|