| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Box3D.MathTypes
Contents
Description
Low-level bindings to the value types in box3d/math_functions.h.
These are the small POD math structs that the Box3D API passes and returns
by value. Field order matches the C layout; Storable offsets come straight
from the header via hsc2hs. Fields are Float because C float maps to
the Haskell FFI Float with an identical representation.
In single-precision builds (the default) b3Pos and b3WorldTransform are
typedefs for b3Vec3 and b3Transform, so Pos and WorldTransform are
type synonyms here.
Synopsis
- data Vec2 = Vec2 Float Float
- data Vec3 = Vec3 Float Float Float
- data CosSin = CosSin Float Float
- data Quat = Quat Vec3 Float
- data Transform = Transform Vec3 Quat
- data Matrix3 = Matrix3 Vec3 Vec3 Vec3
- data AABB = AABB Vec3 Vec3
- data Plane = Plane Vec3 Float
- type Pos = Vec3
- type WorldTransform = Transform
- vec3Zero :: Vec3
- vec3One :: Vec3
- vec3AxisX :: Vec3
- vec3AxisY :: Vec3
- vec3AxisZ :: Vec3
- quatIdentity :: Quat
- transformIdentity :: Transform
- matrix3Zero :: Matrix3
- matrix3Identity :: Matrix3
Documentation
A 2D vector.
A 3D vector.
Cosine and sine pair (cosine, sine).
Instances
| Storable CosSin Source # | |
| Show CosSin Source # | |
| Eq CosSin Source # | |
A quaternion: vector part v and scalar part s.
A rigid transform: position p and rotation q.
Instances
| Storable Transform Source # | |
Defined in Box3D.MathTypes | |
| Show Transform Source # | |
| Eq Transform Source # | |
A 3x3 column-major matrix (columns cx, cy, cz).
Instances
| Storable Matrix3 Source # | |
| Show Matrix3 Source # | |
| Eq Matrix3 Source # | |
Axis-aligned bounding box (lowerBound, upperBound).
A plane: normal and offset where separation = dot(normal, point) - offset.
Instances
| Storable Plane Source # | |
| Show Plane Source # | |
| Eq Plane Source # | |
type WorldTransform = Transform Source #
World transform. In single-precision builds this is Transform.
Constants
quatIdentity :: Quat Source #