Sweenie wrote:Well, I tried to recreate how Unity handles collision shapes.
First you have the Game Object with the Rigid Body Component (NewtonBody).
When the NewtonBody is created it will look for NewtonCollision components, first in it's own Game Object and also in it's children Game Objects.
I use the Unity function FindComponentsInChildren<NewtonCollision>()
what was wrong with that approach?
I was under the impression that you said earlier that Unit will create components out of order.
or was I confusing GameObject with components?
The was I see the a physics world layout can be like this:
-NewtonWord is a unique component of a GameObjects.
-NewtonRigifBody is a Unique Component of a Game object.
I was thinking that NewtonCollision should be a component of a RigidBody, but that is wrong
I think it is better we can make a Netwo collision components of a Game object.
A Game object can have as many collision shape as it needs.
to go around the problem that the can be a Game object with a Body, but not a shape,
we can add a default NULL shape.
if for example a body has shape by no bodies we can add a default body and make static body.
do you think that is reasonable?
is so, then only problem we have to worry about is the order of creation of worlds and Bodies.