Page 1 of 1
Vehicle Sample
Posted: Mon Sep 24, 2012 10:23 pm
by Stevemata
The vehicle sample is broken in fork v4.0.30319
I have gone through and corrected the variable name changes, but I'm getting all sorts of other errors. Is there a fixed version?
Re: Vehicle Sample
Posted: Mon Sep 24, 2012 10:34 pm
by Norbo
I'm not sure what fork you mean- as far as I'm aware, all the nondevelopment forks I manage should compile without errors.
Occasionally, the development version won't compile for the Xbox360 (usually due to my prototypes ignoring XBox360 Vector3 initialization details), but the very latest one I just put up there works. The latest development version can always be found here:
http://bepuphysics.codeplex.com/SourceC ... evelopment
Edit:
v4.0.30319 refers to a .NET framework version. If you see errors related to that, some references probably got messed up somewhere.
Re: Vehicle Sample
Posted: Tue Sep 25, 2012 12:10 am
by Stevemata
My mistake, that's two for me today. I updated my references with the latest developer build and demos, it's working much better

Re: Vehicle Sample
Posted: Tue Sep 25, 2012 3:05 pm
by Stevemata
I have the model drawer drawing the vehicles wheels, how do I get the modeldrawer to draw the vehicle's body?
Re: Vehicle Sample
Posted: Tue Sep 25, 2012 5:43 pm
by Norbo
Add the vehicle's body entity to the ModelDrawer. In the BEPUphysicsDemos, there's a loop that runs after the demo is constructed which adds all entities in the Space.Entities list to the ModelDrawer; that's why there's no explicit add in the VehicleInput.
Re: Vehicle Sample
Posted: Tue Sep 25, 2012 5:57 pm
by Stevemata
I added all of my entities to the model drawer, I'm still only getting the wheels. Is there some other setting to make sure the models are drawn?
Re: Vehicle Sample
Posted: Tue Sep 25, 2012 6:14 pm
by Norbo
Make sure the ModelDrawer.Update and ModelDrawer.Draw methods are both called properly. It's possible for special case models like vehicle wheels to draw properly without a ModelDrawer.Update, but the entity representations won't.
Re: Vehicle Sample
Posted: Tue Sep 25, 2012 6:18 pm
by Stevemata
Oh my, yeah no modeldrawer.update... that was it.
Re: Vehicle Sample
Posted: Wed Sep 26, 2012 6:49 pm
by Stevemata
I'm attempting to replace the default wheel with a custom wheel, what world matrix transformation does the modeldrawer use to draw the wheels in the vehicle sample?
Re: Vehicle Sample
Posted: Wed Sep 26, 2012 10:33 pm
by Norbo
The wheel shape exposes a world transform. From the VehicleInput update:
Code: Select all
for (int k = 0; k < 4; k++)
{
WheelModels[k].WorldTransform = Vehicle.Wheels[k].Shape.WorldTransform;
}
There will also likely be some local transform that is required to bring the wheel model into alignment with the wheel shape prior to applying the world transform.