Game Development Community

collision and momentum transfer

by Gagan · in Torque Game Engine · 12/30/2009 (12:17 pm) · 5 replies

Hi,
I am placing two dts object (boulder) in game world using tutorial.base in TGE1.5.2, can anyone please tell me how one object get collied with another object and transfer some momentum to another object while i click on one object (both object placed at some distance in game wold )

#1
12/30/2009 (12:59 pm)
Not exactly "passing momentum" but a easy solution would be to define an impulse against the colliding object in the original object's onCollision() function.

It's not the most beautiful solution the world has ever seen, but it's what I used to stop my AI from getting stuck against each other.
#2
12/30/2009 (3:57 pm)
Thanks Dude,
You really helped me,for my logic but i m newbie i am not understanding how i implement this login into torque script code ,can u guide me or give me some sample code so i can do this .
Now i am enjoying with torque.
#3
12/30/2009 (9:29 pm)
Quote:I am placing two dts object (boulder) in game world using tutorial.base
Are they static shapes? Or are you using datablocks to make them dynamic, like RigidShapes or Items? If not, then they won't even move, much less collide with each other.

Quote:transfer some momentum to another object while i click on one object
Not quite sure what you mean here.

The basic script command you're looking for would be applyImpulse - you should be able to find a complete reference for it on TDN.
#4
01/05/2010 (3:09 pm)
Hi,
One Object is Items(datablocks)another is rigidShapes .



#5
01/05/2010 (5:55 pm)
Hi,
One Object is Items(datablocks)another is rigidShapes .