Game Development Community

TGB - Physics - "Billiard Physics

by CDK · in Torque Game Builder · 03/14/2007 (9:58 am) · 6 replies

TGB - Physics - "Billiard Physics"

Can someone please assist me I need to build a TGB interface that allows for a ball to bounce from object to object without having gravity defined?

Like a billiard tables ball movement.

#1
03/14/2007 (10:18 am)
@CDK, Just use Rigid Response Modes (think you have to enable that in script) and don't apply gravity to the objects -- gravity is only applied if you apply it ... gravity in TGB is also 2D Based, which means it pushes objects in the direction of the force ... a force of 100 will push the objects down the screen, and a force of -100 will push them up the screen ... there is no 'downward' gravity that pushes the object 'into' the screen ...

Friction is applied to objects to make them slow down, which would be the equivalent of a 'downward' force like gravity in the real world -- since gravity and friction combined are what slows an object in motion down (along with some other concepts, but thats a generic look at it).

For a billiards example, rigid response, with properly weighted and frictioned objecs ... should do the trick ...

If you have a more detailed question, please do ask it ...
#2
03/16/2007 (6:02 am)
Do you perhaps have an example script for the above
#3
03/17/2007 (2:41 am)
CDK, please be more specific ...

"bounce from object to object" ... such as a "pong" style game?

Provide some more detail as to your expected outcome, and I'll see what I can do
#4
03/17/2007 (2:49 am)
Say in Billiard game you would like the white ball to connect with another ball and then reflect away from that ball.
#5
03/17/2007 (2:50 am)
Like a pong but with no gravity
#6
03/17/2007 (3:09 am)
%obj.setCollisionResponseMode("RIGID");

Put that in your onLevelLoaded, and see how it works ...


Let me know if you have any further questions ...