[SOLVED] PhysX vehicle wheel issues
Posted: Fri Feb 06, 2009 11:06 pm
As my vehicle gains speed, the wheels gradually move backward from their original position, as if they are being pulled back from their suspension
screenshots while car is at running at high speed and while its at rest
http://www.flickr.com/photos/23370020@N03/3258280735/
http://www.flickr.com/photos/23370020@N03/3258285897/
Any idea why this is happening and how I can fix it?
Thanks.
P.S.: Ignore the values on the UI in the screenshots. Here is the actual configuration of the vehicle:
screenshots while car is at running at high speed and while its at rest
http://www.flickr.com/photos/23370020@N03/3258280735/
http://www.flickr.com/photos/23370020@N03/3258285897/
Any idea why this is happening and how I can fix it?
Thanks.
P.S.: Ignore the values on the UI in the screenshots. Here is the actual configuration of the vehicle:
Code: Select all
-- prepare a vehicle
vehicleConfig = VehicleConfiguration(getRandomName("Vehicle"))
vehicleConfig.density = 700
vehicleConfig.centerOfMass = Vector3(0, -0.5, 0)
pos = Vector3(0, 15, 0)
vehicleConfig.initialPosition = pos
log("Position is:" .. pos.x .. "," .. pos.y .. "," .. pos.z);
-- create the chasis
chasisConfig = ChasisConfiguration("audi_chasis.mesh")
chasisConfig.localPose = Vector3(0, 1.0, 0)
vehicleConfig:setChasisConfiguration(chasisConfig)
-- prepare the wheels
wheelSuspension = 0.4
wheelRadius = 0.5
wheelWidth = 0.6
maxBrakeForce = 1000
springRestitution = 80000
springDamping = 10000
springBias = 0
frontWheelHeight = 0.1
rearWheelHeight = 0.1
frontWheelDistance = 2.00
rearWheelDistance = -2.15
leftSide = 1.20
rightSide = -1.20
-- Wheel 1 (Front Left)
wheelConfig = WheelConfiguration("1", "audi_wheell.mesh")
wheelConfig.localPose = Vector3(leftSide, frontWheelHeight, frontWheelDistance)
wheelConfig.steerable = true
wheelConfig.affectedByHandbreak = true
wheelConfig.wheelSuspension = wheelSuspension
wheelConfig.springRestitution = springRestitution
wheelConfig.springDamping = springDamping
wheelConfig.springBias = springBias
wheelConfig.wheelRadius = wheelRadius
wheelConfig.wheelWidth = wheelWidth
wheelConfig.maxBrakeForce = maxBrakeForce
vehicleConfig:addWheelConfiguration(wheelConfig)
-- Wheel 2 (Front Right)
wheelConfig = WheelConfiguration("2", "audi_wheelr.mesh")
wheelConfig.localPose = Vector3(rightSide, frontWheelHeight, frontWheelDistance)
wheelConfig.steerable = true
wheelConfig.affectedByHandbreak = true
wheelConfig.wheelSuspension = wheelSuspension
wheelConfig.springRestitution = springRestitution
wheelConfig.springDamping = springDamping
wheelConfig.springBias = springBias
wheelConfig.wheelRadius = wheelRadius
wheelConfig.wheelWidth = wheelWidth
wheelConfig.maxBrakeForce = maxBrakeForce
vehicleConfig:addWheelConfiguration(wheelConfig)
-- Wheel 3 (Rear Left)
wheelConfig = WheelConfiguration("3", "audi_wheell.mesh")
wheelConfig.localPose = Vector3(leftSide, rearWheelHeight, rearWheelDistance)
wheelConfig.accelerated = true
wheelConfig.affectedByHandbreak = false
wheelConfig.wheelSuspension = wheelSuspension
wheelConfig.springRestitution = springRestitution
wheelConfig.springDamping = springDamping
wheelConfig.springBias = springBias
wheelConfig.wheelRadius = wheelRadius
wheelConfig.wheelWidth = wheelWidth
wheelConfig.maxBrakeForce = maxBrakeForce
vehicleConfig:addWheelConfiguration(wheelConfig)
-- Wheel 4 (Rear Right)
wheelConfig = WheelConfiguration("4", "audi_wheelr.mesh")
wheelConfig.localPose = Vector3(rightSide, rearWheelHeight, rearWheelDistance)
wheelConfig.accelerated = true
wheelConfig.affectedByHandbreak = false
wheelConfig.wheelSuspension = wheelSuspension
wheelConfig.springRestitution = springRestitution
wheelConfig.springDamping = springDamping
wheelConfig.springBias = springBias
wheelConfig.wheelRadius = wheelRadius
wheelConfig.wheelWidth = wheelWidth
wheelConfig.maxBrakeForce = maxBrakeForce
vehicleConfig:addWheelConfiguration(wheelConfig)
-- Create the vehicle
vehicle = vehicleManager:createVehicle(vehicleConfig)
return vehicle