| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Box2D.MathTypes
Contents
Description
Low-level bindings to the value types in box2d/math_functions.h.
These are the small POD math structs that the Box2D 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) b2Pos and b2WorldTransform are
typedefs for b2Vec2 and b2Transform, so Pos and WorldTransform are
type synonyms here.
Synopsis
- data Vec2 = Vec2 Float Float
- data CosSin = CosSin Float Float
- data Rot = Rot Float Float
- data Transform = Transform Vec2 Rot
- data Mat22 = Mat22 Vec2 Vec2
- data AABB = AABB Vec2 Vec2
- data Plane = Plane Vec2 Float
- type Pos = Vec2
- type WorldTransform = Transform
- vec2Zero :: Vec2
- rotIdentity :: Rot
- transformIdentity :: Transform
Documentation
A 2D vector.
Cosine and sine pair (cosine, sine).
Instances
| Storable CosSin Source # | |
| Show CosSin Source # | |
| Eq CosSin Source # | |
A 2D rotation stored as a cosine/sine pair (c, s).
A 2D rigid transform: position p and rotation q.
Instances
| Storable Transform Source # | |
Defined in Box2D.MathTypes | |
| Show Transform Source # | |
| Eq Transform Source # | |
A 2x2 column-major matrix (columns cx, cy).
Instances
| Storable Mat22 Source # | |
| Show Mat22 Source # | |
| Eq Mat22 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
rotIdentity :: Rot Source #
The identity rotation (cosine 1, sine 0).