[..] Module – hmm

Module hmm provides bindings for the HandmadeMath C library. hmm conditionally links to a specific version of HandmadeMath based on the module parameters passed when importing. Additionally, a few liberties were taken during the binding process to either fix issues with automatic binding generation, or improve the usability of these bindings. Here are the main changes:

   - Converted procedure argument names from PascalCase to snake_case
   - Converted struct field names from PascalCase to snake_case
   

#import "jc/ext/hmm";

Index

Constants (11)

Procedures (132)

Types (8)

Imports (1)

Constants

HANDMADE_MATH__USE_C11_GENERICS

HANDMADE_MATH__USE_C11_GENERICS :: 1;

HANDMADE_MATH__USE_NEON

HANDMADE_MATH__USE_NEON :: 1;

HMM_DEG180

HMM_DEG180 :: 180.0;

HMM_DEG18032

HMM_DEG18032 :: 180.0;

HMM_PI

HMM_PI :: 3.14159265358979323846;

HMM_PI32

HMM_PI32 :: 3.14159265359;

HMM_TURNHALF

HMM_TURNHALF :: 0.5;

HMM_TURNHALF32

HMM_TURNHALF32 :: 0.5;

SIMD

SIMD :: true;

Enable SIMD support.

STATIC

STATIC :: true;

Statically link to HandmadeMath.

UNITS

UNITS :: 0;

Angle units to use.

Procedures

ACosF

ACosF :: (arg: float) -> float

AddM2

AddM2 :: (left: Mat2, right: Mat2) -> Mat2

AddM3

AddM3 :: (left: Mat3, right: Mat3) -> Mat3

AddM4

AddM4 :: (left: Mat4, right: Mat4) -> Mat4

AddQ

AddQ :: (left: Quat, right: Quat) -> Quat

AddV2

AddV2 :: (left: Vec2, right: Vec2) -> Vec2

AddV3

AddV3 :: (left: Vec3, right: Vec3) -> Vec3

AddV4

AddV4 :: (left: Vec4, right: Vec4) -> Vec4

Clamp

Clamp :: (min: float, value: float, max: float) -> float

CosF

CosF :: (angle: float) -> float

Cross

Cross :: (left: Vec3, right: Vec3) -> Vec3

DeterminantM2

DeterminantM2 :: (matrix: Mat2) -> float

DeterminantM3

DeterminantM3 :: (matrix: Mat3) -> float

DeterminantM4

DeterminantM4 :: (matrix: Mat4) -> float

DivM2F

DivM2F :: (matrix: Mat2, scalar: float) -> Mat2

DivM3F

DivM3F :: (matrix: Mat3, scalar: float) -> Mat3

DivM4F

DivM4F :: (matrix: Mat4, scalar: float) -> Mat4

DivQF

DivQF :: (left: Quat, divnd: float) -> Quat

DivV2

DivV2 :: (left: Vec2, right: Vec2) -> Vec2

DivV2F

DivV2F :: (left: Vec2, right: float) -> Vec2

DivV3

DivV3 :: (left: Vec3, right: Vec3) -> Vec3

DivV3F

DivV3F :: (left: Vec3, right: float) -> Vec3

DivV4

DivV4 :: (left: Vec4, right: Vec4) -> Vec4

DivV4F

DivV4F :: (left: Vec4, right: float) -> Vec4

DotQ

DotQ :: (left: Quat, right: Quat) -> float

DotV2

DotV2 :: (left: Vec2, right: Vec2) -> float

DotV3

DotV3 :: (left: Vec3, right: Vec3) -> float

DotV4

DotV4 :: (left: Vec4, right: Vec4) -> float

EqV2

EqV2 :: (left: Vec2, right: Vec2) -> Bool

EqV3

EqV3 :: (left: Vec3, right: Vec3) -> Bool

EqV4

EqV4 :: (left: Vec4, right: Vec4) -> Bool

InvGeneralM2

InvGeneralM2 :: (matrix: Mat2) -> Mat2

InvGeneralM3

InvGeneralM3 :: (matrix: Mat3) -> Mat3

InvGeneralM4

InvGeneralM4 :: (matrix: Mat4) -> Mat4

InvLookAt

InvLookAt :: (matrix: Mat4) -> Mat4

InvOrthographic

InvOrthographic :: (ortho_matrix: Mat4) -> Mat4

InvPerspective_LH

InvPerspective_LH :: (perspective_matrix: Mat4) -> Mat4

InvPerspective_RH

InvPerspective_RH :: (perspective_matrix: Mat4) -> Mat4

InvQ

InvQ :: (left: Quat) -> Quat

InvRotate

InvRotate :: (rotation_matrix: Mat4) -> Mat4

InvScale

InvScale :: (scale_matrix: Mat4) -> Mat4

InvSqrtF

InvSqrtF :: (_float: float) -> float

InvTranslate

InvTranslate :: (translation_matrix: Mat4) -> Mat4

