Internalize Entity CoGToModel
Posted: Mon Jun 11, 2012 7:58 am
This might have been suggested previously, but I figured given how many people seem to be running into this issue and how some might expect a physics engine to "internalize" some of its details unless asked for, I wanted to suggest a feature where BEPU allows the use of a "local position"-like offset for the entities.
At a first glance, I'd expect that once an entity is created and the CoG (Center of Gravity) is determined, the user should be able to assign a Vector3 var (like CoGtoLocal) that would internally be used whenever a WorldTransform, Position, Orientation etc. is accessed either thru the getters or setters. This would potentially remove a good deal of the headache involving the book-keeping of model to physics entity positioning. This seems to get even more unwieldy when you have a model that has several pieces broken up into separate entities, and each one of them uses a different offset.
I don't know if it's common practice for physics engines to assign the origin on a physics entity to be its CoG or perhaps there are some underlying reasons why this wasn't done. In any case it'd be curious to hear about it.
Cheers
At a first glance, I'd expect that once an entity is created and the CoG (Center of Gravity) is determined, the user should be able to assign a Vector3 var (like CoGtoLocal) that would internally be used whenever a WorldTransform, Position, Orientation etc. is accessed either thru the getters or setters. This would potentially remove a good deal of the headache involving the book-keeping of model to physics entity positioning. This seems to get even more unwieldy when you have a model that has several pieces broken up into separate entities, and each one of them uses a different offset.
I don't know if it's common practice for physics engines to assign the origin on a physics entity to be its CoG or perhaps there are some underlying reasons why this wasn't done. In any case it'd be curious to hear about it.
Cheers