This raycast vehicle is create with newton, but don't use the original newton raycast vehicle.
It is a experimental method from me in test to make a very basic raycast vehicle.
It is totally controled by force, and velocity.
Download here:
http://oxnewton.googlepages.com/oxNewton2_Alpha8.zip
In the zip you can find oxNewton2VehicleWorldRay.pas this is my custom raycast vehicle code.
The vehicle is currently create like this:
vCar1:=TOXVehicleBasicRayWorld.CreateWithManager(vCar1,Manager);
vCar1.TractionPin:=tpmUp;
vCar1.SteerPin:=tpmFront;
vCar1.ChassisPin:=tpmRight;
vCar1.TurnAngle:=90;
vCar1.Mass:=1000;
vCar1.Position:=oxV4Make(0,5,0);
vCar1.SteerForce:=(vCar1.Mass*10*0.25);
vCar1.TractionForce:=(vCar1.Mass*10*0.25);
// Back Left
// pos, friction, spring, springdamp, tire mode.
vCar1.AddTire( 1.0, -1.4, -1.2, 0.025, 35, 30, tmTractionOnly);
// Back Right
vCar1.AddTire(-1.0, -1.4, -1.2, 0.025, 35, 30, tmTractionOnly);
// Front Left
vCar1.AddTire( 1.0, 1.1, -1.2, 0.015, 45, 30, tmSteerOnly);
// Front Right
vCar1.AddTire(-1.0, 1.1, -1.2, 0.015, 45, 30, tmSteerOnly);
vCar1.InitNewton;
And it is controled like this:
if (vCar1<>nil) then begin
with vCar1 do begin
if oxKeyDown(VK_UP) then begin
SetTireTraction(tmForward);
end else
if oxKeyDown(VK_DOWN) then begin
SetTireTraction(tmBackward);
end;
if oxKeyDown(VK_LEFT) then begin
SetTireSteer(smLeft);
end else
if oxKeyDown(VK_RIGHT) then begin
SetTireSteer(smRight);
end;
end;
end;
If you need any information contact me here, or use my info in my code.
Remember you it is currently unfinished and in construction again.
Good luck and have fun with your simulation.