SimpleVehicle, Vehicle or CustomVehicle?

mvelazquezm

17-09-2010 08:22:37

Hi

I´m making a skateboard game. It´s like a car game and now I´m using SimpleVehicle class for de physics (hidden bodys make physics interaction and other visible Scenenodes linked for the visual effects).

Now I´ll begin to doing physics effects and controls and I don´t know how use this class.
- the setTorqueSteering method works in SimpleVehicle class??
- or its better that I use Vehicle class??
- or Should I add local forces to make my "custom" vehicle turn??

Another question is: Where can I know the funtionality and correct parameters of: angularDamping, linearDamping, suspension shock, suspension Spring, suspension Lenght, friction, ... ??? In newtonGameDinamics api??

Thanks!!

mvelazquezm

22-09-2010 12:42:26

mmmm

I saw that SimpleVehicle haven´t got setTorque and setSteering methods .....

addlocal forces to my SimpleVehicle works, it isn´t perfect but ....., but it isn´t a nice solution.
Then, I´m thinking in doing my CustomVehicle class with these methods (steering, torque), Can I use Vehicle class for a reference?
or, can someone gives me a short introduction to do that or some code or anything to guide me??

Thanks a lot

razi

22-09-2010 18:49:35

I think you should go ask that in official newton forum, theres much bigger chance someone wanted something similar.

mvelazquezm

30-09-2010 15:49:19

Finally, I did it using CustomDGRayCastCar class from Newton.

Now I only have to do, that my car doesnt slip a lot, but I think that this is some of mass, suspension, friction, .... attributes, no?


void MyVehicle::setSteering(float value) {
static float lastvalue = 0.0f;
if (fabs(lastvalue - value) > 1e-4) {
CustomDGRayCastCar* veh = (CustomDGRayCastCar*) this->GetSupportJoint();
veh->SetTireSteerAngleForce(2, value, 0.0f);
veh->SetTireSteerAngleForce(3, value, 0.0f);
lastvalue = value;
}
}

void MyVehicle::setTorque(float value) {
CustomDGRayCastCar* veh = (CustomDGRayCastCar*) this->GetSupportJoint();
veh->SetTireTorque(0,value);
veh->SetTireTorque(1,value);
veh->SetTireTorque(2,value);
veh->SetTireTorque(3,value);
}


greetings