Jump to content

How to setup wheel mass?


Alessandro
 Share

Recommended Posts

Hello,

in order to make a realistic car (I got good results modifying the original DRIVER.LUA + LUASCRIPT FOR VEHICLE), I need to correctly setup wheel mass, but I cannot find any way to do it.

Is it possible? How?

I think is very important, since it let me properly manage car behavior in extreme stunts!

 

Thank you for your help!

Link to comment
Share on other sites

Ok, I understand, but I red in the docs that driver.lua uses joints (from the original doc - http://www.leadwerks.com/wiki/index.php?title=Vehicles):

 

Leadwerks Engine provides a robust vehicle class with support for any number and configuration of tires. The vehicle class is actually an extension of the joint class, and will work with any body entity.

 

SO I cannot understand if driver.lua uses joints (and it means physics) or it is only a simulation :blink:

 

Have you any info how to setup/configure a real physics vehicle using Newton?

Link to comment
Share on other sites

The LE vehicle stuff is realized using Newton joints. But that is the side of it you won't see. You just have the vehicle commands to

build your vehicle.

There is no possibility to give your tires mass, BUT you can use any body commands on the vehicle body itself. You can "simulate" the

wheel mass by adding a constant force (equivalent to the wheel mass) to your vehicle body. In a similar fashion you can also add

air resistance, depending on the vehicle speed.

Hope that helps a bit =)

(Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI)

Link to comment
Share on other sites

I found an official newton component to be used as Vehicle. See this code:

 

    VehicleBasicRayWorld1:=TOXVehicleBasicRayWorld.CreateAsChild(Scene);
   VehicleBasicRayWorld1.MaterialLibrary:=GLMaterialLibrary1;
   VehicleBasicRayWorld1.LightmapLibrary:=GLMaterialLibrary1;
   VehicleBasicRayWorld1.LoadFromFile('impreza.3ds');
   VehicleBasicRayWorld1.Newton.ExtraGravityEnabled:=True;
   VehicleBasicRayWorld1.Newton.ExtraGravity.SetVector(0,-12,0);
   VehicleBasicRayWorld1.Newton.MassCenterX:=0.15;
   VehicleBasicRayWorld1.Newton.MassCenterY:=-0.3;
   VehicleBasicRayWorld1.Newton.Mass:=1280;
   VehicleBasicRayWorld1.Newton.SetMaterialSurface(True,0.05,0.4,0.5,0.5);
   VehicleBasicRayWorld1.Position.SetPoint(-20,10,30);
   VehicleBasicRayWorld1.Newton.AutoSleep:=False;
   VehicleBasicRayWorld1.NewtonConvexTolerance:=0.1;
   VehicleBasicRayWorld1.MaxTorque              := 90;
   VehicleBasicRayWorld1.Traction4x4            := True;
   VehicleBasicRayWorld1.BrakeForce             := 125;
   VehicleBasicRayWorld1.ChassisRotationLimit   := 0.98;
   VehicleBasicRayWorld1.ChassisEngineForce     := 40;
   VehicleBasicRayWorld1.ChassisSteerForce      := 60;
   VehicleBasicRayWorld1.AddTire('swheel.3ds',  oxV4Make(-1.375, -0.35, -0.85), 30, 0.35, 0.3, 1.2, 0.075, 60, 5);
   VehicleBasicRayWorld1.AddTire('swheel2.3ds', oxV4Make(-1.375, -0.35,  0.85), 30, 0.35, 0.3, 1.2, 0.075, 60, 5);
   VehicleBasicRayWorld1.AddTire('swheel.3ds',  oxV4Make( 1.375, -0.35, -0.85), 30, 0.35, 0.3, 1.2, 0.075, 60, 5);
   VehicleBasicRayWorld1.AddTire('swheel2.3ds', oxV4Make( 1.375, -0.35,  0.85), 30, 0.35, 0.3, 1.2, 0.075, 60, 5);
   VehicleBasicRayWorld1.InitNewton;
 SetCurrentDir(ExtractFilePath(Application.ExeName));

 

It seems (as function calls) to Vechicle inside LE. But I noticed in this code they used "BrakeForce", "Traction4x4", etc... maybe some of them could be used in LE too.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...