Sign in to follow this  
leonloi

Help needed on some tokamak physics engine coding ...

Recommended Posts

Need some help on some coding ... i'm currently doing a dominoes effect program using openGL c++ along with tokamak physics engine ... i'm having problem with arranging the domino other than arrange it in a straight line ... can anybody help me on making the arrangement of domino more random ? This is the code that makes the domino arrange in straight line ... appreciate it ... for (int i = 0; i < N_RIGIDBODY; i++) { boxBody[i] = sim->CreateRigidBody(); neGeometry * geom = boxBody[i]->AddGeometry(); geom->SetBoxSize(DOMINO_DEPTH, DOMINO_HEIGHT, DOMINO_WIDTH); boxBody[i]->UpdateBoundingInfo(); boxBody[i]->SetMass(2.0f); boxBody[i]->SetInertiaTensor(neBoxInertiaTensor(DOMINO_DEPTH, DOMINO_HEIGHT, DOMINO_WIDTH, 1.0f)); //position of the dominoes pos.Set((DOMINO_DEPTH * 5.0f * i) + ((float)(rand()% 6 + 2)/100) ,DOMINO_HEIGHT / 2.0f ,0.0f + ((float)(rand()% 1 + 2))); boxBody[i]->SetPos(pos); }

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this