Experimental raycast vehicle.

Share with us how are you using the powerrrr of the force

Moderator: Alain

Experimental raycast vehicle.

Postby Dave Gravel » Fri Dec 12, 2008 6:55 am

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.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 690
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 1 guest