Game Development Community

Creating a new TowedVehicle Class

by Mark Dynna · in Torque Game Engine Advanced · 09/04/2007 (4:00 pm) · 2 replies

I'm looking for some high-level direction from people who have been down this road before.

I'm looking at implementing a new TowedVehicle class for a vehicle that will have 2-4 wheels and be towed by 2-4 "animals" in the front. I've been looking at how to implement this as a new object. As I see it there are 2 major paths to take:
  1. Create it as a Vehicle-inherited object, patterned after WheeledVehicle, but with some Animal objects at the front with steering instead of wheels
  2. As a ShapeBase-derived object, like the BT Tank Pack does, to avoid having to deal with all the RigidBody functionality
Any help/advice that can be provided will be greatly appreciated.

#1
09/05/2007 (5:31 pm)
I think you need to drill down a bit more on what you want to do. If you want vehicle type physics, then I'd definitely pattern after the vehicle stuff to take advantage of the rigid shape code. It's pretty intutitive to play around with, just mess with updateForces in wheeledVehicle to get a feel for it.

If you can get away with simpler behavior, then option 2 is best. You can simplify your model and probably just get away with doing some simpler physics.
#2
09/05/2007 (7:34 pm)
Well, I suppose vehicle-style physics would be preferable. In the end I just want it to behave as realistically as possible. The part that I really like about the WheeledVehicle setup is the fact that the towing animals can easily interchanged with different base models, so I'm going to give it a try and see if I can make it work like I want.