Building a Space every frame

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
MadMartin
Posts: 1
Joined: Sun Oct 07, 2012 3:00 pm

Building a Space every frame

Post by MadMartin »

Hi,

i'm new to Bepu physics and i have some questions.

I already have a lot of my engine up and running but i still need a physics engine for FPS like movement. For the time beeing there will be only static environment and a few players. The problem is that i cannot afford to load a whole map at once(too much memory). I have a very crude collision test working(to get development going) and i can easily estimate all the collision candidates around a player.

So the question is, can i construct a space every frame, or can i modify it every frame...
Performance is not that a big issue as there will be less than 1000 candidates(cube with 16x16x16 size) that my existing code would detect and put into a space. If the test takes say 10ms every Frame, it's not a problem.

The motivation to switch to BEPU physics is that i want solid and robust FPS like movement with any geometry.

Secondly, can i use the FPS code in the BEPU demo? Is it released under the same licence?

Martin
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Building a Space every frame

Post by Norbo »

So the question is, can i construct a space every frame, or can i modify it every frame...
Constructing a space every frame would be very bad. It would be slow, behaviorally unstable, and a bit difficult developmentally.

You can add and remove objects from the space on the fly using Space.Add and Space.Remove. These aren't super expensive, but they aren't free- limit their usage to only the truly required subset of changes.
Secondly, can i use the FPS code in the BEPU demo? Is it released under the same licence?
Yup, you can use the CharacterController code and the rest of it. All the code on the BEPUphysics codeplex is under the same Apache 2.0 license.
Post Reply