Rapier C — 2D / f64 0.36.0+c.0
Loading...
Searching...
No Matches
Math and array types

Plain values and inline arithmetic. More...

Topics

 Inline math

Files

file  rapier_helpers.h
 Explicit invalid handle values; no owned resources.

Data Structures

struct  R2SpringCoefficients
 Spring softness expressed as natural frequency and damping ratio. More...
struct  R2OptionalReal
 Optional scalar override; enabled = 0 selects no override. More...
struct  R2OptionalU32
 Optional unsigned integer override; enabled = 0 selects no override. More...
struct  R2Vector
 Cartesian vector with two or three components. More...
struct  R2Rotation
 2D: angle in radians. More...
struct  R2Pose
 Rigid transform combining translation and rotation. More...
struct  R2UserData
 Application-defined 128-bit value. More...
struct  R2VectorView
 Borrowed array of vector elements. More...
struct  R2RealView
 Borrowed array of real elements. More...
struct  R2IndexView
 Borrowed array of index elements. More...
struct  R2Edge
 Vertex indices for one edge; contiguous u32 fields with no padding. More...
struct  R2EdgeView
 Borrowed array of edge elements. More...
struct  R2Triangle
 Vertex indices for one triangle; contiguous u32 fields with no padding. More...
struct  R2TriangleView
 Borrowed array of triangle elements. More...
struct  R2Tetrahedron
 Vertex indices for one tetrahedron; contiguous u32 fields with no padding. More...
struct  R2TetrahedronView
 Borrowed array of tetrahedron elements. More...
struct  R2Dihedral
 Vertex indices for one dihedral; contiguous u32 fields with no padding. More...
struct  R2DihedralView
 Borrowed array of dihedral elements. More...
struct  R2OptionalBool
 Optional boolean override. More...
struct  R2MassProperties
 Explicit mass and principal inertia, matching MassProperties constructors. More...
struct  R2InteractionGroups
 Collision membership/filter masks and their pairwise combination rule. More...
struct  R2Aabb
 Axis-aligned bounding box. More...
struct  R2PodLayout
 Sizes of the POD types in this library build, for foreign-language layout checks. More...
struct  R2InverseKinematicsOptions
 Damped least-squares inverse-kinematics parameters. More...
struct  R2ByteView
 Borrowed bytes. More...
struct  R2ParticleDestination
 Particle remapping after tearing. More...
struct  R2OptionalParticleDestination
 Optional particle remapping; check found before reading the destination. More...
struct  R2VoxelKey
 Integer coordinates of a voxel cell. More...

Typedefs

typedef double R2Real
 Floating-point scalar: float for f32, double for f64.
typedef struct R2SpringCoefficients R2SpringCoefficients
 Spring softness expressed as natural frequency and damping ratio.
typedef uint32_t R2Bool
 ABI booleans are uint32_t: zero is false, one is true.
typedef struct R2OptionalReal R2OptionalReal
 Optional scalar override; enabled = 0 selects no override.
typedef struct R2OptionalU32 R2OptionalU32
 Optional unsigned integer override; enabled = 0 selects no override.
typedef struct R2Vector R2Vector
 Cartesian vector with two or three components.
typedef struct R2Rotation R2Rotation
 2D: angle in radians.
typedef struct R2Pose R2Pose
 Rigid transform combining translation and rotation.
typedef struct R2UserData R2UserData
 Application-defined 128-bit value.
typedef struct R2VectorView R2VectorView
 Borrowed array of vector elements.
typedef struct R2RealView R2RealView
 Borrowed array of real elements.
typedef struct R2IndexView R2IndexView
 Borrowed array of index elements.
typedef struct R2Edge R2Edge
 Vertex indices for one edge; contiguous u32 fields with no padding.
typedef struct R2EdgeView R2EdgeView
 Borrowed array of edge elements.
typedef struct R2Triangle R2Triangle
 Vertex indices for one triangle; contiguous u32 fields with no padding.
typedef struct R2TriangleView R2TriangleView
 Borrowed array of triangle elements.
typedef struct R2Tetrahedron R2Tetrahedron
 Vertex indices for one tetrahedron; contiguous u32 fields with no padding.
typedef struct R2TetrahedronView R2TetrahedronView
 Borrowed array of tetrahedron elements.
typedef struct R2TriangleView R2CellView
 Borrowed cell array: triangles in 2D, tetrahedra in 3D.
