commit b420897adf7b832ab509b5d93e22f3300f1e392f
parent 87661b13c52081c105baaf1f12549296532793ca
Author: Michael Savage <mikejsavage@gmail.com>
Date: Fri, 2 Aug 2019 20:24:58 +0300
Delete m2
Diffstat:
2 files changed, 0 insertions(+), 77 deletions(-)
diff --git a/linear_algebra.h b/linear_algebra.h
@@ -63,29 +63,6 @@ struct v2s32 {
};
// AUTOVISITOR
-struct m2 {
- v2 col0, col1;
-
- m2() { }
-
- explicit m2(
- float e00, float e01,
- float e10, float e11
- ) {
- col0 = v2( e00, e10 );
- col1 = v2( e01, e11 );
- }
-
- explicit m2( const v2 & c0, const v2 & c1 ) {
- col0 = c0;
- col1 = c1;
- }
-
- v2 row0() const { return v2( col0.x, col1.x ); }
- v2 row1() const { return v2( col0.y, col1.y ); }
-};
-
-// AUTOVISITOR
struct v3 {
float x, y, z;
@@ -400,40 +377,6 @@ forceinline s32 dot( v2s32 lhs, v2s32 rhs ) {
}
/*
- * m2
- */
-
-forceinline m2 rot2d( float theta ) {
- float s = sinf( theta );
- float c = cosf( theta );
-
- return m2( c, -s, s, c );
-}
-
-forceinline m2 m2_identity() {
- return m2( 1, 0, 0, 1 );
-}
-
-forceinline m2 m2_scale( float scale ) {
- return m2( scale, 0, 0, scale );
-}
-
-forceinline m2 m2_scale( float x, float y ) {
- return m2( x, 0, 0, y );
-}
-
-forceinline m2 operator*( const m2 & lhs, const m2 & rhs ) {
- return m2(
- dot( lhs.row0(), rhs.col0 ), dot( lhs.row0(), rhs.col1 ),
- dot( lhs.row1(), rhs.col0 ), dot( lhs.row1(), rhs.col1 )
- );
-}
-
-forceinline v2 operator*( const m2 & m, v2 v ) {
- return v2( dot( m.row0(), v ), dot( m.row1(), v ) );
-}
-
-/*
* v3
*/
@@ -1073,14 +1016,6 @@ inline void format( FormatBuffer * fb, const v4 & v, const FormatOpts & opts ) {
format( fb, ")" );
}
-inline void format( FormatBuffer * fb, const m2 & m, const FormatOpts & opts ) {
- format( fb, "m2(" );
- format( fb, m.row0(), opts );
- format( fb, ", " );
- format( fb, m.row1(), opts );
- format( fb, ")" );
-}
-
inline void format( FormatBuffer * fb, const m3 & m, const FormatOpts & opts ) {
format( fb, "m3(" );
format( fb, m.row0(), opts );
diff --git a/visitors/linear_algebra.h b/visitors/linear_algebra.h
@@ -41,18 +41,6 @@ void visit( const v2s32 & obj, F f ) {
}
template< typename F >
-void visit( m2 & obj, F f ) {
- visit( obj.col0, f );
- visit( obj.col1, f );
-}
-
-template< typename F >
-void visit( const m2 & obj, F f ) {
- visit( obj.col0, f );
- visit( obj.col1, f );
-}
-
-template< typename F >
void visit( v3 & obj, F f ) {
visit( obj.x, f );
visit( obj.y, f );