@@ -13,7 +13,9 @@ namespace JGeometry {
1313 {
1414 public:
1515 SMatrix34C () {}
16- void set (const SMatrix34C<T> &rSrc);
16+ void set (const SMatrix34C<T> &rSrc) {
17+ JMath::gekko_ps_copy12 (this , rSrc);
18+ }
1719 void set (T rxx, T ryx, T rzx, T tx, T rxy, T ryy, T rzy, T ty, T rxz, T ryz, T rzz, T tz);
1820
1921 void scale (T);
@@ -23,6 +25,8 @@ namespace JGeometry {
2325 JMath::gekko_ps_copy12 (this , pSrc);
2426 }
2527
28+ f32 at (u32 i, u32 j) const { return mMtx [i][j]; }
29+
2630 T &ref (u32 i, u32 j) { return mMtx [i][j]; }
2731
2832 inline Mtx *toMtx ()
@@ -82,26 +86,16 @@ namespace JGeometry {
8286 TRotation3 () {}
8387 void identity33 ();
8488
85- // TODO: seems fakematch to me but that's a problem for later i guess
8689 inline void getXDir (TVec3f &rDest) const {
87- f32 z = this ->mMtx [2 ][0 ];
88- f32 y = this ->mMtx [1 ][0 ];
89- f32 x = this ->mMtx [0 ][0 ];
90- rDest.set (x, y, z);
90+ rDest.set (this ->at (0 , 0 ), this ->at (1 , 0 ), this ->at (2 , 0 ));
9191 }
9292
9393 inline void getYDir (TVec3f &rDest) const {
94- f32 z = this ->mMtx [2 ][1 ];
95- f32 y = this ->mMtx [1 ][1 ];
96- f32 x = this ->mMtx [0 ][1 ];
97- rDest.set (x, y, z);
94+ rDest.set (this ->at (0 ,1 ), this ->at (1 , 1 ), this ->at (2 , 1 ));
9895 }
9996
10097 inline void getZDir (TVec3f &rDest) const {
101- f32 z = this ->mMtx [2 ][2 ];
102- f32 y = this ->mMtx [1 ][2 ];
103- f32 x = this ->mMtx [0 ][2 ];
104- rDest.set (x, y, z);
98+ rDest.set (this ->at (0 , 2 ), this ->at (1 , 2 ), this ->at (2 , 2 ));
10599 }
106100
107101 void getXYZDir (TVec3f &rDestX, TVec3f &rDestY, TVec3f &rDestZ) const ;
@@ -209,9 +203,12 @@ namespace JGeometry {
209203 {
210204 public:
211205 TPosition3 () {}
206+
207+
212208 void getTrans (TVec3f &rDest) const {
213- rDest.set (this ->mMtx [ 0 ][ 3 ] , this ->mMtx [ 1 ][ 3 ] , this ->mMtx [ 2 ][ 3 ] );
209+ rDest.set (this ->at ( 0 , 3 ) , this ->at ( 1 , 3 ) , this ->at ( 2 , 3 ) );
214210 }
211+
215212 void setTrans (const TVec3f &rSrc);
216213 void setTrans (f32 x, f32 y, f32 z);
217214 void zeroTrans ()
@@ -245,14 +242,6 @@ namespace JGeometry {
245242 this ->ref (2 , 3 ) = (rLookAt[0 ][3 ] * this ->mMtx [2 ][0 ]) - (rLookAt[1 ][3 ] * this ->mMtx [2 ][1 ]) + rLookAt[0 ][3 ] * this ->mMtx [2 ][2 ];
246243 }
247244 void setQT (const TQuat4f &rSrcQuat, const TVec3f &rSrcTrans);
248-
249- inline void getTransInline (TVec3f &rDest) const
250- {
251- f32 z = this ->mMtx [2 ][3 ];
252- f32 y = this ->mMtx [1 ][3 ];
253- f32 x = this ->mMtx [0 ][3 ];
254- rDest.set (x, y, z);
255- }
256245 };
257246
258247 typedef TMatrix34<TSMtxf> TMtx34f;
0 commit comments