Rapier C — 3D / 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  R3SpringCoefficients
 Spring softness expressed as natural frequency and damping ratio. More...
struct  R3OptionalReal
 Optional scalar override; enabled = 0 selects no override. More...
struct  R3OptionalU32
 Optional unsigned integer override; enabled = 0 selects no override. More...
struct  R3Vector
 Cartesian vector with two or three components. More...
struct  R3Rotation
 2D: angle in radians. More...
struct  R3Pose
 Rigid transform combining translation and rotation. More...
struct  R3UserData
 Application-defined 128-bit value. More...
struct  R3VectorView
 Borrowed array of vector elements. More...
struct  R3RealView
 Borrowed array of real elements. More...
struct  R3IndexView
 Borrowed array of index elements. More...
struct  R3Edge
 Vertex indices for one edge; contiguous u32 fields with no padding. More...
struct  R3EdgeView
 Borrowed array of edge elements. More...
struct  R3Triangle
 Vertex indices for one triangle; contiguous u32 fields with no padding. More...
struct  R3TriangleView
 Borrowed array of triangle elements. More...
struct  R3Tetrahedron
 Vertex indices for one tetrahedron; contiguous u32 fields with no padding. More...
struct  R3TetrahedronView
 Borrowed array of tetrahedron elements. More...
struct  R3Dihedral
 Vertex indices for one dihedral; contiguous u32 fields with no padding. More...
struct  R3DihedralView
 Borrowed array of dihedral elements. More...
struct  R3OptionalBool
 Optional boolean override. More...
struct  R3MassProperties
 Explicit mass and principal inertia, matching MassProperties constructors. More...
struct  R3InteractionGroups
 Collision membership/filter masks and their pairwise combination rule. More...
struct  R3Aabb
 Axis-aligned bounding box. More...
struct  R3PodLayout
 Sizes of the POD types in this library build, for foreign-language layout checks. More...
struct  R3InverseKinematicsOptions
 Damped least-squares inverse-kinematics parameters. More...
struct  R3ByteView
 Borrowed bytes. More...
struct  R3ParticleDestination
 Particle remapping after tearing. More...
struct  R3OptionalParticleDestination
 Optional particle remapping; check found before reading the destination. More...
struct  R3VoxelKey
 Integer coordinates of a voxel cell. More...

Typedefs

typedef double R3Real
 Floating-point scalar: float for f32, double for f64.
typedef struct R3SpringCoefficients R3SpringCoefficients
 Spring softness expressed as natural frequency and damping ratio.
typedef uint32_t R3Bool
 ABI booleans are uint32_t: zero is false, one is true.
typedef struct R3OptionalReal R3OptionalReal
 Optional scalar override; enabled = 0 selects no override.
typedef struct R3OptionalU32 R3OptionalU32
 Optional unsigned integer override; enabled = 0 selects no override.
typedef struct R3Vector R3Vector
 Cartesian vector with two or three components.
typedef struct R3Rotation R3Rotation
 2D: angle in radians.
typedef struct R3Pose R3Pose
 Rigid transform combining translation and rotation.
typedef struct R3UserData R3UserData
 Application-defined 128-bit value.
typedef struct R3VectorView R3VectorView
 Borrowed array of vector elements.
typedef struct R3RealView R3RealView
 Borrowed array of real elements.
typedef struct R3IndexView R3IndexView
 Borrowed array of index elements.
typedef struct R3Edge R3Edge
 Vertex indices for one edge; contiguous u32 fields with no padding.
typedef struct R3EdgeView R3EdgeView
 Borrowed array of edge elements.
typedef struct R3Triangle R3Triangle
 Vertex indices for one triangle; contiguous u32 fields with no padding.
typedef struct R3TriangleView R3TriangleView
 Borrowed array of triangle elements.
typedef struct R3Tetrahedron R3Tetrahedron
 Vertex indices for one tetrahedron; contiguous u32 fields with no padding.
typedef struct R3TetrahedronView R3TetrahedronView
 Borrowed array of tetrahedron elements.
typedef struct R3TetrahedronView R3CellView
 Borrowed cell array: triangles in 2D, tetrahedra in 3D.
typedef struct R3TriangleView R3SurfaceElementView
 Borrowed surface array: edges in 2D, triangles in 3D.
typedef struct R3Dihedral R3Dihedral
 Vertex indices for one dihedral; contiguous u32 fields with no padding.
typedef struct R3DihedralView R3DihedralView
 Borrowed array of dihedral elements.
typedef struct R3OptionalBool R3OptionalBool
 Optional boolean override.
typedef struct R3Vector R3AngVector
 Angular scalar in 2D or vector in 3D, in radians for angular displacement.
typedef struct R3MassProperties R3MassProperties
 Explicit mass and principal inertia, matching MassProperties constructors.
typedef struct R3InteractionGroups R3InteractionGroups
 Collision membership/filter masks and their pairwise combination rule.
typedef struct R3Aabb R3Aabb
 Axis-aligned bounding box.
typedef struct R3PodLayout R3PodLayout
 Sizes of the POD types in this library build, for foreign-language layout checks.
typedef struct R3InverseKinematicsOptions R3InverseKinematicsOptions
 Damped least-squares inverse-kinematics parameters.
typedef struct R3ByteView R3ByteView
 Borrowed bytes.
typedef struct R3ParticleDestination R3ParticleDestination
 Particle remapping after tearing.
typedef struct R3OptionalParticleDestination R3OptionalParticleDestination
 Optional particle remapping; check found before reading the destination.
