Sign in

    Milky2018/mgstudio/math does not have a README file

    Has_Transform

    pub(open) trait Has_Transform {
    get_transform_store(self : Self) ->
    ComponentStore
    [Transform]
    }

    IVec2

    pub struct IVec2 {
    x : Int
    y : Int
    }

    IVec2::add

    fn IVec2::add(self : IVec2, other : IVec2) -> IVec2

    IVec2::max

    fn IVec2::max(self : IVec2, other : IVec2) -> IVec2

    IVec2::min

    fn IVec2::min(self : IVec2, other : IVec2) -> IVec2

    IVec2::new

    fn IVec2::new(x : Int, y : Int) -> IVec2

    IVec2::saturating_sub

    fn IVec2::saturating_sub(self : IVec2, other : IVec2) -> IVec2

    IVec2::to_vec2

    fn IVec2::to_vec2(self : IVec2) -> Vec2

    Quat

    pub struct Quat {
    x : Float
    y : Float
    z : Float
    w : Float
    }

    Quaternion (x, y, z, w).

    Quat::from_rotation_z

    fn Quat::from_rotation_z(angle : Float) -> Quat

    Rotation around Z axis (radians).

    Quat::identity

    fn Quat::identity() -> Quat

    Quat::mul

    fn Quat::mul(self : Quat, other : Quat) -> Quat

    Quat::new

    fn Quat::new(x : Float, y : Float, z : Float, w : Float) -> Quat

    Construct a quaternion from raw components (x, y, z, w).

    This is primarily for engine integrations (e.g. 3D physics) that need to convert from external quaternion representations.

    Quat::to_rotation_z_angle

    fn Quat::to_rotation_z_angle(self : Quat) -> Float

    Approximate yaw (rotation around Z) in radians.

    Rect

    pub struct Rect {
    min : Vec2
    max : Vec2
    }

    Rect::center

    fn Rect::center(self : Rect) -> Vec2

    Rect::contains

    fn Rect::contains(self : Rect, value : Vec2) -> Bool

    Rect::new

    fn Rect::new(min : Vec2, max : Vec2) -> Rect

    Rect::size

    fn Rect::size(self : Rect) -> Vec2

    Transform

    pub struct Transform {
    translation : Vec3
    rotation : Quat
    scale : Vec3
    }

    Transform::from_xy

    fn Transform::from_xy(x : Float, y : Float) -> Transform

    Transform::from_xy_rotation_scale

    fn Transform::from_xy_rotation_scale(translation : Vec2, rotation_z : Float, scale : Vec2, z? : Float) -> Transform

    Convenience for 2D usage: translation.xy + rotation about Z + scale.xy.

    Transform::from_xyz

    fn Transform::from_xyz(x : Float, y : Float, z : Float) -> Transform

    Transform::identity

    fn Transform::identity() -> Transform

    Transform::new

    fn Transform::new(translation : Vec3, rotation : Quat, scale : Vec3) -> Transform

    Transform::rotation_z

    fn Transform::rotation_z(self : Transform) -> Float

    URect

    pub struct URect {
    min : UVec2
    max : UVec2
    }

    URect::as_rect

    fn URect::as_rect(self : URect) -> Rect

    URect::new

    fn URect::new(min : UVec2, max : UVec2) -> URect

    URect::size

    fn URect::size(self : URect) -> UVec2

    UVec2

    pub struct UVec2 {
    x : Int
    y : Int
    }

    UVec2::add

    fn UVec2::add(self : UVec2, other : UVec2) -> UVec2

    UVec2::new

    fn UVec2::new(x : Int, y : Int) -> UVec2

    UVec2::saturating_sub

    fn UVec2::saturating_sub(self : UVec2, other : UVec2) -> UVec2

    UVec2::splat

    fn UVec2::splat(value : Int) -> UVec2

    UVec2::to_vec2

    fn UVec2::to_vec2(self : UVec2) -> Vec2

    UVec2::zero

    fn UVec2::zero() -> UVec2

    Vec2

    pub struct Vec2 {
    x : Float
    y : Float
    }

    Vec2::new

    fn Vec2::new(x : Float, y : Float) -> Vec2

    Vec2::sub

    fn Vec2::sub(self : Vec2, other : Vec2) -> Vec2

    Vec2::to_angle

    fn Vec2::to_angle(self : Vec2) -> Float

    Vec3

    pub struct Vec3 {
    x : Float
    y : Float
    z : Float
    }

    Vec3::add

    fn Vec3::add(self : Vec3, other : Vec3) -> Vec3

    Vec3::mul

    fn Vec3::mul(self : Vec3, other : Vec3) -> Vec3

    Vec3::new

    fn Vec3::new(x : Float, y : Float, z : Float) -> Vec3

    Vec3::splat

    fn Vec3::splat(v : Float) -> Vec3

    Vec3::zero

    fn Vec3::zero() -> Vec3

    Vec4

    pub struct Vec4 {
    x : Float
    y : Float
    z : Float
    w : Float
    }

    Vec4::new

    fn Vec4::new(x : Float, y : Float, z : Float, w : Float) -> Vec4

    Vec4::splat

    fn Vec4::splat(v : Float) -> Vec4

    atan2

    fn atan2(y : Float, x : Float) -> Float

    cos

    fn cos(value : Float) -> Float

    ecs_components

    let ecs_components : Array[String]

    ECS component types discovered via #ecs.component.

    ecs_resources

    let ecs_resources : Array[String]

    ECS resource types discovered via #ecs.resource.

    pi_half

    fn pi_half() -> Float

    pow

    fn pow(base : Float, exponent : Float) -> Float

    sin

    fn sin(value : Float) -> Float

    sqrt

    fn sqrt(value : Float) -> Float

    Source Files