What is the best way to create vehicles in the final Newton 3.14? There are several demos:
- Heavy vehicle
-Construction vehicle
-Single-body car
-Super car
-Multi-body car
There is also a dVehicleManager folder in the SDK.
Which should be used?
Moderators: Sascha Willems, walaber
bool PhysicsVehicle::Finalize()
{
Mat4 localframe;
Mat4 tiremat;
delete newtonvehicle;
tires.clear();
newtonvehicle = new dMultiBodyVehicle(chassis->newtonbody, &localframe[0][0], chassis->world->gravity.y);
newtonvehicle->SetUserData(this);
for (int n=0; n < tireinfo.size(); ++n)
{
tiremat.t.x = tirepositions[n].x;
tiremat.t.y = tirepositions[n].y;
tiremat.t.z = tirepositions[n].z;
tires.push_back(newtonvehicle->AddTire(&tiremat[0][0], tireinfo[n]));
}
for (const auto& axle : axles)
{
newtonvehicle->AddDifferential(1, 1, tires[axle.x], tires[axle.y]);
}
newtonvehicle->Finalize();
return true;
}
Users browsing this forum: No registered users and 42 guests