Jump to content
  • Advertisement
Sign in to follow this  

Help needed on some tokamak physics engine coding ...

This topic is 3052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 = sim->CreateRigidBody(); neGeometry * geom = boxBody->AddGeometry(); geom->SetBoxSize(DOMINO_DEPTH, DOMINO_HEIGHT, DOMINO_WIDTH); boxBody->UpdateBoundingInfo(); boxBody->SetMass(2.0f); boxBody->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->SetPos(pos); }

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!