LenSqrV2

LenSqrV2 :: (a: Vec2) -> float

LenSqrV3

LenSqrV3 :: (a: Vec3) -> float

LenSqrV4

LenSqrV4 :: (a: Vec4) -> float

LenV2

LenV2 :: (a: Vec2) -> float

LenV3

LenV3 :: (a: Vec3) -> float

LenV4

LenV4 :: (a: Vec4) -> float

Lerp

Lerp :: (a: float, time: float, b: float) -> float

LerpV2

LerpV2 :: (a: Vec2, time: float, b: Vec2) -> Vec2

LerpV3

LerpV3 :: (a: Vec3, time: float, b: Vec3) -> Vec3

LerpV4

LerpV4 :: (a: Vec4, time: float, b: Vec4) -> Vec4

LinearCombineV4M4

LinearCombineV4M4 :: (left: Vec4, right: Mat4) -> Vec4

LookAt

LookAt :: (f: Vec3, s: Vec3, u: Vec3, eye: Vec3) -> Mat4

LookAt_LH

LookAt_LH :: (eye: Vec3, center: Vec3, up: Vec3) -> Mat4

LookAt_RH

LookAt_RH :: (eye: Vec3, center: Vec3, up: Vec3) -> Mat4

M2

M2 :: () -> Mat2

M2D

M2D :: (diagonal: float) -> Mat2

M3

M3 :: () -> Mat3

M3D

M3D :: (diagonal: float) -> Mat3

M4

M4 :: () -> Mat4

M4D

M4D :: (diagonal: float) -> Mat4

M4ToQ_LH

M4ToQ_LH :: (m: Mat4) -> Quat

M4ToQ_RH

M4ToQ_RH :: (m: Mat4) -> Quat

MixQ

MixQ :: (left: Quat, mix_left: float, right: Quat, mix_right: float) -> Quat

MulM2

MulM2 :: (left: Mat2, right: Mat2) -> Mat2

MulM2F

MulM2F :: (matrix: Mat2, scalar: float) -> Mat2

MulM2V2

MulM2V2 :: (matrix: Mat2, vector: Vec2) -> Vec2

MulM3

MulM3 :: (left: Mat3, right: Mat3) -> Mat3

MulM3F

MulM3F :: (matrix: Mat3, scalar: float) -> Mat3

MulM3V3

MulM3V3 :: (matrix: Mat3, vector: Vec3) -> Vec3

MulM4

MulM4 :: (left: Mat4, right: Mat4) -> Mat4

MulM4F

MulM4F :: (matrix: Mat4, scalar: float) -> Mat4

MulM4V4

MulM4V4 :: (matrix: Mat4, vector: Vec4) -> Vec4

MulQ

MulQ :: (left: Quat, right: Quat) -> Quat

MulQF

MulQF :: (left: Quat, multiplicative: float) -> Quat

MulV2

MulV2 :: (left: Vec2, right: Vec2) -> Vec2

MulV2F

MulV2F :: (left: Vec2, right: float) -> Vec2

MulV3

MulV3 :: (left: Vec3, right: Vec3) -> Vec3

MulV3F

MulV3F :: (left: Vec3, right: float) -> Vec3

MulV4

MulV4 :: (left: Vec4, right: Vec4) -> Vec4

MulV4F

MulV4F :: (left: Vec4, right: float) -> Vec4

NLerp

NLerp :: (left: Quat, time: float, right: Quat) -> Quat

NormQ

NormQ :: (quat: Quat) -> Quat

NormV2

NormV2 :: (a: Vec2) -> Vec2

NormV3

NormV3 :: (a: Vec3) -> Vec3

NormV4

NormV4 :: (a: Vec4) -> Vec4

Orthographic_LH_NO

Orthographic_LH_NO :: (left: float, right: float, bottom: float, top: float, near: float, far: float) -> Mat4

Orthographic_LH_ZO

Orthographic_LH_ZO :: (left: float, right: float, bottom: float, top: float, near: float, far: float) -> Mat4

Orthographic_RH_NO

Orthographic_RH_NO :: (left: float, right: float, bottom: float, top: float, near: float, far: float) -> Mat4

Orthographic_RH_ZO

Orthographic_RH_ZO :: (left: float, right: float, bottom: float, top: float, near: float, far: float) -> Mat4

Perspective_LH_NO

Perspective_LH_NO :: (fov: float, aspect_ratio: float, near: float, far: float) -> Mat4

Perspective_LH_ZO

Perspective_LH_ZO :: (fov: float, aspect_ratio: float, near: float, far: float) -> Mat4

Perspective_RH_NO

Perspective_RH_NO :: (fov: float, aspect_ratio: float, near: float, far: float) -> Mat4

Perspective_RH_ZO

Perspective_RH_ZO :: (fov: float, aspect_ratio: float, near: float, far: float) -> Mat4

Q

Q :: (x: float, y: float, z: float, w: float) -> Quat

