CCamera::CM_TripodFocus

This commit is contained in:
krystalgamer 2024-07-29 18:33:32 +02:00
parent bb114c38d2
commit f0949dfe97
6 changed files with 65 additions and 5 deletions

View File

@ -1,12 +1,69 @@
#include "camera.h"
#include "validate.h"
#include "ps2funcs.h"
#include "utils.h"
EXPORT CCamera *CameraList;
EXPORT i32 NumCameras;
EXPORT SCamera gMikeCamera[2];
// @Ok
// @Test
void CCamera::CM_TripodFocus(void)
{
SVECTOR v2;
CVector a1;
CVector v4;
CVector v5;
MATRIX a2;
v2.vx = 0;
v2.vy = 0;
v2.vz = 0;
Utils_CalcAim(
reinterpret_cast<CSVector *>(&v2),
&this->field_104,
&this->field_144);
M3dMaths_RotMatrixYXZ(&v2, &a2);
gte_SetRotMatrix(&a2);
a1.vx = 0;
a1.vy = 4096;
a1.vz = 0;
gte_ldlvl(reinterpret_cast<VECTOR*>(&a1));
gte_rtir();
gte_stlvnl(reinterpret_cast<VECTOR*>(&a1));
v4.vx = 0;
v4.vy = 0;
v4.vz = -4096;
gte_ldlvl(reinterpret_cast<VECTOR*>(&v4));
gte_rtir();
gte_stlvnl(reinterpret_cast<VECTOR*>(&v4));
v5.vx = 0;
v5.vy = 0;
v5.vz = 0;
gte_ldopv1(reinterpret_cast<VECTOR*>(&a1));
gte_ldopv2(reinterpret_cast<VECTOR*>(&v4));
gte_op12();
gte_stlvnl(reinterpret_cast<VECTOR*>(&v5));
a2.m[0][0] = v5.vx;
a2.m[1][0] = v5.vy;
a2.m[2][0] = v5.vz;
a2.m[0][1] = a1.vx;
a2.m[1][1] = a1.vy;
a2.m[2][1] = a1.vz;
a2.m[0][2] = v4.vx;
a2.m[1][2] = v4.vy;
a2.m[2][2] = v4.vz;
MToQ(a2, this->field_1F4);
}
// @Ok
CCamera::CCamera(CBody* tripod)
{

View File

@ -58,6 +58,7 @@ public:
EXPORT void SetTripodInterpolation(i32, i32, i32);
EXPORT void SetFixedPosAnglesMode(CVector *, CQuat *, u16);
EXPORT void LoadIntoMikeCamera(void);
EXPORT void CM_TripodFocus(void);
int padTop;

View File

@ -399,10 +399,6 @@ void m3d_ZeroTransVector(void)
translationVector.vz = 0;
}
// @NotOk
void MToQ(MATRIX const & a1, CQuat& a2){
}
// @NotOk
void VectorNormal(VECTOR* a1, VECTOR* a2){
}

View File

@ -62,7 +62,6 @@ EXPORT void M3dMaths_SetIdentityRotation(MATRIX *a1);
EXPORT void MulMatrix0(MATRIX *a1, MATRIX *a2, MATRIX *a3);
EXPORT void MulMatrix(MATRIX *a1, MATRIX *a2);
EXPORT void m3d_ZeroTransVector(void);
EXPORT void MToQ(MATRIX const &, CQuat&);
EXPORT void VectorNormal(VECTOR*, VECTOR*);
EXPORT int M3dMaths_SquareRoot0(int i);

View File

@ -2,6 +2,12 @@
#include "validate.h"
#include "ps2funcs.h"
// @MEDIUMTODO
void MToQ(MATRIX const & a1, CQuat& a2)
{
printf("void MToQ(MATRIX const & a1, CQuat& a2)");
}
// @SMALLTODO
void QToM(CQuat*, MATRIX*)

1
quat.h
View File

@ -18,6 +18,7 @@ public:
void validate_CQuat(void);
EXPORT void Quat_Slerp (CQuat& a1, CQuat const & a2, int a3, CQuat& a4);
EXPORT void MToQ(MATRIX const &, CQuat&);
EXPORT void QToM(CQuat*, MATRIX*);
#endif