Hey Guys,
I asked this question quite a while back, and I don't think I ever quite grasped it or got an answer that really satisfied the question, it would be really nice to get this figured out and I hope that someone has an answer.
Here is the situation I will use as a model;
- I have an empty scene
- I wish to add a 2D car to the scene
- The car has 3 components, the chassis, and two wheels.
Here is where I get messed up
Approach A
-----------------
- The car is a single actor, with a single central transform
- The actor has 3 rigid body/collision shape sets to describe the physical nature of the car
- The actor has 3 sprite components with their associated sprite nodes, these need to follow the rigid bodies position and rotation
What is the relationship between the single transform, the 3 rigid bodies, and the 3 sprite components? How do they all maintain position?
Approach B
------------------
- There are 3 actors, one for each part of the car
- The actors have there own rigid body and sprite components
My current engine supports this, however now how do I keep track of my car when it is in several different actors? I have it figured out how to do it with approach B, but It seems hacky and I don't know if it is the
right way to go, I am afraid that if I try anything complicated with objects that exist beyond a single component (Tanks, Cars, Helicopters), that I don't quite know how to do this.
I asked this question quite a while back, and I don't think I ever quite grasped it or got an answer that really satisfied the question, it would be really nice to get this figured out and I hope that someone has an answer.
Here is the situation I will use as a model;
- I have an empty scene
- I wish to add a 2D car to the scene
- The car has 3 components, the chassis, and two wheels.
Here is where I get messed up
Approach A
-----------------
- The car is a single actor, with a single central transform
- The actor has 3 rigid body/collision shape sets to describe the physical nature of the car
- The actor has 3 sprite components with their associated sprite nodes, these need to follow the rigid bodies position and rotation
What is the relationship between the single transform, the 3 rigid bodies, and the 3 sprite components? How do they all maintain position?
Approach B
------------------
- There are 3 actors, one for each part of the car
- The actors have there own rigid body and sprite components
My current engine supports this, however now how do I keep track of my car when it is in several different actors? I have it figured out how to do it with approach B, but It seems hacky and I don't know if it is the
right way to go, I am afraid that if I try anything complicated with objects that exist beyond a single component (Tanks, Cars, Helicopters), that I don't quite know how to do this.
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