Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualAgentC

Posted 23 March 2013 - 07:44 AM

If you do not want to go with a full entity/component approach, you probably will need a base scene node class that has a transform, and derive both RenderEntity and PhysicsEntity from that. At the point when you implement eg. skeletal animation, you will likely need these kinds of scene nodes anyway to represent bones.

 

Going this route, you will then likely need a virtual function that is called when the transform changes, which actually updates the transform into the relevant (physics or rendering) subsystem.

 

Parented physical objects will need special attention, because usually physics libraries deal only in world coordinates and do not use parent-child hierarchies themselves. Just be sure to transform the coordinates to the correct space when handling updates into either direction (from your scene graph to the physics engine, or the other way around), and update parents first and then recurse to children.


#2AgentC

Posted 23 March 2013 - 07:43 AM

If you do not want to go with a full entity/component approach, you probably will need a base scene node class that has a transform, and derive both RenderEntity and PhysicsEntity from that. At the point when you implement eg. skeletal animation, you will likely need these kinds of scene nodes anyway to represent bones.

 

Going this route, you will then likely need a virtual function that is called when the transform changes, which actually updates the transform into the relevant (physics or rendering) subsystem.

 

Parented physical objects will need special attention, because usually physics libraries deal only in world coordinates and do not use parent-child hierarchies themselves. Just be sure to transform the coordinates to the correct space when handling updates into either direction (from your scene graph to the physics engine, or vice versa), and update parents first and then recurse to children.


#1AgentC

Posted 23 March 2013 - 07:37 AM

If you do not want to go with a full entity/component approach, you probably will need a base scene node class that has a transform, and derive both RenderEntity and PhysicsEntity from that. At the point when you implement eg. skeletal animation, you will likely need these kinds of scene nodes anyway to represent bones.

 

Going this route, you will then likely need a virtual function that is called when the transform changes, which actually updates the transform into the relevant (physics or rendering) subsystem.


PARTNERS