typedef struct R2EdgeView R2SurfaceElementView
 Borrowed surface array: edges in 2D, triangles in 3D.
typedef struct R2Dihedral R2Dihedral
 Vertex indices for one dihedral; contiguous u32 fields with no padding.
typedef struct R2DihedralView R2DihedralView
 Borrowed array of dihedral elements.
typedef struct R2OptionalBool R2OptionalBool
 Optional boolean override.
typedef R2Real R2AngVector
 Angular scalar in 2D or vector in 3D, in radians for angular displacement.
typedef struct R2MassProperties R2MassProperties
 Explicit mass and principal inertia, matching MassProperties constructors.
typedef struct R2InteractionGroups R2InteractionGroups
 Collision membership/filter masks and their pairwise combination rule.
typedef struct R2Aabb R2Aabb
 Axis-aligned bounding box.
typedef struct R2PodLayout R2PodLayout
 Sizes of the POD types in this library build, for foreign-language layout checks.
typedef struct R2InverseKinematicsOptions R2InverseKinematicsOptions
 Damped least-squares inverse-kinematics parameters.
typedef struct R2ByteView R2ByteView
 Borrowed bytes.
typedef struct R2ParticleDestination R2ParticleDestination
 Particle remapping after tearing.
typedef struct R2OptionalParticleDestination R2OptionalParticleDestination
 Optional particle remapping; check found before reading the destination.
typedef int64_t R2VoxelCoord
 Signed voxel coordinate integer.
typedef struct R2VoxelKey R2VoxelKey
 Integer coordinates of a voxel cell.

Functions

R2Real r2Sin (R2Real x)
 Sine of an angle in radians, computed by Rapier's math backend.
R2Real r2Cos (R2Real x)
 Cosine of an angle in radians, computed by Rapier's math backend.
R2Real r2Tan (R2Real x)
 Tangent of an angle in radians, computed by Rapier's math backend.
R2Real r2Asin (R2Real x)
 Arcsine in radians, computed by Rapier's math backend.
R2Real r2Acos (R2Real x)
 Arccosine in radians, computed by Rapier's math backend.
R2Real r2Atan2 (R2Real y, R2Real x)
 Angle in radians of the point (x, y), in [-pi, pi], computed by Rapier's math backend.
R2Real r2Exp (R2Real x)
 Exponential e^x, computed by Rapier's math backend.
R2Real r2Ln (R2Real x)
 Natural logarithm, computed by Rapier's math backend.
R2Real r2Powf (R2Real base, R2Real exponent)
 base raised to the power exponent, computed by Rapier's math backend.

Detailed Description

Plain values and inline arithmetic.

Constructors do not allocate.

Typedef Documentation

◆ R2Aabb

typedef struct R2Aabb R2Aabb

Axis-aligned bounding box.

◆ R2AngVector

Angular scalar in 2D or vector in 3D, in radians for angular displacement.

◆ R2Bool

typedef uint32_t R2Bool

ABI booleans are uint32_t: zero is false, one is true.

◆ R2ByteView

typedef struct R2ByteView R2ByteView

Borrowed bytes.

Valid while the source Bytes object remains alive; never free data.

◆ R2CellView

typedef struct R2TriangleView R2CellView

Borrowed cell array: triangles in 2D, tetrahedra in 3D.

◆ R2Dihedral

typedef struct R2Dihedral R2Dihedral

Vertex indices for one dihedral; contiguous u32 fields with no padding.

◆ R2DihedralView

typedef struct R2DihedralView R2DihedralView

Borrowed array of dihedral elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2Edge

typedef struct R2Edge R2Edge

Vertex indices for one edge; contiguous u32 fields with no padding.

◆ R2EdgeView

typedef struct R2EdgeView R2EdgeView

Borrowed array of edge elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2IndexView

typedef struct R2IndexView R2IndexView

Borrowed array of index elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2InteractionGroups

typedef struct R2InteractionGroups R2InteractionGroups

Collision membership/filter masks and their pairwise combination rule.

◆ R2InverseKinematicsOptions

typedef struct R2InverseKinematicsOptions R2InverseKinematicsOptions

Damped least-squares inverse-kinematics parameters.

◆ R2MassProperties

typedef struct R2MassProperties R2MassProperties

Explicit mass and principal inertia, matching MassProperties constructors.

Zero mass/inertia means infinite.

