|
Post by Emerson on Dec 22, 2004 22:29:07 GMT 1
set dir "..\media\vehicle" `first make the rigid body for the chassis, a simple box! Body = LoadBod( "fhbody_teste.bod", 0.0, 0.0, 0.0, 0.0, -0.0, 0.0 )
set object ambience NDB_GetDBPro( Body ), 10 NDB_NewtonBodySetAutoFreeze Body, 0
`body made. let's add the vehicle joint! NDB_SetVector 1, 0.0, 1.0, 0.0 : `up vector required for vehicle joint VehicleJoint = NDB_NewtonConstraintCreateVehicle( Body )
`now add 4 tires! mass# = 5.0 width# = 0.6 radius# = 0.5
xoff1# = 1.45 xoff2# = 1.85 yoff# = -0.5 zoff# = 1.2
NDB_BuildMatrix 0.0,0.0,0.0,10.0,0.0,5.0 NDB_SetVector 1,-0.0,0.0,-1.0 wheel = NDB_NewtonVehicleAddTire( VehicleJoint, mass#, width#,radius#,0.35,1.8,0.4 ) obj = freeobject() load object "tire.x", obj rotate object obj,0.0,90.0,0.0 fix object pivot obj NDB_VehicleTireSetDBProData VehicleJoint, Wheel, obj NDB_VehicleTireSetMaxBrake VehicleJoint, Wheel, 5000.0
when i run the project, this error occurr, Vehicle 1 tire 0 is not defined
what is wrong?
|
|
|
Post by Kjelle69 on Dec 23, 2004 0:28:02 GMT 1
looking at the code, it seems right... somehow the wheel isn't being created...
|
|
|
Post by Emerson on Dec 23, 2004 13:03:27 GMT 1
where i make this?
when i place other vehicle in the place of truck of the example demo06, the tire appear in the center of object, and only appear only one tire. why?
|
|
|
Post by zircher on Dec 23, 2004 15:34:56 GMT 1
As a troubleshooting test, you might want to add some of the Newton debug commands and see if there is a difference between the visual representation of the tire and the collision space of the tire. -- TAZ
|
|