Great to hear that we are approaching to the next release.. so we have to make some bug tracking now.
ExtendRigidBody is quite buggy. Look at this:
Init[ () //Is excecuted only once.
{
Console(false);
PosX = 0;
PosY = 0;
PosZ = 0;
Dx = GetBodyBBox(Body[13], 0);
Dy = GetBodyBBox(Body[13], 1);
Dz = GetBodyBBox(Body[13], 2);
Dx_wall = GetBodyBBox(Body[14], 0);
Dy_wall = GetBodyBBox(Body[14], 1);
Dz_wall = GetBodyBBox(Body[14], 2);
debug("a" # GetBodyBBox(Body[13], 0));
debug("a" #GetBodyBBox(Body[13], 1));
debug("a" #GetBodyBBox(Body[13], 2));
debug(GetBodyBBox(Body[14], 0));
debug(GetBodyBBox(Body[14], 1));
debug(GetBodyBBox(Body[14], 2));
DefineMaterial(1, 3, 0.7);
DefineMaterial(2, 1, 0.9);
//debug
Body[13] = CreateRigidBody("Body13", "maze_plane.act" ,1,1,1, 0, -1070, -220, -490, 0,0,0, 0,0,0 , false, ALPHA, "Box 20.84 65.51 24.31", 1, 0,0,0,0, Mass);
Body[14] = CreateRigidBody("Body14", "box_centered.act" ,0.1,0.25,4, 0, -1070, -220, -490, 0,0,0, 0,0,0 , false, ALPHA, "Box 0", 1, 0,0,0,0, Mass);
//
// create the jointure
Body[0] = CreateRigidBody("Body0", "box_centered.act",0.1,0.1,1, 255, PosX, PosY-Dy, PosZ, 0,0,0, 0,0,0 , false, ALPHA, "Box 0", 1, 0,0,0,0, Mass);
CreateHingeJoint(Body[0], -1, PosX, PosY-Dy, PosZ, 90,0,0, -6, 6,-6, 6, Dz, -1, 0, 0);
Body[1] = CreateRigidBody("Body1", "box_centered.act",1,0.1,0.1, 255, PosX, PosY-Dy, PosZ, 0,0,0, 0,0,0 , false, ALPHA, "Box 0", 1, 0,0,0,0, Mass);
CreateHingeJoint(Body[0], Body[1], PosX, PosY-Dy, PosZ, 0,0,90, -6, 6,-6, 6, Dz, -1, 0, 0);
// create the plane:
Body[3] = ExtendRigidBody(Body[1], "Body3", "maze_plane.act" ,1,1,1, 255, PosX, PosY, PosZ, 0,1,0, 0,0,0 , false, 0, "Box 0", 1, 0,0,0,0, Mass/2);
// and the borders
Body[4] =ExtendRigidBody(Body[1], "Body4", "maze_bounds.act", 1,1,1, 255, 0,0,0, 0+(Dx*2),0+PosY+3,0, 0,0,0 , false, 0, "Box 0", 1, 0,0,0,0, Mass/16);
Body[5] =ExtendRigidBody(Body[1], "Body4", "maze_bounds.act", 1,1,1, 255, 0,0,0, 0-(Dx*2),0+PosY+3,0, 0,0,0 , false, 0, "Box 0", 1, 0,0,0,0, Mass/16);
Body[6] =ExtendRigidBody(Body[1], "Body4", "maze_bounds.act" ,1,1,0.95, 255, 0,0,0, 0, 0+3, 0+(Dx*2), 0,90* 0.0174532925199433,0, false, 0, "Box 0", 1, 0,0,0,0, Mass/16);
Body[7] =ExtendRigidBody(Body[1], "Body4", "maze_bounds.act" ,1,1,0.95, 255, 0,0,0, 0, 0+3, 0-(Dx*2), 0,90* 0.0174532925199433,0, false, 0, "Box 0", 1, 0,0,0,0, Mass/16);
//create the ball
Body[10] = CreateRigidBody("Body10", "BALL",1,1,1, 255, PosX, PosY-60, PosZ, 0,0,0, 0,0,0 , false, ALPHA, "Sphere 0", 2, 0,0,0,0, Mass/20);
} ]
I used ExtendRigidBody to have a rigid connection between objects. Issues: 1)I can't extend an extended body. 2) extending from the source Body object (trying to create the walls of the maze) I have buggy behaviour, flashing and crazy forces random applied....
3) I don't understand the differences between the PosX, PosY, PosZ parameters and the following parameter triplet. It seems that the working one for modifying the relative position of the extended body is the second. 4) the rotation parameters are in radiants and not in degrees (
5) A StaticBody can't be jointed.
actually I don't how to put the maze over the plane, extendrigidbody is too buggy. Should I try to use SetPositionOfExtended(BodyId, GeomId1, PosX, PosY, PosZ) or SetAngleBetweenExtended(BodyId, GeomId1, GeomId2, AngleX, AngleY, AngleZ)? Whats the difference in respect of ExtendRigidBody? Are this commands useable in "Real Time" in the Start Order, to quickly modify an angle or a Pos?
Now a fantascientific question. Is possible to convert bsp model of the level in a physic object. In this case it would be very simple to create the maze (naturally i think no, but just to rule out the doubts...)?
6) the CreateBallJoint hasn't rotation setting. To create a flipping maze is better than 2 crossed hinges, but I can't turn it up.
7) Please excuse my tirosomeness...
p.s. I have some idea to "simulate" flipping maze using a turning camera, Bsp levels, and lateral forces. But, putting the things in this way, we can put the Tokamak source in the recycle bin... it's a simkin desperate approach!