Jump to content
  • Advertisement
Sign in to follow this  

Moving a tracked (tank) vehicle (ODE)

This topic is 3123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a basic model of a tank that I want to move along terrain I have. My understanding for a human model you can attach a sphere to the bottom and move the human, but the tank is not shaped for that, it would take up the entire model. What is the common or best practice for moving a tracked vehicle that doesn't have wheels?

Share this post


Link to post
Share on other sites
Advertisement
depends on the level of realism your after... You could use a simple block that slides on the ground or you could link together several pieces that forms a thread and apply torque to that.

Since it's all rigid physics - how does it work in real life? ;)

Share this post


Link to post
Share on other sites
Using Ode, I tried moving the box using force, but it didn't move. Maybe this is a lack of knowledge with Ode, but how would I move a boxed body along a trimesh (terrain) without it flipping over?

Share this post


Link to post
Share on other sites
Shift the centre of mass lower then apply force.
Reduce mass of object.
Reduce friction between object and trimesh.
set up spheres in each corner of the tank and use spheres as corners.

Just a few ideas

PureBlackSin

Share this post


Link to post
Share on other sites
I was messing with spheres, but can you have a sphere partially or mostly inside of another gemo? Otherwise you will see the tank hover above the ground more.

Either way though, with sphere's you will see the tank hover over the ground if you put a bounding box around the bottom (the tracks) right?

If that is the case, is the only realistic way to make the tracks a separate mesh with collision attached to the individual tracks?

Share this post


Link to post
Share on other sites
Here's one straight from the manual: Model each set of treads as a singe rigid body, attached to the main part of the tank with some sort of suspension joint. At run time, set the fdir1 of each tread's contact structure to the direction the tread is rolling in. This method is specifically discussed in the ODE Manual section 7.3.7 contact:

"For example consider a car at rest on a road. Pushing the car in its direction of travel will cause it to start moving (i.e. the tires will start rolling). Pushing the car in the perpendicular direction will have no effect, as the tires do not roll in that direction. However - if the car is moving at a velocity v, applying a force f in the perpendicular direction will cause the tires to slip on the road with a velocity proportional to f*v (Yes, this really happens).

"To model this in ODE set the tire-road contact parameters as follows: set friction direction 1 in the direction that the tire is rolling in, and set the FDS slip coefficient in friction direction 2 to k*v, where v is the tire rolling velocity and k is a tire parameter that you can chose based on experimentation."

Share this post


Link to post
Share on other sites
The way I did it:
I used rays to intersect the terrain, then calculated the distance of the up-most point of the suspension and the terrain. Using this, and the distance calculated in the previous frame, I could calculate the spring force, and the damping force (from the speed of changing of the distances).
I used 6 rays, but you can use the same number as the wheels.

Than apply these 6 forces (or more) to a rigid body model of the tank.

The collision detection is a separated thing in this case.

OK it's not ODE, but maybe you can use the idea somehow.
Check out my demo in my signature and the other one too!

Share this post


Link to post
Share on other sites
PM sent.

Is there a simple way to do this? This is for a cartoon tank, doesn't need to be perfect, just don't want it hovering over the ground.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!