TGB C++ code - Pool Ball Physics?
by Tom Biagioni · in Torque Game Builder · 03/03/2009 (10:31 am) · 26 replies
Can you add C++ to the TGB engine? The reason i am asking is that i have code written out in C++ for pool ball physics, and collisions, but i dont know how to add it with torque script. How does this all work? Should i just try and write it all out in script, or can i build my project the C++ code?
#22
03/05/2009 (1:15 pm)
Yes :)
#23
03/05/2009 (1:39 pm)
OK, this is making more sense. So, rather than rely on Torque's physics, you want to rely on your math, right?
#24
Also, if you change the physics in the C++, you can hard-code the values for mass, etc once they feel pretty good in script. In this case, you would re-enable the physics in TorqueScript, obviously, but the source would point towards your methods instead of the defaults.
03/05/2009 (1:40 pm)
Oh! A double post. Either way, you should probably *disable* physics in TorqueScript and instead use your onCollision callback to work with your stuff. A more ideal solution would be to change the physics in the C++ to what you want to use.Also, if you change the physics in the C++, you can hard-code the values for mass, etc once they feel pretty good in script. In this case, you would re-enable the physics in TorqueScript, obviously, but the source would point towards your methods instead of the defaults.
#25
03/05/2009 (1:59 pm)
:) Ill see what i can do, thanks for all your help! Ill look into the C++ engine source, and see what i can find, and change.
#26
03/05/2009 (2:33 pm)
**double*
Torque 3D Owner Jason Ravencroft