I am trying to solve this problem and getting no where, could really use some assistance. Rotation is defined as X (rotate left/right), Y(rotate up/down), Z(roll) Coordinates are X: Forward/backward, Y: Left/right, Z: up/down
I have two objects in simulated space, both have galactic coordinates (XYZ) and a quaternion representing their rotation.
ObjectA Coordinates: 0.593 0 0 (directly ahead of ObjB) RotationQuat: w: 0, x: 1, y: 0, z:0 (Rotated 180 yaw, facing backwards)
ObjectB Coordinates: 0 0 0 RotationQuat: w: 1, x: 0, y: 0, z: 0 (No rotation, facing towards ObjA)
Given the above information, how do I translate ObjA's location into ObjB's local space?
If ObjA fires at ObjB (or vise versa), I need to calculate which side will be hit. Forward, Aft, Port, Starboard, Ventral or Dorsal.
My project is written entirely in C. Actually this is an old project, created by someone else that I am converting to using quaternions due to gimbal lock.