typedef int64_t R3VoxelCoord
 Signed voxel coordinate integer.
typedef struct R3VoxelKey R3VoxelKey
 Integer coordinates of a voxel cell.

Functions

R3Real r3Sin (R3Real x)
 Sine of an angle in radians, computed by Rapier's math backend.
R3Real r3Cos (R3Real x)
 Cosine of an angle in radians, computed by Rapier's math backend.
R3Real r3Tan (R3Real x)
 Tangent of an angle in radians, computed by Rapier's math backend.
R3Real r3Asin (R3Real x)
 Arcsine in radians, computed by Rapier's math backend.
R3Real r3Acos (R3Real x)
 Arccosine in radians, computed by Rapier's math backend.
R3Real r3Atan2 (R3Real y, R3Real x)
 Angle in radians of the point (x, y), in [-pi, pi], computed by Rapier's math backend.
R3Real r3Exp (R3Real x)
 Exponential e^x, computed by Rapier's math backend.
R3Real r3Ln (R3Real x)
 Natural logarithm, computed by Rapier's math backend.
R3Real r3Powf (R3Real base, R3Real 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

◆ R3Aabb

typedef struct R3Aabb R3Aabb

Axis-aligned bounding box.

◆ R3AngVector

typedef struct R3Vector R3AngVector

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

◆ R3Bool

typedef uint32_t R3Bool

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

◆ R3ByteView

typedef struct R3ByteView R3ByteView

Borrowed bytes.

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

◆ R3CellView

typedef struct R3TetrahedronView R3CellView

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

◆ R3Dihedral

typedef struct R3Dihedral R3Dihedral

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

◆ R3DihedralView

typedef struct R3DihedralView R3DihedralView

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.

◆ R3Edge

typedef struct R3Edge R3Edge

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

◆ R3EdgeView

typedef struct R3EdgeView R3EdgeView

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.

◆ R3IndexView

typedef struct R3IndexView R3IndexView

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.

◆ R3InteractionGroups

typedef struct R3InteractionGroups R3InteractionGroups

Collision membership/filter masks and their pairwise combination rule.

◆ R3InverseKinematicsOptions

typedef struct R3InverseKinematicsOptions R3InverseKinematicsOptions

Damped least-squares inverse-kinematics parameters.

◆ R3MassProperties

typedef struct R3MassProperties R3MassProperties

Explicit mass and principal inertia, matching MassProperties constructors.

Zero mass/inertia means infinite.

◆ R3OptionalBool

typedef struct R3OptionalBool R3OptionalBool

Optional boolean override.

When disabled, retain the recipe's native default.

◆ R3OptionalParticleDestination

typedef struct R3OptionalParticleDestination R3OptionalParticleDestination

Optional particle remapping; check found before reading the destination.

◆ R3OptionalReal

typedef struct R3OptionalReal R3OptionalReal

Optional scalar override; enabled = 0 selects no override.

◆ R3OptionalU32

typedef struct R3OptionalU32 R3OptionalU32

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

◆ R3ParticleDestination

typedef struct R3ParticleDestination R3ParticleDestination

Particle remapping after tearing.

◆ R3PodLayout

typedef struct R3PodLayout R3PodLayout

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

◆ R3Pose

typedef struct R3Pose R3Pose

Rigid transform combining translation and rotation.

Use TranslationPose with a zero vector for identity.

◆ R3Real

typedef double R3Real

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

◆ R3RealView

typedef struct R3RealView R3RealView

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.

◆ R3Rotation

typedef struct R3Rotation R3Rotation

2D: angle in radians.

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

◆ R3SpringCoefficients

typedef struct R3SpringCoefficients R3SpringCoefficients

Spring softness expressed as natural frequency and damping ratio.

◆ R3SurfaceElementView

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

◆ R3Tetrahedron

typedef struct R3Tetrahedron R3Tetrahedron

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

◆ R3TetrahedronView

typedef struct R3TetrahedronView R3TetrahedronView

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.

◆ R3Triangle

typedef struct R3Triangle R3Triangle

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

◆ R3TriangleView

typedef struct R3TriangleView R3TriangleView

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.

◆ R3UserData

typedef struct R3UserData R3UserData

Application-defined 128-bit value.

Contains no owned pointers.

◆ R3Vector

typedef struct R3Vector R3Vector

Cartesian vector with two or three components.

◆ R3VectorView

typedef struct R3VectorView R3VectorView

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.

◆ R3VoxelCoord

typedef int64_t R3VoxelCoord

Signed voxel coordinate integer.

◆ R3VoxelKey

typedef struct R3VoxelKey R3VoxelKey

Integer coordinates of a voxel cell.

Function Documentation

◆ r3Acos()

R3Real r3Acos ( R3Real x)

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

See r3Sin.

◆ r3Asin()

R3Real r3Asin ( R3Real x)

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

See r3Sin.

◆ r3Atan2()

R3Real r3Atan2 ( R3Real y,
R3Real x )

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

See r3Sin.

◆ r3Cos()

R3Real r3Cos ( R3Real x)

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

See r3Sin.

◆ r3Exp()

R3Real r3Exp ( R3Real x)

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

See r3Sin.

◆ r3Ln()

R3Real r3Ln ( R3Real x)

Natural logarithm, computed by Rapier's math backend.

See r3Sin.

◆ r3Powf()

R3Real r3Powf ( R3Real base,
R3Real exponent )

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

See r3Sin.

◆ r3Sin()

R3Real r3Sin ( R3Real 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.

◆ r3Tan()

R3Real r3Tan ( R3Real x)

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

See r3Sin.