Exemple #1
0
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);
	}
}
Exemple #2
0
void Camera::SetYaw(float yy) {
    yaw = yy;
    UpdateLookat();
}
Exemple #3
0
void Camera::SetPitch(float pp) {
    pitch = pp;
    UpdateLookat();
}
Exemple #4
0
void Camera::AddPos(float xx, float yy, float zz) {
    x += xx;
    y += yy;
    z += zz;
    UpdateLookat();
}
Exemple #5
0
void Camera::SetPos(float xx, float yy, float zz) {
    x = xx;
    y = yy;
    z = zz;
    UpdateLookat();
}
Exemple #6
0
void Camera::AddZ(float zz) {
    z += zz;
    UpdateLookat();
}
Exemple #7
0
void Camera::AddY(float yy) {
    y += yy;
    UpdateLookat();
}
Exemple #8
0
void Camera::AddX(float xx) {
    x += xx;
    UpdateLookat();
}
Exemple #9
0
void Camera::SetZ(float zz) {
    z = zz;
    UpdateLookat();
}
Exemple #10
0
void Camera::SetY(float yy) {
    y = yy;
    UpdateLookat();
}
Exemple #11
0
void Camera::SetX(float xx) {
    x = xx;
    UpdateLookat();
}
Exemple #12
0
Camera::Camera() : x(0), y(4), z(0), pitch((float)M_PI_2), yaw((float)M_PI_2 + (float)M_PI) {
    UpdateLookat();
}