Rapier C — 2D / f32 0.36.0+c.0
Loading...
Searching...
No Matches

Macros

#define R2_PI   ((R2Real)3.14159265358979323846)
 Pi in the selected scalar precision.

Functions

static R2Vector r2Vector (R2Real x, R2Real y)
 Construct a vector from its components.
static R2Rotation r2Rotation (R2Real angle)
 Construct a 2D rotation from an angle in radians.
static R2Vector r2VectorAdd (R2Vector a, R2Vector b)
 Return a + b.
static R2Vector r2VectorSub (R2Vector a, R2Vector b)
 Return a - b.
static R2Vector r2VectorScale (R2Vector vector, R2Real scale)
 Multiply each component by scale.
static R2Real r2VectorDot (R2Vector a, R2Vector b)
 Return the dot product.
static R2Real r2VectorLength (R2Vector vector)
 Return the Euclidean length.
static R2Vector r2VectorNormalize (R2Vector vector)
 Normalize a nonzero vector; a zero vector is returned unchanged.
static R2Rotation r2RotationMul (R2Rotation a, R2Rotation b)
 Compose rotations, applying b then a.
static R2Vector r2RotationTransformVector (R2Rotation rotation, R2Vector vector)
 Rotate a vector; rotation must be normalized.
static R2Pose r2Pose (R2Vector translation, R2Rotation rotation)
 Construct a pose from translation and rotation without validation.
static R2Pose r2TranslationPose (R2Vector translation)
 Construct a pose with the supplied translation and identity rotation.
static R2MassProperties r2MassProperties (R2Vector local_com, R2Real mass, R2AngVector principal_inertia)
 Construct mass properties from a local center of mass, a mass, and principal angular inertia (a scalar in 2D); in 3D the principal inertia frame is the identity rotation.
static R2Rotation r2RotationInverse (R2Rotation rotation)
 Return the inverse of a normalized rotation.
static R2Vector r2PoseTransformPoint (R2Pose pose, R2Vector point)
 Transform a point by rotation then translation.
static R2Pose r2PoseInverse (R2Pose pose)
 Return the inverse rigid transform.

Detailed Description

Macro Definition Documentation

◆ R2_PI

#define R2_PI   ((R2Real)3.14159265358979323846)

Pi in the selected scalar precision.

Function Documentation

◆ r2MassProperties()

R2MassProperties r2MassProperties ( R2Vector local_com,
R2Real mass,
R2AngVector principal_inertia )
inlinestatic

Construct mass properties from a local center of mass, a mass, and principal angular inertia (a scalar in 2D); in 3D the principal inertia frame is the identity rotation.

◆ r2Pose()

R2Pose r2Pose ( R2Vector translation,
R2Rotation rotation )
inlinestatic

Construct a pose from translation and rotation without validation.

◆ r2PoseInverse()

R2Pose r2PoseInverse ( R2Pose pose)
inlinestatic

Return the inverse rigid transform.

Rotation must be normalized.

◆ r2PoseTransformPoint()

R2Vector r2PoseTransformPoint ( R2Pose pose,
R2Vector point )
inlinestatic

Transform a point by rotation then translation.

Rotation must be normalized.

◆ r2Rotation()

R2Rotation r2Rotation ( R2Real angle)
inlinestatic

Construct a 2D rotation from an angle in radians.

◆ r2RotationInverse()

R2Rotation r2RotationInverse ( R2Rotation rotation)
inlinestatic

Return the inverse of a normalized rotation.

◆ r2RotationMul()

R2Rotation r2RotationMul ( R2Rotation a,
R2Rotation b )
inlinestatic

Compose rotations, applying b then a.

Inputs must be normalized.

◆ r2RotationTransformVector()

R2Vector r2RotationTransformVector ( R2Rotation rotation,
R2Vector vector )
inlinestatic

Rotate a vector; rotation must be normalized.

◆ r2TranslationPose()

R2Pose r2TranslationPose ( R2Vector translation)
inlinestatic

Construct a pose with the supplied translation and identity rotation.

◆ r2Vector()

R2Vector r2Vector ( R2Real x,
R2Real y )
inlinestatic

Construct a vector from its components.

◆ r2VectorAdd()

R2Vector r2VectorAdd ( R2Vector a,
R2Vector b )
inlinestatic

Return a + b.

◆ r2VectorDot()

R2Real r2VectorDot ( R2Vector a,
R2Vector b )
inlinestatic

Return the dot product.

◆ r2VectorLength()

R2Real r2VectorLength ( R2Vector vector)
inlinestatic

Return the Euclidean length.

◆ r2VectorNormalize()

R2Vector r2VectorNormalize ( R2Vector vector)
inlinestatic

Normalize a nonzero vector; a zero vector is returned unchanged.

◆ r2VectorScale()

R2Vector r2VectorScale ( R2Vector vector,
R2Real scale )
inlinestatic

Multiply each component by scale.

◆ r2VectorSub()

R2Vector r2VectorSub ( R2Vector a,
R2Vector b )
inlinestatic

Return a - b.