Stopping time for an object
Posted: Thu Jan 19, 2012 4:03 pm
Hi!
I'm developing a game which will be based in physic interaction with objects. Our main character will have the power to stop time, but just for one object at a time.
For example, if the character throws a box and uses his power while the box is still "flying" it should stop moving and remain static in the air. Other objects should be able to collide with the box when it is "freezed". After "unfreezing" the box it should continue "flying" as if time had never been stopped.
I've been playing with bullet and seemed to achieve this result by switching the mass of the object to 0 ("switching" it to static) as well as changing its Linear and Angular velocity to 0,0,0. To "unfreeze" the object I just put back the orginal values.
The problem is that sometimes it does strange things (objects not colliding correctly with the freezed object or flying away of it).
I'm pretty sure this is not the best way to achieve this result. Could you give me a better solution to my problem?
Thank you in advance!
David
I'm developing a game which will be based in physic interaction with objects. Our main character will have the power to stop time, but just for one object at a time.
For example, if the character throws a box and uses his power while the box is still "flying" it should stop moving and remain static in the air. Other objects should be able to collide with the box when it is "freezed". After "unfreezing" the box it should continue "flying" as if time had never been stopped.
I've been playing with bullet and seemed to achieve this result by switching the mass of the object to 0 ("switching" it to static) as well as changing its Linear and Angular velocity to 0,0,0. To "unfreeze" the object I just put back the orginal values.
The problem is that sometimes it does strange things (objects not colliding correctly with the freezed object or flying away of it).
I'm pretty sure this is not the best way to achieve this result. Could you give me a better solution to my problem?
Thank you in advance!
David