void CCameraFirstEye::Update(Fvector& point, Fvector& noise_dangle) { vPosition.set (point); UpdateLookat (); Fmatrix mR, R; Fmatrix rX, rY, rZ; rX.rotateX (noise_dangle.x); rY.rotateY (-noise_dangle.y); rZ.rotateZ (noise_dangle.z); R.mul_43 (rY,rX); R.mulB_43 (rZ); mR.identity (); Fquaternion Q; Q.rotationYawPitchRoll(roll,yaw,pitch); mR.rotation (Q); mR.transpose (); mR.mulB_43 (R); vDirection.set (mR.k); vNormal.set (mR.j); if (m_Flags.is(flRelativeLink)) { parent->XFORM().transform_dir (vDirection); parent->XFORM().transform_dir (vNormal); } }
void Camera::SetYaw(float yy) { yaw = yy; UpdateLookat(); }
void Camera::SetPitch(float pp) { pitch = pp; UpdateLookat(); }
void Camera::AddPos(float xx, float yy, float zz) { x += xx; y += yy; z += zz; UpdateLookat(); }
void Camera::SetPos(float xx, float yy, float zz) { x = xx; y = yy; z = zz; UpdateLookat(); }
void Camera::AddZ(float zz) { z += zz; UpdateLookat(); }
void Camera::AddY(float yy) { y += yy; UpdateLookat(); }
void Camera::AddX(float xx) { x += xx; UpdateLookat(); }
void Camera::SetZ(float zz) { z = zz; UpdateLookat(); }
void Camera::SetY(float yy) { y = yy; UpdateLookat(); }
void Camera::SetX(float xx) { x = xx; UpdateLookat(); }
Camera::Camera() : x(0), y(4), z(0), pitch((float)M_PI_2), yaw((float)M_PI_2 + (float)M_PI) { UpdateLookat(); }