Game Development Community

Physics and renderObject can it do this?

by Mike Rowley · in Torque Game Engine · 09/02/2007 (2:01 pm) · 3 replies

I've been playing with the render object resource. I have boxes and rocks that move when shot or the player runs into them. My grandson (7 years old) has a lot of fun getting the rocks to fly into space.
What I am trying to do can be seen in this video.

I have tried stacking boxes, but they refuse to sit atop each other. My question is, is this possible in stock torque?

#1
09/04/2007 (8:12 am)
I would start by looking up rigidShape. I know that rigidShapes use a simple spring algorithm to resolve resting contacts. I wouldn't build a house with rigidShape bricks, but it could probably be used to stack a few boxes on top of each other, if that's all you're after. And yes, they are available in stock torque.
#2
09/04/2007 (9:20 pm)
You are in for a LOT of work. I would suggest looking into existing physics engines others have incorporated into the engine. I messed with verlet representations to track velocity, momentum, and apply accelerations and the collisions are a killer in CPU cycles. I started working on doing simple box collisions (which is probably what you would want) and never got to the point where I was doing my own collision detection. I just didn't have enough time to get my mind around it.

Rigid shape is a good place to start, but you put more than a few objects in there and it will bog down the engine big time. Of course I did most of my experimenting on a 900MHz machine. Your mileage may vary.
#3
09/05/2007 (6:12 pm)
Thanks. I wasn't planning on putting in very many blocks. I was thinking more of like 3 or 4 blocks stacked in the middle of a pathway. Shoot the blocks to move them out of the way. I'll dig a little deeper and see what I can find. I don't need it for a while, so have plenty of time to research it.
Thanks for the posts. :-)