Dura2D  v0.1.0
An educational 2D game physics library
Loading...
Searching...
No Matches
d2Transform Struct Reference

Represents a transformation in 2D space. More...

#include <d2Math.h>

Public Member Functions

 d2Transform ()
 Default constructor.
 
 d2Transform (const d2Vec2 &p, const d2Rot &q)
 Constructor that initializes the transformation with given translation and rotation.
 
void SetIdentity ()
 Set the transformation as identity.
 
void Set (const d2Vec2 &p, const d2Rot &q)
 Set the transformation with given translation and rotation.
 

Public Attributes

d2Vec2 p
 The translation of the body.
 
d2Rot q
 The rotation of the body.
 

Detailed Description

Represents a transformation in 2D space.

Constructor & Destructor Documentation

◆ d2Transform() [1/2]

d2Transform::d2Transform ( )
inline

Default constructor.

Initializes the transformation to identity.

◆ d2Transform() [2/2]

d2Transform::d2Transform ( const d2Vec2 & p,
const d2Rot & q )
inline

Constructor that initializes the transformation with given translation and rotation.

Parameters
pThe translation of the body.
qThe rotation of the body.

Member Function Documentation

◆ Set()

void d2Transform::Set ( const d2Vec2 & p,
const d2Rot & q )
inline

Set the transformation with given translation and rotation.

Parameters
pThe translation of the body.
qThe rotation of the body.

◆ SetIdentity()

void d2Transform::SetIdentity ( )
inline

Set the transformation as identity.

Member Data Documentation

◆ p

d2Vec2 d2Transform::p

The translation of the body.

◆ q

d2Rot d2Transform::q

The rotation of the body.


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