Public Member Functions | Public Attributes | List of all members
b2Mat22 Struct Reference

A 2-by-2 matrix. Stored in column-major order. More...

#include <b2_math.h>

Public Member Functions

 b2Mat22 ()
 The default constructor does nothing (for performance). More...
 
 b2Mat22 (const b2Vec2 &c1, const b2Vec2 &c2)
 Construct this matrix using columns. More...
 
 b2Mat22 (float a11, float a12, float a21, float a22)
 Construct this matrix using scalars. More...
 
b2Mat22 GetInverse () const
 
void Set (const b2Vec2 &c1, const b2Vec2 &c2)
 Initialize this matrix using columns. More...
 
void SetIdentity ()
 Set this to the identity matrix. More...
 
void SetZero ()
 Set this matrix to all zeros. More...
 
b2Vec2 Solve (const b2Vec2 &b) const
 

Public Attributes

b2Vec2 ex
 
b2Vec2 ey
 

Detailed Description

A 2-by-2 matrix. Stored in column-major order.

Definition at line 171 of file b2_math.h.

Constructor & Destructor Documentation

◆ b2Mat22() [1/3]

b2Mat22::b2Mat22 ( )
inline

The default constructor does nothing (for performance).

Definition at line 174 of file b2_math.h.

◆ b2Mat22() [2/3]

b2Mat22::b2Mat22 ( const b2Vec2 c1,
const b2Vec2 c2 
)
inline

Construct this matrix using columns.

Definition at line 177 of file b2_math.h.

◆ b2Mat22() [3/3]

b2Mat22::b2Mat22 ( float  a11,
float  a12,
float  a21,
float  a22 
)
inline

Construct this matrix using scalars.

Definition at line 184 of file b2_math.h.

Member Function Documentation

◆ GetInverse()

b2Mat22 b2Mat22::GetInverse ( ) const
inline

Definition at line 211 of file b2_math.h.

◆ Set()

void b2Mat22::Set ( const b2Vec2 c1,
const b2Vec2 c2 
)
inline

Initialize this matrix using columns.

Definition at line 191 of file b2_math.h.

◆ SetIdentity()

void b2Mat22::SetIdentity ( )
inline

Set this to the identity matrix.

Definition at line 198 of file b2_math.h.

◆ SetZero()

void b2Mat22::SetZero ( )
inline

Set this matrix to all zeros.

Definition at line 205 of file b2_math.h.

◆ Solve()

b2Vec2 b2Mat22::Solve ( const b2Vec2 b) const
inline

Solve A * x = b, where b is a column vector. This is more efficient than computing the inverse in one-shot cases.

Definition at line 227 of file b2_math.h.

Member Data Documentation

◆ ex

b2Vec2 b2Mat22::ex

Definition at line 241 of file b2_math.h.

◆ ey

b2Vec2 b2Mat22::ey

Definition at line 241 of file b2_math.h.


The documentation for this struct was generated from the following file:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22