Yet another Vehicle question...
by Gonzo T. Clown · in Torque Game Engine · 09/17/2004 (9:20 pm) · 4 replies
Why are..
drag
density
not included in the pack/unpack section of vehicle.cc when everything else is?
drag
density
not included in the pack/unpack section of vehicle.cc when everything else is?
About the author
#2
09/17/2004 (11:19 pm)
They're part of ShapeBase, from which the Vehicle classes are derived. Vehicle.cc calls parent::pack/unpack which runs the ShapeBase pack/unpack, where drag and density are.
#3
Based on what your saying though, and looking through the other classes, the drag and density settings I'm looking at most likely shouldn't even be there.
EDIT: I commented out the drag and density in the vehicle class and it doesn't seem to make any difference so I think it's safe to assume those settings didn't even belong.
09/18/2004 (2:52 am)
So Flyer class vehicles call back to vehicle, and vehicle calls back to Shapebase correct? I'm just worried that the mass and density may be getting tweaked every so often by default settings...Based on what your saying though, and looking through the other classes, the drag and density settings I'm looking at most likely shouldn't even be there.
EDIT: I commented out the drag and density in the vehicle class and it doesn't seem to make any difference so I think it's safe to assume those settings didn't even belong.
#4
While shapebase creates and initializes drag and density, it doesn't actually do anything with those properties. It's left up to the derived clases, in this case flyingvehicle, to put those properties to use in their physics code. Which FlyingVehicles do in flyingVehicle.cc on lines 501 and 502.
From a quick search, it looks like the vehicle class initializes drag to 0.7 and density to 4. Flyingvehicle doesn't override that, so those should be the values the a flying vechicles gets IF they aren't set to something else in the flyingvehicle datablock.
The datablock values should remain constant. The mDrag var in flyingvehicle class instances however, is affected by water. It's changed to reflect water viscosity and coverage in ShapeBase::updateContainer(). And this will affect the physics in flyingVehicle.cc.
Also, I don't know if this is helpful but it appears that the vehicle class adds a minDrag and maxDrag parameter. These too are used in the physics code for flyingVehicles. Check flyingVehicle.cc lines 435 and 436 to see where they are applied.
09/18/2004 (5:22 am)
Flyer calls vehicle calls shapebase, yes. So flying vehicles inherit their drag and density variables from shapebase. While shapebase creates and initializes drag and density, it doesn't actually do anything with those properties. It's left up to the derived clases, in this case flyingvehicle, to put those properties to use in their physics code. Which FlyingVehicles do in flyingVehicle.cc on lines 501 and 502.
From a quick search, it looks like the vehicle class initializes drag to 0.7 and density to 4. Flyingvehicle doesn't override that, so those should be the values the a flying vechicles gets IF they aren't set to something else in the flyingvehicle datablock.
The datablock values should remain constant. The mDrag var in flyingvehicle class instances however, is affected by water. It's changed to reflect water viscosity and coverage in ShapeBase::updateContainer(). And this will affect the physics in flyingVehicle.cc.
Also, I don't know if this is helpful but it appears that the vehicle class adds a minDrag and maxDrag parameter. These too are used in the physics code for flyingVehicles. Check flyingVehicle.cc lines 435 and 436 to see where they are applied.
Associate Anthony Rosenbaum