Ok, fixed the swapped x and y as well as normalized the Up and Right vectors. This seems to have helped somewhat, but not completely...
I can't quite tell whats going on... it seems that after I change targets (the first being destroyed), the missiles start acting wonky again. Perhaps they are trying to track the old destroyed enemy... but I don't see why that should be happening... relevant code below:
Constructor
Rotatable *target; Guided_Missile_Launcher(float vel, float rt, float dmg, Rotatable *par, float dispx, float dispy, float dispz, float rx, float ry, int *a, Rotatable *targ) { speed = vel; damage = dmg; dx = dispx; dy = dispy; dz = dispz; pitch = rx; yaw = ry; reloadtime = rt; timelastfired = 0; parent = par; Position = parent->GetPos(); UpVector = parent->GetUp(); RightVector = parent->GetRight(); ViewDir = parent->GetView(); MoveForward(-dz); StrafeRight(dx); MoveUpward(dy); RotateX(pitch); RotateY(yaw); ammo = a; target = targ; }
spawning the missile object
allprojectiles.push_back(new Guided_Missile(speed, damage, this, target));
Creating the weapon instance
Weapons.push_back(new Guided_Missile_Launcher(-0.95, 0.5, 10, this, 0.05, 0.05, 0.1, -1.0, 1.0, &pammo, playertarget));
where playertarget is a pointer to a rotatable object (Rotatable *playertarget)
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.