Hi,
I set up a vehicle which behaves quite good as long as the wheels stay on plain ground, if they leave the ground( are airborne) or stand on an oblique surface, they start wobbeling uncontralable (WheelFacingAngle still works) around till they reach a plain backgroound again. What could be the reason for that? Is it right that I gave the ConvexHull which is in the ConpoundBody which builds the Vehicle body a mass (100.0) and the wheels build from Cylinders don't have a mass?
Is there maybe a guide on how to simply setup a vehicle with BEPUphysics?
thx Grobi
wobbeling wheels of vehicle
Re: wobbeling wheels of vehicle
The wheels of a Vehicle are 'non physical' in that the entities are just used for their shape (when using ConvexCastWheels), so you don't need to worry about their masses.
The wobble could be purely graphical. Do you notice any bad physical behavior from the vehicle when the wheels look like they are wobbling? Are you using the wheel.worldMatrix property for rendering?
You can find an example Vehicle configuration in the BEPUphysicsDemos project VehicleInput class (http://www.bepu-games.com/BEPUphysics/downloads.htm). There's also another sample configuration in this thread for a more arcadey vehicle: http://www.bepu-games.com/forums/viewto ... ?f=4&t=547
The wobble could be purely graphical. Do you notice any bad physical behavior from the vehicle when the wheels look like they are wobbling? Are you using the wheel.worldMatrix property for rendering?
You can find an example Vehicle configuration in the BEPUphysicsDemos project VehicleInput class (http://www.bepu-games.com/BEPUphysics/downloads.htm). There's also another sample configuration in this thread for a more arcadey vehicle: http://www.bepu-games.com/forums/viewto ... ?f=4&t=547
Re: wobbeling wheels of vehicle
I use :
FrontLeft
((ConvexCastWheel)vehicle.wheels[0]).wheelShape.orientationMatrix * vehicle.wheels[0].worldMatrix;
FrontRight
((ConvexCastWheel)vehicle.wheels[1]).wheelShape.orientationMatrix * Matrix.CreateRotationZ(MathHelper.ToRadians(180f)) * vehicle.wheels[1].worldMatrix;
RearLeft
((ConvexCastWheel)vehicle.wheels[2]).wheelShape.orientationMatrix * vehicle.wheels[2].worldMatrix;
RearRight
((ConvexCastWheel)vehicle.wheels[3]).wheelShape.orientationMatrix * Matrix.CreateRotationZ(MathHelper.ToRadians(180f)) * vehicle.wheels[3].worldMatrix;
as worldMatrices for rendering of the wheel models and :
vehicle.body.worldTransform as worldMatrix for rendering of the car model.
The weird thing is, its only happening when the tire is partially or fully airborne. as soon as they have flat contact, their back to normal.
FrontLeft
((ConvexCastWheel)vehicle.wheels[0]).wheelShape.orientationMatrix * vehicle.wheels[0].worldMatrix;
FrontRight
((ConvexCastWheel)vehicle.wheels[1]).wheelShape.orientationMatrix * Matrix.CreateRotationZ(MathHelper.ToRadians(180f)) * vehicle.wheels[1].worldMatrix;
RearLeft
((ConvexCastWheel)vehicle.wheels[2]).wheelShape.orientationMatrix * vehicle.wheels[2].worldMatrix;
RearRight
((ConvexCastWheel)vehicle.wheels[3]).wheelShape.orientationMatrix * Matrix.CreateRotationZ(MathHelper.ToRadians(180f)) * vehicle.wheels[3].worldMatrix;
as worldMatrices for rendering of the wheel models and :
vehicle.body.worldTransform as worldMatrix for rendering of the car model.
The weird thing is, its only happening when the tire is partially or fully airborne. as soon as they have flat contact, their back to normal.
Re: wobbeling wheels of vehicle
You shouldn't need to rotate the wheel's world matrix. For example, in the demos, the rendering world matrices are set like this:
If the wheel is set up properly, the wheel worldMatrix will include the other transformations (unless the display graphics need some additional offset). Try removing the extra transformations (the reference to the wheelShape's orientation matrix, specifically).
The setup for the vehicle is a little cantankerous right now (until v0.11.1), so I recommend building off of a pre-existing example like in the demos.
Code: Select all
wheelModels[k].worldMatrix = vehicle.wheels[k].worldMatrix;
The setup for the vehicle is a little cantankerous right now (until v0.11.1), so I recommend building off of a pre-existing example like in the demos.
Re: wobbeling wheels of vehicle
>wheelModels[k].worldMatrix = vehicle.wheels[k].worldMatrix;
You were right, it was just the graphics object which got screwed up, now it works!
thx again
Grobi
You were right, it was just the graphics object which got screwed up, now it works!
thx again
Grobi