private void updateViewMatrix(float elapsedTimeSec){
		m_orientation.toRotationMatrix(m_viewMatrix);

	    m_xAxis.set(m_viewMatrix.m00, m_viewMatrix.m10, m_viewMatrix.m20);
	    m_yAxis.set(m_viewMatrix.m01, m_viewMatrix.m11, m_viewMatrix.m21);
	    m_zAxis.set(m_viewMatrix.m02, m_viewMatrix.m12, m_viewMatrix.m22);

	    // Calculate the new camera position. The 'idealPosition' is where the
	    // camera should be position. The camera should be positioned directly
	    // behind the target at the required offset distance. What we're doing here
	    // is rather than have the camera immediately snap to the 'idealPosition'
	    // we slowly move the camera towards the 'idealPosition' using a spring
	    // system.
	    //
	    // References:
	    //   Stone, Jonathan, "Third-Person Camera Navigation," Game Programming
	    //     Gems 4, Andrew Kirmse, Editor, Charles River Media, Inc., 2004.

	    Vector3f idealPosition = new Vector3f();
	    
	    float x = m_zAxis.x * m_offsetDistance;
	    float y = m_zAxis.y * m_offsetDistance;
	    float z = m_zAxis.z * m_offsetDistance;
	    
	    Vector3f Scaled = new Vector3f(x,y,z);
	    
	    Vector3f.add(m_target, Scaled, idealPosition);
	    
	    Vector3f displacement = new Vector3f();
	    Vector3f.sub(m_eye, idealPosition, displacement);
	    
	    Vector3f springAcceleration = new Vector3f();
	    
	    float xx = -m_springConstant * displacement.x;
	    float yy = -m_springConstant * displacement.y;
	    float zz = -m_springConstant * displacement.z;
	    
	    Vector3f disp = new Vector3f(xx,yy,zz);
	    float x1 = m_dampingConstant * m_velocity.x;
	    float y1 = m_dampingConstant * m_velocity.y;
	    float z1 = m_dampingConstant * m_velocity.z;
	    
	    Vector3f damp = new Vector3f(x1,y1,z1);
	    
	    Vector3f.sub(disp, damp, springAcceleration);

	    float t1 = springAcceleration.x * elapsedTimeSec;
	    float t2 = springAcceleration.y * elapsedTimeSec;
	    float t3 = springAcceleration.z * elapsedTimeSec;
	    Vector3f sAeTS = new Vector3f(t1, t2, t3);
	    
	    Vector3f.add(m_velocity, sAeTS, m_velocity);
	    
	    float e1 = m_velocity.x * elapsedTimeSec;
	    float e2 = m_velocity.y * elapsedTimeSec;
	    float e3 = m_velocity.z * elapsedTimeSec;
	    Vector3f mveTS = new Vector3f(e1, e2, e3);
	    
	    Vector3f.add(m_eye, mveTS, m_eye);

	    // The view matrix is always relative to the camera's current position
	    // 'm_eye'. Since a spring system is being used here 'm_eye' will be
	    // relative to 'idealPosition'. When the camera is no longer being
	    // moved 'm_eye' will become the same as 'idealPosition'. The local
	    // x, y, and z axes that were extracted from the camera's orientation
	    // 'm_orienation' is correct for the 'idealPosition' only. We need
	    // to recompute these axes so that they're relative to 'm_eye'. Once
	    // that's done we can use those axes to reconstruct the view matrix.

	    Vector3f.sub(m_eye, m_target, m_zAxis);
	    m_zAxis.normalise();

	    Vector3f.cross(m_targetYAxis, m_zAxis, m_xAxis);
	    m_xAxis.normalise();

	    Vector3f.cross(m_zAxis, m_xAxis, m_yAxis);
	    m_yAxis.normalise();

	    m_viewMatrix.setIdentity();

	    m_viewMatrix.m00 = m_xAxis.x;
	    m_viewMatrix.m10 = m_xAxis.y;
	    m_viewMatrix.m20 = m_xAxis.z;
	    m_viewMatrix.m30 = -Vector3f.dot(m_xAxis, m_eye);

	    m_viewMatrix.m01 = m_yAxis.x;
	    m_viewMatrix.m11 = m_yAxis.y;
	    m_viewMatrix.m21 = m_yAxis.z;
	    m_viewMatrix.m31 = -Vector3f.dot(m_yAxis, m_eye);

	    m_viewMatrix.m02 = m_zAxis.x;
	    m_viewMatrix.m12 = m_zAxis.y;
	    m_viewMatrix.m22 = m_zAxis.z;   
	    m_viewMatrix.m32 = -Vector3f.dot(m_zAxis, m_eye);

	    m_zAxis.negate(m_viewDir);
	}