Hey guys,
So I am trying to plan out how I will do my actor hierarchies, I am referring to how my actors will be in relation to one another if they are made of several different types.
For instance, Unity seems to have there hierarchy set up through the transform component. I will try to describe what I have come up and any input or advice would be great.
I see my Physics and Transform components as being directly in sync, if there is no physics component the only way to move is with the transform which works fine, but if there is one, it is best to use the physics component for movement, however applying to the transform will still update both (but with undesirable effects). The render component is simply the visual aspect of the actors.
When I think of what systems will be affected by an object in a hierarchy I think of only the physics, transform and render. Each one will need to know that object B is a child of object A, which also means it's position is relative to that parent. I have thought of each system yet I still am coming up short on how I should do this properly.
Physics - I figure that in order for the physics to understand that these objects are attached to one another I will need to apply a physics joint to attach them. This will in turn either set the object and its attached objects (by joint) to kinematic, or put them under physics control
Transform - I also figured that the game logic will also need to know about these relations, for instance a tank actor will have a turret, the game logic will need to know this in order to fire the cannon in the orientation of the turret. The only way I can think of doing this is by making a similar scene hierarchy where transforms have children, I believe Unity does something like this
Render - Now this is where I get confused, the scene graph is efficient for rendering, but should I have a duplicate scene graph but just for the rendering?
Also, how do most people go about converting a 3D model into a complete actor with a heirarchy? Do they make an actor with a render component that loads the model, and then grabs all the child models in the file and creates there own actor for each one, and then links the actors together appropriately?
Any advice or resources would be great, this is really stumping me.
So I am trying to plan out how I will do my actor hierarchies, I am referring to how my actors will be in relation to one another if they are made of several different types.
For instance, Unity seems to have there hierarchy set up through the transform component. I will try to describe what I have come up and any input or advice would be great.
I see my Physics and Transform components as being directly in sync, if there is no physics component the only way to move is with the transform which works fine, but if there is one, it is best to use the physics component for movement, however applying to the transform will still update both (but with undesirable effects). The render component is simply the visual aspect of the actors.
When I think of what systems will be affected by an object in a hierarchy I think of only the physics, transform and render. Each one will need to know that object B is a child of object A, which also means it's position is relative to that parent. I have thought of each system yet I still am coming up short on how I should do this properly.
Physics - I figure that in order for the physics to understand that these objects are attached to one another I will need to apply a physics joint to attach them. This will in turn either set the object and its attached objects (by joint) to kinematic, or put them under physics control
Transform - I also figured that the game logic will also need to know about these relations, for instance a tank actor will have a turret, the game logic will need to know this in order to fire the cannon in the orientation of the turret. The only way I can think of doing this is by making a similar scene hierarchy where transforms have children, I believe Unity does something like this
Render - Now this is where I get confused, the scene graph is efficient for rendering, but should I have a duplicate scene graph but just for the rendering?
Also, how do most people go about converting a 3D model into a complete actor with a heirarchy? Do they make an actor with a render component that loads the model, and then grabs all the child models in the file and creates there own actor for each one, and then links the actors together appropriately?
Any advice or resources would be great, this is really stumping me.
PC - Custom Built
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz
CPU: 3rd Gen. Intel i7 3770 3.4Ghz
GPU: ATI Radeon HD 7959 3GB
RAM: 16GB
Laptop - Alienware M17x
CPU: 3rd Gen. Intel i7 - Ivy Bridge
GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
RAM: 8GB Dual Channel DDR3 @ 1600mhz