QFromAxisAngle_LH

QFromAxisAngle_LH :: (axis: Vec3, angle: float) -> Quat

QFromAxisAngle_RH

QFromAxisAngle_RH :: (axis: Vec3, angle: float) -> Quat

QFromNormPair

QFromNormPair :: (left: Vec3, right: Vec3) -> Quat

QFromVecPair

QFromVecPair :: (left: Vec3, right: Vec3) -> Quat

QToM4

QToM4 :: (left: Quat) -> Mat4

QV4

QV4 :: (vector: Vec4) -> Quat

RotateV2

RotateV2 :: (v: Vec2, angle: float) -> Vec2

RotateV3AxisAngle_LH

RotateV3AxisAngle_LH :: (v: Vec3, axis: Vec3, angle: float) -> Vec3

RotateV3AxisAngle_RH

RotateV3AxisAngle_RH :: (v: Vec3, axis: Vec3, angle: float) -> Vec3

RotateV3Q

RotateV3Q :: (v: Vec3, q: Quat) -> Vec3

Rotate_LH

Rotate_LH :: (angle: float, axis: Vec3) -> Mat4

Rotate_RH

Rotate_RH :: (angle: float, axis: Vec3) -> Mat4

SLerp

SLerp :: (left: Quat, time: float, right: Quat) -> Quat

Scale

Scale :: (scale: Vec3) -> Mat4

SinF

SinF :: (angle: float) -> float

SqrtF

SqrtF :: (_float: float) -> float

SubM2

SubM2 :: (left: Mat2, right: Mat2) -> Mat2

SubM3

SubM3 :: (left: Mat3, right: Mat3) -> Mat3

SubM4

SubM4 :: (left: Mat4, right: Mat4) -> Mat4

SubQ

SubQ :: (left: Quat, right: Quat) -> Quat

SubV2

SubV2 :: (left: Vec2, right: Vec2) -> Vec2

SubV3

SubV3 :: (left: Vec3, right: Vec3) -> Vec3

SubV4

SubV4 :: (left: Vec4, right: Vec4) -> Vec4

TanF

TanF :: (angle: float) -> float

ToDeg

ToDeg :: (angle: float) -> float

ToRad

ToRad :: (angle: float) -> float

ToTurn

ToTurn :: (angle: float) -> float

Translate

Translate :: (translation: Vec3) -> Mat4

TransposeM2

TransposeM2 :: (matrix: Mat2) -> Mat2

TransposeM3

TransposeM3 :: (matrix: Mat3) -> Mat3

TransposeM4

TransposeM4 :: (matrix: Mat4) -> Mat4

V2

V2 :: (x: float, y: float) -> Vec2

V3

V3 :: (x: float, y: float, z: float) -> Vec3

V4

V4 :: (x: float, y: float, z: float, w: float) -> Vec4

V4V

V4V :: (vector: Vec3, w: float) -> Vec4

Macros

This section is empty.

Types

Bool

Bool :: s32;

Mat2

Mat2 :: union {
    elements: [2] [2] float;
    columns:  [2] Vec2;
}

Mat3

Mat3 :: union {
    elements: [3] [3] float;
    columns:  [3] Vec3;
}

Mat4

Mat4 :: union {
    elements: [4] [4] float;
    columns:  [4] Vec4;
}

Quat

Quat :: union {
      struct {
         union {
            xyz: Vec3;
            struct { x: float; y: float; z: float; }
         }
         w: float;
      }

      elements: [4]float;
      _: u8 #align 16;
   }

Vec2

Vec2 :: union {
    struct {
        x: float;
        y: float;
    }

    struct {
        u: float;
        v: float;
    }

    struct {
        left:  float;
        right: float;
    }

    struct {
        width:  float;
        height: float;
    }

    elements: [2] float;
}

Vec3

Vec3 :: union {
    struct {
        x: float;
        y: float;
        z: float;
    }

    struct {
        u: float;
        v: float;
        w: float;
    }

    struct {
        r: float;
        g: float;
        b: float;
    }

    struct {
        xy:        Vec2;
        _ignored0: float;
    }

    struct {
        _ignored1: float;
        yz:        Vec2;
    }

    struct {
        uv:        Vec2;
        _ignored2: float;
    }

    struct {
        _ignored3: float;
        vw:        Vec2;
    }

    elements: [3] float;
}

Vec4

Vec4 :: union {
       struct {
           union {
               xyz: Vec3;
               struct { x: float; y: float; z: float; }
           }
           w: float;
       }

       struct {
           union {
               rgb: Vec3;
               struct { r: float; g: float; b: float; }
           }
           a: float;
       }

       struct {
           xy: Vec2;
           _: float;
           _: float;
       }

       struct {
           _:  float;
           yz: Vec2;
           _:  float;
       }

       struct {
           _:  float;
           _:  float;
           zw: Vec2;
       }

       elements: [4] float;
       _: u8 #align 16;
   }