[Opensim-dev] physics architecture
dan miller
danbmil99 at yahoo.com
Sat Nov 3 05:52:07 UTC 2007
ok, I'm trying to wrap my head around what we need wrt physics overhaul. A
good example of what I consider close to broken is the fact that we're
calling AddPrimShape() in 5 places (load from storage, load from xml, rez,
copy...)
This may be all wrong in C#-land, but in my wee little C++ brain I would do
something like this:
SceneObjectGroup should be subclassed as SceneObjectGroupPhysical for any
object that interacts physically. This way, constructors and destructors
can do the right thing wrt allocating & cleaning up physics-engine stuff.
Other methods and properties such as velocity, position, resize, etc. will
also interact with the physics engine as necessary.
Support for multiple engines can be accomplished one of two ways. 1) each
engine further subclasses SceneObjectGroupPhysical (ie SceneObjectGroupOde &
so on), or, we design an engine-agnostic physics API. I would lean towards
the former approach, as it is more general, and will be better suited to
handling special cases that are different among engines. In a sense, one
could argue that the unimplemented methods in SceneObjectGroupPhysical,
which are implemented by the physics engines themselves, are in effect an OO
API.
This is obviously not a fully worked out idea, but I want to get some
initial feedback before I bother to flesh it out.
-danx0r
More information about the Opensim-dev
mailing list