I am having a bit of trouble implementing controls for a vehicle and was wondering if my approach is even correct.
Abstract: Create a number of selectable tank-like underwater vehicles(3 thrusters with rotatable “turret”) that are individually controlled by keyboard commands.
Current approach:
create node: tank
create two meshes: chassis, turret
rigid body control with mass: chassis, collisiongroup2
rigid body control with mass: turret, collisiongroup3
sliderJoint: tank-chassis, limits=0
hingJoint: chassis-turret
addForce at the 3 thruster position and directions on chassis rigid body control
What I feel needs to be added:
- rigid body control attached to node “tank” that has a collisionbox that is the combined shape of chassis and turret and in collisiongroup1(for colliding with world object and other tanks)
- keeping a common ID for one instance of tank and all its attached members for when using the ray to select certain tanks
- creating a mapping of id-tank node
My thoughts:
I feel I am overly complicating this(as I tend to do) and was just looking to see if anyone could confirm or deny this/ or suggest better method. I have been having trouble with the selection box not following the tank when it is moving, so I feel like i should create a ghost control between the selection box and the tank node. In general I have been having trouble finding a versatile way of selecting a tank and all its sub-components.
Thoughts? Should I clarify anything? Thank you in advance.
Post Scriptum: I am willing to contribute a tutorial if I can find a simple/logical way of implementing this. I realize what I am trying to do in some regards is implement a new version of VehicleControl, which I have tried to follow the source code for, but a lot of the finer details like how wheels where attached are in the compiled components of bullet.