Game Development Community

Tire brake skid and burn out code request

by Ronald J Nelson · in Torque Game Engine · 07/09/2007 (8:00 am) · 2 replies

Roshan Kuriyan and I had been chatting the other day about some code his team had developed that allows vehicles to leave good skid marks during braking and also allows it to leave rubber and do a burn out on take off.

He told me if I would just put up a request on these forums, they would give the code here. So here it is Roshan and thanks.

#1
07/20/2007 (2:40 am)
//-----------------------------------------------------------
The Skidding is Depend Upon Properties(like weight, length) of your vehicle.

These codes are for the Tyre prints codes when u press brake.
Call same function while u turn around the corner.


Add this scripts in in ur vehicle.cs file

datablock ParticleData(TireParticle)
{
textureName = "~/data/shapes/particles/Tiretread"; // place the image as per ur path.
dragCoefficient = 0.0;
gravityCoefficient = 0.3; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 30000; // lasts 0.7 second
lifetimeVarianceMS = 150; // ...more or less
useInvAlpha = true;
// spinRandomMin = -30.0;
// spinRandomMax = 30.0;
colors[0] = "0 0 0 0.8";

//colors[1] = "1 1 1 0";
sizes[0] = 0.6;

//sizes[1] = 2.0;
times[0] = 0.0;
};
datablock ParticleEmitterData(TireEmitter)
{
ejectionPeriodMS = 8.5;
periodVarianceMS = 2;
ejectionVelocity = 0;//1
velocityVariance = 0;//1.0
ejectionOffset = 0.0;
thetaMin = 0;//5
thetaMax = 1;//20
phiReferenceVel = 0;
phiVariance = 360;
// useEmitterColors = true;
overrideAdvance = false;
// orientOnVelocity = true;
particles = "TireParticle";
};


After these add...

tireEmitter = TireEmitter; // All the tires use the same dust emitter

in the datablock WheeledVehicleData(vehicle)
#2
07/22/2007 (12:48 am)
Roshan I was actually asking more about skid marks on the track instead of the wheel emmiter. This I have already done.