Angular Momentum

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Eizon
Posts: 7
Joined: Sat Dec 20, 2008 8:12 pm

Angular Momentum

Post by Eizon »

Hi

I'm currently developing a little game, mostly as a personal playground. Your physics library is just GREAT! It's very adjustable and performs great on computer that should have been scraped a long time ago. I've managed my previous problems, but it took some time. So before spending all my holidays on this problem, I thought I could ask the developers for a little hint.

Is it possible to make the "angular momentum" ("spin" in my language) go to, or close to zero? While also reserving the weight/mass of the object?

I currently use "angularImpulse" to create a rotation on a object to give it speed on the ground, as well as limiting the maximum speed of angle. But I do not want the object to contain so much rotational energy that it could make itself move when the angularImpulse is not active. I can archive a little of this if I reduce the mass, but then the game crashes due to a spring instability connected to the object. Makes sense of course, as this is not how the world works in real life.

I have not archived any result using the "density" feature. Perhaps I'm using it wrong? Or perhaps I am thinking in the wrong direction?

If it helps (or you are interested), this is my project: http://mopolauta.moposite.com/viewtopic ... 6b&start=0
I'm planning on a freeware or open-source license on the game. It shouldn't produce any problems with the BEPUphysics license?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Angular Momentum

Post by Norbo »

Glad you like it!

The angularMomentum and angularVelocity property of an entity can be used to set the momentum/velocity arbitrarily. You could also try tuning the inertiaTensor of the body by scaling it up or down by some factor (downscaling it would keep the motorcycle from jumping forward as much when a high angular velocity wheel touched down, but it can also have stability side effects).

Density is really only used for buoyancy calculations. It's possible to have an 'incorrect' density that doesn't match mass / volume to tune how much an object floats.

The project looks neat; there shouldn't be any licensing issues. Other developers who want to modify your source and re-release it would have to understand and agree to the BEPUphysics licensing terms though (under the noncommercial agreement unless they want to sell their version).
Eizon
Posts: 7
Joined: Sat Dec 20, 2008 8:12 pm

Re: Angular Momentum

Post by Eizon »

Thank you :)

I think I'll try playing around with "inertiaTensor" then, sounds promising. Wheel-level collision detection events could help as well. I'll post a update when I get there.

Again, thank you for making this amazing piece of software. It is so fun making huge box-towers, and destroying them. :twisted:
Eizon
Posts: 7
Joined: Sat Dec 20, 2008 8:12 pm

Re: Angular Momentum

Post by Eizon »

Works like a charm! :) Didn't even need collision detection events.

Code: Select all

Entity.localSpaceInertiaTensor *= Matrix.CreateScale(0,1f);
I could even use it to improved the breaking algorithm. Now the game is finally in fully playable state, with this, beta isn't too far away. Thank you very much.
Post Reply