Page 1 of 1

SLXNA with BEPU

Posted: Mon Apr 09, 2012 5:26 pm
by tinydev
in version 7.0 of windows phone you must use 30 fps with the line of code
space.TimeStepSettings.TimeStepDuration = 1 / 30f;

but now in version 7.1 remove this line and it works, of course it's a small example of collision of two entities

worth mentioning that the project is of type SLXNA

What should be used for FPS version 7.1 with SLXNA?
----




On the other hand in another project I have problems with Paint Space entities, pra draw in Draw methodological use this

staticMesh.WorldTransform.Matrix effect.World = / / StaticMesh
/ / ...
effect.World = mobileMesh.WorldTransform;/ / MobileMesh

but it is very slow! Am I doing wrong?

This project is also SLXNA, and I realized that when I use to draw controls UIElementRenderer is even slower, but when you remove the speed does not increase enough to be considered a good simulation.

It does not work that well in Bepu SLXNA or should I look for more in my code if I find there another non-performance

thank you very much for your answers

Re: SLXNA with BEPU

Posted: Mon Apr 09, 2012 6:32 pm
by Norbo
space.TimeStepSettings.TimeStepDuration = 1 / 30f;

but now in version 7.1 remove this line and it works
Removing the TimeStepDuration setter results in the default of 1/60f being used. Changing from 1/30 to 1/60 will result in the simulation advancing slower due to less simulation time passing with each physics time step.

If Space.Update(dt) is used (as opposed to Space.Update() without a parameter which takes a single timestep), then the engine will automatically take as many time steps as needed to keep up with the accumulated time.
What should be used for FPS version 7.1 with SLXNA?
Whatever the simulation needs. There's no single correct time step duration. Typically, using a physics timestep equal to the game's timestep is the most natural.
On the other hand in another project I have problems with Paint Space entities, pra draw in Draw methodological use this

staticMesh.WorldTransform.Matrix effect.World = / / StaticMesh
/ / ...
effect.World = mobileMesh.WorldTransform;/ / MobileMesh

but it is very slow! Am I doing wrong?
The physics engine does not handle or know about graphics, so if the performance problem is related to graphics, I can't provide much help.

If it is a simulation-related performance problem, it may be related to the use of MobileMeshes. By virtue of being constructed of many triangles, they are slower than single simple shapes like boxes or spheres. If performance is a concern, try to use approximations.