◆ R2OptionalBool

typedef struct R2OptionalBool R2OptionalBool

Optional boolean override.

When disabled, retain the recipe's native default.

◆ R2OptionalParticleDestination

typedef struct R2OptionalParticleDestination R2OptionalParticleDestination

Optional particle remapping; check found before reading the destination.

◆ R2OptionalReal

typedef struct R2OptionalReal R2OptionalReal

Optional scalar override; enabled = 0 selects no override.

◆ R2OptionalU32

typedef struct R2OptionalU32 R2OptionalU32

Optional unsigned integer override; enabled = 0 selects no override.

◆ R2ParticleDestination

typedef struct R2ParticleDestination R2ParticleDestination

Particle remapping after tearing.

◆ R2PodLayout

typedef struct R2PodLayout R2PodLayout

Sizes of the POD types in this library build, for foreign-language layout checks.

◆ R2Pose

typedef struct R2Pose R2Pose

Rigid transform combining translation and rotation.

Use TranslationPose with a zero vector for identity.

◆ R2Real

typedef double R2Real

Floating-point scalar: float for f32, double for f64.

◆ R2RealView

typedef struct R2RealView R2RealView

Borrowed array of real elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2Rotation

typedef struct R2Rotation R2Rotation

2D: angle in radians.

3D: unit quaternion in x,y,z,w order (normalized on input).

◆ R2SpringCoefficients

typedef struct R2SpringCoefficients R2SpringCoefficients

Spring softness expressed as natural frequency and damping ratio.

◆ R2SurfaceElementView

Borrowed surface array: edges in 2D, triangles in 3D.

◆ R2Tetrahedron

typedef struct R2Tetrahedron R2Tetrahedron

Vertex indices for one tetrahedron; contiguous u32 fields with no padding.

◆ R2TetrahedronView

typedef struct R2TetrahedronView R2TetrahedronView

Borrowed array of tetrahedron elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2Triangle

typedef struct R2Triangle R2Triangle

Vertex indices for one triangle; contiguous u32 fields with no padding.

◆ R2TriangleView

typedef struct R2TriangleView R2TriangleView

Borrowed array of triangle elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2UserData

typedef struct R2UserData R2UserData

Application-defined 128-bit value.

Contains no owned pointers.

◆ R2Vector

typedef struct R2Vector R2Vector

Cartesian vector with two or three components.

◆ R2VectorView

typedef struct R2VectorView R2VectorView

Borrowed array of vector elements.

count counts elements of the declared type. Copying this view does not copy its data or extend its lifetime. No Free is needed. Data must remain live through the build/insert call that reads the description. NULL is permitted only when count is zero.

◆ R2VoxelCoord

typedef int64_t R2VoxelCoord

Signed voxel coordinate integer.

◆ R2VoxelKey

typedef struct R2VoxelKey R2VoxelKey

Integer coordinates of a voxel cell.

Function Documentation

◆ r2Acos()

R2Real r2Acos ( R2Real x)

Arccosine in radians, computed by Rapier's math backend.

See r2Sin.

◆ r2Asin()

R2Real r2Asin ( R2Real x)

Arcsine in radians, computed by Rapier's math backend.

See r2Sin.

◆ r2Atan2()

R2Real r2Atan2 ( R2Real y,
R2Real x )

Angle in radians of the point (x, y), in [-pi, pi], computed by Rapier's math backend.

See r2Sin.

◆ r2Cos()

R2Real r2Cos ( R2Real x)

Cosine of an angle in radians, computed by Rapier's math backend.

See r2Sin.

◆ r2Exp()

R2Real r2Exp ( R2Real x)

Exponential e^x, computed by Rapier's math backend.

See r2Sin.

◆ r2Ln()

R2Real r2Ln ( R2Real x)

Natural logarithm, computed by Rapier's math backend.

See r2Sin.

◆ r2Powf()

R2Real r2Powf ( R2Real base,
R2Real exponent )

base raised to the power exponent, computed by Rapier's math backend.

See r2Sin.

◆ r2Sin()

R2Real r2Sin ( R2Real x)

Sine of an angle in radians, computed by Rapier's math backend.

With enhanced-determinism (see BuildFeatures), the result is identical on every platform.

◆ r2Tan()

R2Real r2Tan ( R2Real x)

Tangent of an angle in radians, computed by Rapier's math backend.

See r2Sin.