Original Post
What em I doing wrong?!?!?! I Call Update() and pass in the velocity of the unit the camera is focus'd on. The camera follows fine but falls behind the object rather quickly. Like a fast moving object gains speed on the camera somehow If the object goes up, the camera goes down and vice versa. The functions are commented //-------------------- //Updates the Camera // Last modified: 06.02.05 15:04 (Halsafar) //-------------------- void Camera::MoveCamera(const Vector &vDir, Vector &vVelocity) { // Move the camera on the X and Z axis. m_vEye.x += vDir.x * vVelocity.x; m_vEye.y += vDir.y * vVelocity.y; m_vEye.z += vDir.z * vVelocity.z; // Move the view along with the position m_vTarget.x += vDir.x * vVelocity.x; m_vTarget.y += vDir.y * vVelocity.y; m_vTarget.z += vDir.z * vVelocity.z; } //-------------------- //Update the camera's location with a unit vector * velocity // Last modified: 06.02.05 15:04 (Halsafar) //-------------------- void Camera::Update(Vector &vVelocity) { // First we need to get the direction at which we are looking. Vector LookDirection; // The look direction is the view (where we are looking) minus the position (where we are). LookDirection = m_vTarget - m_vEye; // Normalize the direction. LookDirection.Normalize(); // Call UpdateCamera to move our camera in the direction we want. MoveCamera(LookDirection, vVelocity); }