Now I run into something where I could go a few different routes and I was wondering if there is a 'best'.
In my program a gameObject can have a physics component and a steering component. (amongs many others)
If a gameObject has both (steering&physics) I have to get the desired steering forces and apply it as impulse forces in the physics component.
atm I have a check that looks like
Code:
if (HasSteeringComponent) {
// do some simple steering
if (HasPhysicsComponent){
// do some impulse based steering over the physics component
}
}
// do some simple steering
if (HasPhysicsComponent){
// do some impulse based steering over the physics component
}
}
this doesn't seem the right way,I see a few options :
- I could have one special component 'physicsEnabledSteeringComponent'
- I could just do it like above.
- ?
both options seem funny... what would you do ?