Data.Vec.Packed
 Contents Packed Vector Types Packed Matrix Types.
Description
Packed vectors : use these whenever possible. The regular vector type is just a gussied up linked list, but when vector functions are applied to these types, bracketed by pack and unpack, then things unfold into perfectly optimized code.
Synopsis
data Vec2I = Vec2I !!Int !!Int
data Vec3I = Vec3I !!Int !!Int !!Int
data Vec4I = Vec4I !!Int !!Int !!Int !!Int
data Vec2F = Vec2F !!Float !!Float
data Vec3F = Vec3F !!Float !!Float !!Float
data Vec4F = Vec4F !!Float !!Float !!Float !!Float
data Vec2D = Vec2D !!Double !!Double
data Vec3D = Vec3D !!Double !!Double !!Double
data Vec4D = Vec4D !!Double !!Double !!Double !!Double
type Mat22I = Vec2 Vec2I
type Mat23I = Vec2 Vec3I
type Mat33I = Vec3 Vec3I
type Mat34I = Vec3 Vec4I
type Mat44I = Vec4 Vec3I
type Mat22F = Vec2 Vec2F
type Mat23F = Vec2 Vec3F
type Mat33F = Vec3 Vec3F
type Mat34F = Vec3 Vec4F
type Mat44F = Vec4 Vec3F
type Mat22D = Vec2 Vec2D
type Mat23D = Vec2 Vec3D
type Mat33D = Vec3 Vec3D
type Mat34D = Vec3 Vec4D
type Mat44D = Vec4 Vec4D
packMat :: (Map v pv m pm, PackedVec pv v) => m -> pm
unpackMat :: (Map pv v pm m, PackedVec pv v) => pm -> m
class PackedVec pv v | pv -> v where
 pack :: v -> pv unpack :: pv -> v
Packed Vector Types
 data Vec2I Source
Constructors
 Vec2I !!Int !!Int Instances
 PackedVec Vec2I (Vec2 Int)
 data Vec3I Source
Constructors
 Vec3I !!Int !!Int !!Int Instances
 PackedVec Vec3I (Vec3 Int)
 data Vec4I Source
Constructors
 Vec4I !!Int !!Int !!Int !!Int Instances
 PackedVec Vec4I (Vec4 Int)
 data Vec2F Source
Constructors
 Vec2F !!Float !!Float Instances
 PackedVec Vec2F (Vec2 Float)
 data Vec3F Source
Constructors
 Vec3F !!Float !!Float !!Float Instances
 PackedVec Vec3F (Vec3 Float)
 data Vec4F Source
Constructors
 Vec4F !!Float !!Float !!Float !!Float Instances
 PackedVec Vec4F (Vec4 Float)
 data Vec2D Source
Constructors
 Vec2D !!Double !!Double Instances
 PackedVec Vec2D (Vec2 Double)
 data Vec3D Source
Constructors
 Vec3D !!Double !!Double !!Double Instances
 PackedVec Vec3D (Vec3 Double)
 data Vec4D Source
Constructors
 Vec4D !!Double !!Double !!Double !!Double Instances
 PackedVec Vec4D (Vec4 Double)
Packed Matrix Types.
 type Mat22I = Vec2 Vec2I Source
 type Mat23I = Vec2 Vec3I Source
 type Mat33I = Vec3 Vec3I Source
 type Mat34I = Vec3 Vec4I Source
 type Mat44I = Vec4 Vec3I Source
 type Mat22F = Vec2 Vec2F Source
 type Mat23F = Vec2 Vec3F Source
 type Mat33F = Vec3 Vec3F Source
 type Mat34F = Vec3 Vec4F Source
 type Mat44F = Vec4 Vec3F Source
 type Mat22D = Vec2 Vec2D Source
 type Mat23D = Vec2 Vec3D Source
 type Mat33D = Vec3 Vec3D Source
 type Mat34D = Vec3 Vec4D Source
 type Mat44D = Vec4 Vec4D Source
 packMat :: (Map v pv m pm, PackedVec pv v) => m -> pm Source
pack a matrix
 unpackMat :: (Map pv v pm m, PackedVec pv v) => pm -> m Source
unpack a matrix
 class PackedVec pv v | pv -> v where Source
PackedVec class : relates a packed vector type to its unpacked type For now, the fundep is not bijective -- It may be advantageous to have multiple packed representations for a canonical vector type. This may change. In the meantime, you may have to annotate return types.
Methods
 pack :: v -> pv Source
 unpack :: pv -> v Source Instances
 PackedVec Vec4D (Vec4 Double) PackedVec Vec4D (Vec4 Double) PackedVec Vec3D (Vec3 Double) PackedVec Vec3D (Vec3 Double) PackedVec Vec2D (Vec2 Double) PackedVec Vec2D (Vec2 Double) PackedVec Vec4F (Vec4 Float) PackedVec Vec4F (Vec4 Float) PackedVec Vec3F (Vec3 Float) PackedVec Vec3F (Vec3 Float) PackedVec Vec2F (Vec2 Float) PackedVec Vec2F (Vec2 Float) PackedVec Vec4I (Vec4 Int) PackedVec Vec4I (Vec4 Int) PackedVec Vec3I (Vec3 Int) PackedVec Vec3I (Vec3 Int) PackedVec Vec2I (Vec2 Int) PackedVec Vec2I (Vec2 Int)