Sign in

    threejs

    js
    js-ffi
    threejs
    Download zip
    Version
    0.0.7
    License
    Apache-2.0
    Last updated
    9 months ago
    Downloads
    51

    #threejs

    Three.js是一个尽可能简化在网页端获取3D内容的库, 这个仓库是在moonbit的移植

    目前还处于开发状态

    #开始

    复制本仓库中的index.html到您的根目录即可, 并对下面的部分进行修改
    <script type="importmap">{ "imports": { "three": "https://threejs.org/build/three.module.js", "game": "替换为您moonbit生成的js文件位置" } } </script>

    #使用

    本项目还未上传至mooncake, 您可以clone本项目然后在本地编译进行测试使用

    IsBox2

    pub trait IsBox2 :
    Cast
    {
    clamp_point(Self, Vector2, Vector2) -> Vector2
    clone(Self) -> Box2
    contains_box(Self, Box2) -> Bool
    contains_point(Self, Vector2) -> Bool
    copy(Self, Box2) -> Unit
    distance_to_point(Self, Vector2) -> Float
    equals(Self, Box2) -> Bool
    expand_by_point(Self, Vector2) -> Unit
    expand_by_scalar(Self, Float) -> Unit
    expand_by_vector(Self, Vector2) -> Unit
    get_center(Self, Vector2) -> Vector2
    get_parameter(Self, Vector2, Vector2) -> Vector2
    get_size(Self, Vector2) -> Vector2
    intersect(Self, Box2) -> Unit
    intersects_box(Self, Box2) -> Bool
    is_empty(Self) -> Bool
    make_empty(Self) -> Unit
    set(Self, Vector2, Vector2) -> Unit
    set_from_center_and_size(Self, Vector2, Vector2) -> Unit
    translate(Self, Vector2) -> Unit
    union(Self, Box2) -> Unit
    }

    IsCamera

    pub trait IsCamera : IsObject {
    get_world_direction(Self, Vector3) -> Vector3
    }

    IsControl

    pub trait IsControl :
    Cast
    {
    }

    IsCubeCamera

    pub trait IsCubeCamera : IsCamera {
    update_coordinate_system(Self) -> Unit
    }

    IsDirectionalLight

    pub trait IsDirectionalLight : IsLight {
    }

    IsEluer

    pub trait IsEluer :
    Cast
    {
    x(Self) -> Float
    y(Self) -> Float
    z(Self) -> Float
    order(Self) -> String
    set(Self, Float, Float, Float, String) -> Unit
    }

    IsGLTFLoader

    pub trait IsGLTFLoader {
    }

    IsLight

    pub trait IsLight : IsObject {
    }

    IsMaterial

    pub trait IsMaterial :
    Cast
    {
    }

    IsObject

    pub trait IsObject :
    Cast
    {
    cast_shadow(Self) -> Bool
    id(Self) -> Int
    add(Self, Object) -> Unit
    attach(Self, Object) -> Unit
    clear(Self) -> Unit
    clone(Self, Bool) -> Object
    copy(Self, Object, Bool) -> Object
    get_world_direction(Self, Vector3) -> Vector3
    get_world_position(Self, Vector3) -> Vector3
    get_world_scale(Self, Vector3) -> Vector3
    local_to_world(Self, Vector3) -> Vector3
    lookat(Self, Float, Float, Float) -> Unit
    remove(Self,
    Value
    ) -> Unit
    remove_from_parent(Self) -> Unit
    rotate_on_axis(Self, Vector3, Float) -> Unit
    rotate_on_world_axis(Self, Vector3, Float) -> Unit
    rotate_x(Self, Float) -> Unit
    rotate_y(Self, Float) -> Unit
    rotate_z(Self, Float) -> Unit
    set_rotation_from_axis_angle(Self, Vector3, Float) -> Unit
    translate_on_axis(Self, Vector3, Float) -> Unit
    translate_x(Self, Float) -> Unit
    translate_y(Self, Float) -> Unit
    translate_z(Self, Float) -> Unit
    update_matrix(Self) -> Unit
    world_to_local(Self, Vector3) -> Vector3
    set_position(Self, Float, Float, Float) -> Unit
    set_rotation(Self, Float, Float, Float, String) -> Unit
    }

    IsOrbitControls

    pub trait IsOrbitControls : IsControl {
    update(Self) -> Bool
    }

    IsOrthographicCamera

    pub trait IsOrthographicCamera : IsCamera {
    clear_view_offset(Self) -> Unit
    set_view_offset(Self, Float, Float, Float, Float, Float, Float) -> Unit
    update_projection_matrix(Self) -> Unit
    }

    IsPerspectiveCamera

    pub trait IsPerspectiveCamera : IsCamera {
    clear_view_offset(Self) -> Unit
    get_effective_fov(Self) -> Float
    get_film_height(Self) -> Float
    get_film_width(Self) -> Float
    get_focal_length(Self) -> Float
    set_focal_length(Self, Float) -> Unit
    set_view_offset(Self, Float, Float, Float, Float, Float, Float) -> Unit
    update_projection_matrix(Self) -> Unit
    }

    IsPointLight

    pub trait IsPointLight : IsLight {
    decay(Self) -> Float
    distance(Self) -> Float
    }

    IsVector2

    pub trait IsVector2 :
    Cast
    {
    add(Self, Vector2) -> Unit
    add_scalar(Self, Float) -> Unit
    add_scalar_vector(Self, Vector2, Float) -> Unit
    add_vectors(Self, Vector2, Vector2) -> Unit
    angle(Self) -> Float
    angle_to(Self, Vector2) -> Float
    ceil(Self) -> Unit
    clamp(Self, Vector2, Vector2) -> Unit
    clamp_scalar(Self, Float, Float) -> Unit
    clamp_length(Self, Float, Float) -> Unit
    clone(Self) -> Vector2
    copy(Self, Vector2) -> Unit
    cross(Self, Vector2) -> Float
    distance_to(Self, Vector2) -> Float
    distance_to_squared(Self, Vector2) -> Float
    divide(Self, Vector2) -> Unit
    divide_scalar(Self, Float) -> Unit
    dot(Self, Vector2) -> Float
    equals(Self, Vector2) -> Bool
    floor(Self) -> Unit
    get_component(Self, Int) -> Float
    length(Self) -> Float
    length_sq(Self) -> Float
    lerp(Self, Vector2, Float) -> Unit
    lerp_vectors(Self, Vector2, Vector2, Float) -> Unit
    manhattan_distance_to(Self, Vector2) -> Float
    manhattan_length(Self) -> Float
    max(Self, Vector2) -> Unit
    min(Self, Vector2) -> Unit
    multiply(Self, Vector2) -> Unit
    multiply_scalar(Self, Float) -> Unit
    negate(Self) -> Unit
    normalize(Self) -> Unit
    random(Self) -> Unit
    rotate_around(Self, Vector2, Float) -> Unit
    round(Self) -> Unit
    round_to_zero(Self) -> Unit
    set(Self, Float, Float) -> Unit
    set_component(Self, Int, Float) -> Unit
    set_length(Self, Float) -> Unit
    set_scalar(Self, Float) -> Unit
    set_x(Self, Float) -> Unit
    set_y(Self, Float) -> Unit
    sub(Self, Vector2) -> Unit
    sub_scalar(Self, Float) -> Unit
    sub_vectors(Self, Vector2, Vector2) -> Unit
    }

    IsVector3

    pub trait IsVector3 :
    Cast
    {
    x(Self) -> Float
    y(Self) -> Float
    z(Self) -> Float
    add(Self, Vector3) -> Unit
    add_scalar(Self, Float) -> Unit
    add_scaled_vector(Self, Vector3, Float) -> Unit
    add_vectors(Self, Vector3, Vector3) -> Vector3
    angle_to(Self, Vector3) -> Float
    apply_axis_angle(Self, Vector3, Float) -> Unit
    ceil(Self) -> Unit
    clamp(Self, Vector3, Vector3) -> Unit
    clamp_length(Self, Float, Float) -> Unit
    clamp_scalar(Self, Float, Float) -> Unit
    clone(Self) -> Vector3
    copy(Self, Vector3) -> Unit
    cross(Self, Vector3) -> Unit
    cross_vectors(Self, Vector3, Vector3) -> Vector3
    distance_to(Self, Vector3) -> Float
    distance_to_squared(Self, Vector3) -> Float
    divide(Self, Vector3) -> Unit
    divide_scalar(Self, Float) -> Unit
    dot(Self, Vector3) -> Float
    equals(Self, Vector3) -> Bool
    floor(Self) -> Unit
    get_component(Self, Int) -> Float
    length(Self) -> Float
    length_sq(Self) -> Float
    lerp(Self, Vector3, Float) -> Unit
    lerp_vectors(Self, Vector3, Vector3, Float) -> Vector3
    manhattan_distance_to(Self, Vector3) -> Float
    manhattan_length(Self) -> Float
    max(Self, Vector3) -> Vector3
    min(Self, Vector3) -> Vector3
    multiply(Self, Vector3) -> Unit
    multiply_scalar(Self, Float) -> Vector3
    multiply_vectors(Self, Vector3, Vector3) -> Vector3
    negate(Self) -> Unit
    normalize(Self) -> Unit
    project(Self, Camera) -> Unit
    project_on_plane(Self, Vector3) -> Unit
    project_on_vector(Self, Vector3) -> Unit
    random(Self) -> Unit
    random_direction(Self) -> Unit
    reflect(Self, Vector3) -> Unit
    round(Self) -> Unit
    round_to_zero(Self) -> Unit
    set(Self, Float, Float, Float) -> Unit
    set_component(Self, Int, Float) -> Unit
    set_from_cylindrical_coords(Self, Float, Float, Float) -> Unit
    set_from_spherical_coords(Self, Float, Float, Float) -> Unit
    set_length(Self, Float) -> Unit
    set_scalar(Self, Float) -> Unit
    set_x(Self, Float) -> Unit
    set_y(Self, Float) -> Unit
    set_z(Self, Float) -> Unit
    sub(Self, Vector3) -> Unit
    sub_scalar(Self, Float) -> Unit
    sub_vectors(Self, Vector3, Vector3) -> Vector3
    unproject(Self, Camera) -> Unit
    }

    IsWebGLRenderer

    pub trait IsWebGLRenderer {
    }

    Box2

    type Box2

    impl IsBox2 for Box2

    Box2::new

    fn Box2::new(min : Vector2, max : Vector2) -> Box2

    BufferGeometry

    #external
    pub type BufferGeometry

    Camera

    #external
    pub type Camera

    impl IsObject for Camera

    Camera::new

    fn Camera::new() -> Camera

    DRACOLoader

    type DRACOLoader

    DRACOLoader::load

    fn DRACOLoader::load(loader : DRACOLoader, path : String, onload : (GLTF) -> Unit) -> Unit

    DRACOLoader::new

    DRACOLoader::setDecoderPath

    fn DRACOLoader::setDecoderPath(self : DRACOLoader, path : String) -> Unit

    see https://github.com/google/draco/releases https://www.gstatic.com/draco/versioned/decoders/1.5.7/

    DirectionalLight

    type DirectionalLight

    Eluer

    type Eluer

    GLTF

    type GLTF

    GLTF::scene

    fn GLTF::scene(self : GLTF) -> Scene

    GLTFLoader

    type GLTFLoader

    GLTFLoader::load

    fn GLTFLoader::load(loader : GLTFLoader, path : String, onload : (GLTF) -> Unit) -> Unit

    GLTFLoader::new

    fn GLTFLoader::new() -> GLTFLoader

    GLTFLoader::setDRACOLoader

    fn GLTFLoader::setDRACOLoader(self : GLTFLoader, dracoLoader : DRACOLoader) -> Unit

    Geometry

    pub(all) struct Geometry {
    bufferGeometry : BufferGeometry
    primitive : Primitive
    }

    Light

    type Light

    Loader

    type Loader

    Material

    type Material

    Mesh

    #external
    pub type Mesh

    impl IsObject for Mesh

    Mesh::new

    fn Mesh::new(geometry : BufferGeometry) -> Object

    MeshPhongMaterial

    type MeshPhongMaterial

    Object

    type Object

    OrbitControl

    type OrbitControl

    To use this module, you need to add
    import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; window.OrbitControls = OrbitControls;
    to your main .html file.

    OrbitControl::new

    fn OrbitControl::new(camera : Camera, element : String) -> OrbitControl

    OrthographicCamera

    type OrthographicCamera

    OrthographicCamera::new

    fn OrthographicCamera::new(left : Float, right : Float, top : Float, bottom : Float, near : Float, far : Float) -> Camera

    PerspectiveCamera

    type PerspectiveCamera

    PerspectiveCamera::new

    fn PerspectiveCamera::new(fov : Float, aspect : Float, near : Float, far : Float) -> Camera

    PointLight

    type PointLight

    PointLight::new

    fn PointLight::new(color : String, intensity : Float, distance : Float, decay : Float) -> DirectionalLight

    Primitive

    pub(all) enum Primitive {
    BoxGeometry
    CapsuleGeometry
    CircleGeometry
    ConeGeometry
    CylinderGeometry
    DodecahedronGeometry
    EdgesGeometry
    ExtrudeGeometry
    IcosahedronGeometry
    LatheGeometry
    OctahedronGeometry
    ParametricGeometry
    PlaneGeometry
    PolyhedronGeometry
    RingGeometry
    ShapeGeometry
    SphereGeometry
    TetrahedronGeometry
    TorusGeometry
    TorusKnotGeometry
    TubeGeometry
    WireframeGeometry
    }

    Render

    #external
    pub type Render

    Render::newWebGL

    fn Render::newWebGL(canvas : String) -> Render

    Render::render

    fn Render::render(renderer : Render, scene :
    Value
    , camera : Camera) -> Unit

    Render::setPixelRatio

    fn Render::setPixelRatio(renderer : Render, value : Float) -> Unit

    Render::setSize

    fn Render::setSize(renderer : Render, width : Int, height : Int, updateStyle : Bool) -> Unit

    Scene

    #external
    pub type Scene

    impl IsObject for Scene

    Scene::background

    fn Scene::background(self : Scene, color : String) -> Unit

    Scene::new

    fn Scene::new() -> Scene

    Vector2

    type Vector2

    Vector2::new

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

    Vector3

    type Vector3

    Vector3::new

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

    box2_clamp_point_ffi

    box2_clone_ffi

    fn box2_clone_ffi(box :
    Value
    ) -> Box2

    box2_contains_box_ffi

    fn box2_contains_box_ffi(box :
    Value
    , other :
    Value
    ) -> Bool

    box2_contains_point_ffi

    fn box2_contains_point_ffi(box :
    Value
    , point :
    Value
    ) -> Bool

    box2_copy_ffi

    fn box2_copy_ffi(box :
    Value
    , other :
    Value
    ) -> Unit

    box2_distance_to_point_ffi

    fn box2_distance_to_point_ffi(box :
    Value
    , point :
    Value
    ) -> Float

    box2_equals_ffi

    fn box2_equals_ffi(box :
    Value
    , other :
    Value
    ) -> Bool

    box2_expand_by_point_ffi

    fn box2_expand_by_point_ffi(box :
    Value
    , other :
    Value
    ) -> Unit

    box2_expand_by_scalar_ffi

    fn box2_expand_by_scalar_ffi(box :
    Value
    , other : Float) -> Unit

    box2_expand_by_vector_ffi

    fn box2_expand_by_vector_ffi(box :
    Value
    , other :
    Value
    ) -> Unit

    box2_get_center_ffi

    fn box2_get_center_ffi(box :
    Value
    , target :
    Value
    ) -> Vector2

    box2_get_parameter_ffi

    box2_get_size_ffi

    fn box2_get_size_ffi(box :
    Value
    , target :
    Value
    ) -> Vector2

    box2_intersect_ffi

    fn box2_intersect_ffi(box :
    Value
    , other :
    Value
    ) -> Unit

    box2_intersects_box_ffi

    fn box2_intersects_box_ffi(box :
    Value
    , other :
    Value
    ) -> Bool

    box2_is_empty_ffi

    fn box2_is_empty_ffi(box :
    Value
    ) -> Bool

    box2_make_empty_ffi

    fn box2_make_empty_ffi(box :
    Value
    ) -> Unit

    box2_set_ffi

    box2_set_from_center_and_size_ffi

    fn box2_set_from_center_and_size_ffi(box :
    Value
    , center :
    Value
    , size :
    Value
    ) -> Unit

    box2_translate_ffi

    fn box2_translate_ffi(box :
    Value
    , offset :
    Value
    ) -> Unit

    box2_union_ffi

    fn box2_union_ffi(box :
    Value
    , other :
    Value
    ) -> Unit

    camera_get_world_direction_ffi

    fn camera_get_world_direction_ffi(camera :
    Value
    , target :
    Value
    ) -> Vector3

    cube_update_coordinate_system_ffi

    fn cube_update_coordinate_system_ffi(camera :
    Value
    ) -> Unit

    decay_ffi

    fn decay_ffi(obj :
    Value
    ) -> Float

    distance_ffi

    fn distance_ffi(obj :
    Value
    ) -> Float

    eluer_order_ffi

    fn eluer_order_ffi(obj :
    Value
    ) -> String

    eluer_set_ffi

    fn eluer_set_ffi(obj :
    Value
    , x : Float, y : Float, z : Float, order : String) -> Unit

    eluer_x_ffi

    fn eluer_x_ffi(obj :
    Value
    ) -> Float

    eluer_y_ffi

    fn eluer_y_ffi(obj :
    Value
    ) -> Float

    eluer_z_ffi

    fn eluer_z_ffi(obj :
    Value
    ) -> Float

    ffi_to_cube_camera

    ffi_to_directionalLight

    ffi_to_orbit_control

    ffi_to_orthographic_camera

    ffi_to_perspective_camera

    js_identity

    fn[A, B] js_identity(a : A) -> B

    meshBasicMaterial

    fn meshBasicMaterial() -> Material

    newBox

    fn newBox(width : Int, height : Int, depth : Int, widthSegments : Int, heightSegments : Int, depthSegments : Int) -> BufferGeometry

    newCapsule

    fn newCapsule(radius : Float, height : Float, capSegments : Int, radialSegments : Int, heightSegments : Int) -> BufferGeometry

    newCircle

    fn newCircle(radius : Float, segments : Int, thetaStart : Float, thetaLength : Float) -> BufferGeometry

    newCone

    fn newCone(radius : Float, height : Float, radialSegments : Int, heightSegments : Int, openEnded : Bool, thetaStart : Float, thetaLength : Float) -> BufferGeometry

    newCylinder

    fn newCylinder(radiusTop : Float, radiusBottom : Float, height : Float, radialSegments : Int, heightSegments : Int, openEnded : Bool, thetaStart : Float, thetaLength : Float) -> BufferGeometry

    newDodecahedron

    fn newDodecahedron(radius : Float, detail : Int) -> BufferGeometry

    newEdges

    fn newEdges(geometry : BufferGeometry, thresholdAngle : Int) -> BufferGeometry

    newExtrude

    fn newExtrude() -> BufferGeometry

    TODO:

    newIcosahedron

    fn newIcosahedron(radius : Float, detail : Int) -> BufferGeometry

    newLathe

    fn newLathe(segments : Int, phiStart : Float, phiLength : Float) -> BufferGeometry

    TODO:

    newOctahedron

    fn newOctahedron(radius : Float, detail : Int) -> BufferGeometry

    newPlane

    fn newPlane(width : Float, height : Float, widthSegments : Int, heightSegments : Int) -> BufferGeometry

    newPolyhedron

    fn newPolyhedron() -> BufferGeometry

    TODO:

    newRing

    fn newRing(innerRadius : Float, outerRadius : Float, thetaSegments : Int, phiSegments : Int, thetaStart : Float, thetaLength : Float) -> BufferGeometry

    newShape

    fn newShape() -> BufferGeometry

    TODO:

    newSphere

    fn newSphere(radius : Float, widthSegments : Int, heightSegments : Int, phiStart : Float, phiLength : Float, thetaStart : Float, thetaLength : Float) -> BufferGeometry

    newTetrahedron

    fn newTetrahedron(radius : Float, detail : Int) -> BufferGeometry

    newTorus

    fn newTorus(radius : Float, tube : Float, radialSegments : Int, tubularSegments : Int, arc : Float) -> BufferGeometry

    newTorusKnot

    fn newTorusKnot(radius : Float, tube : Float, tubularSegments : Int, radialSegments : Int, p : Int, q : Int) -> BufferGeometry

    newTube

    fn newTube(tubularSegments : Int, radius : Float, radialSegments : Int, closed : Bool) -> BufferGeometry

    TODO:

    newWireframe

    fn newWireframe(geometry : BufferGeometry) -> BufferGeometry

    object_add_ffi

    fn object_add_ffi(parent :
    Value
    , child :
    Value
    ) -> Unit

    object_attach_ffi

    fn object_attach_ffi(obj :
    Value
    , object :
    Value
    ) -> Unit

    object_cast_shadow_ffi

    fn object_cast_shadow_ffi(obj :
    Value
    ) -> Bool

    object_clear_ffi

    fn object_clear_ffi(obj :
    Value
    ) -> Unit

    object_clone_ffi

    fn object_clone_ffi(obj :
    Value
    , recursive : Bool) -> Object

    object_copy_ffi

    fn object_copy_ffi(obj :
    Value
    , object :
    Value
    , recursive : Bool) -> Object

    object_frustum_culled_ffi

    fn object_frustum_culled_ffi(obj :
    Value
    ) -> Bool

    object_get_world_direction_ffi

    fn object_get_world_direction_ffi(obj :
    Value
    , target :
    Value
    ) -> Vector3

    object_get_world_position_ffi

    fn object_get_world_position_ffi(obj :
    Value
    , target :
    Value
    ) -> Vector3

    object_get_world_scale_ffi

    fn object_get_world_scale_ffi(obj :
    Value
    , target :
    Value
    ) -> Vector3

    object_id_ffi

    fn object_id_ffi(obj :
    Value
    ) -> Int

    object_is_object3d_ffi

    fn object_is_object3d_ffi(obj :
    Value
    ) -> Bool

    object_local_to_world_ffi

    fn object_local_to_world_ffi(obj :
    Value
    , vector :
    Value
    ) -> Vector3

    object_lookat_ffi

    fn object_lookat_ffi(obj :
    Value
    , x : Float, y : Float, z : Float) -> Unit

    object_matrix_auto_update_ffi

    fn object_matrix_auto_update_ffi(obj :
    Value
    ) -> Bool

    object_remove_ffi

    fn object_remove_ffi(parent :
    Value
    , child :
    Value
    ) -> Unit

    object_remove_from_parent_ffi

    fn object_remove_from_parent_ffi(obj :
    Value
    ) -> Unit

    object_rotate_on_axis_ffi

    fn object_rotate_on_axis_ffi(obj :
    Value
    , axis :
    Value
    , angle : Float) -> Unit

    object_rotate_on_world_axis_ffi

    fn object_rotate_on_world_axis_ffi(obj :
    Value
    , axis :
    Value
    , angle : Float) -> Unit

    object_rotate_x_ffi

    fn object_rotate_x_ffi(obj :
    Value
    , angle : Float) -> Unit

    object_rotate_y_ffi

    fn object_rotate_y_ffi(obj :
    Value
    , angle : Float) -> Unit

    object_rotate_z_ffi

    fn object_rotate_z_ffi(obj :
    Value
    , angle : Float) -> Unit

    object_set_position_ffi

    fn object_set_position_ffi(obj :
    Value
    , x : Float, y : Float, z : Float) -> Unit

    object_set_rotation_ffi

    fn object_set_rotation_ffi(obj :
    Value
    , x : Float, y : Float, z : Float, order : String) -> Unit

    object_set_rotation_from_axis_angle_ffi

    fn object_set_rotation_from_axis_angle_ffi(obj :
    Value
    , axis :
    Value
    , angle : Float) -> Unit

    object_translate_x_ffi

    fn object_translate_x_ffi(obj :
    Value
    , distance : Float) -> Unit

    object_translate_y_ffi

    fn object_translate_y_ffi(obj :
    Value
    , distance : Float) -> Unit

    object_translate_z_ffi

    fn object_translate_z_ffi(obj :
    Value
    , distance : Float) -> Unit

    object_transltae_on_axis_ffi

    fn object_transltae_on_axis_ffi(obj :
    Value
    , axis :
    Value
    , distance : Float) -> Unit

    object_update_matrix_ffi

    fn object_update_matrix_ffi(obj :
    Value
    ) -> Unit

    object_world_to_local_ffi

    fn object_world_to_local_ffi(obj :
    Value
    , vector : Vector3) -> Vector3

    orbit_update_ffi

    fn orbit_update_ffi(orbit :
    Value
    ) -> Bool

    orthographic_clear_view_offset_ffi

    fn orthographic_clear_view_offset_ffi(camera :
    Value
    ) -> Unit

    orthographic_set_view_offset_ffi

    fn orthographic_set_view_offset_ffi(camera :
    Value
    , fullwidth : Float, fullheight : Float, x : Float, y : Float, width : Float, height : Float) -> Unit

    orthographic_update_projection_matrix_ffi

    fn orthographic_update_projection_matrix_ffi(camera :
    Value
    ) -> Unit

    perspective_clear_view_offset_ffi

    fn perspective_clear_view_offset_ffi(camera :
    Value
    ) -> Unit

    perspective_get_effective_fov_ffi

    fn perspective_get_effective_fov_ffi(camera :
    Value
    ) -> Float

    perspective_get_film_height_ffi

    fn perspective_get_film_height_ffi(camera :
    Value
    ) -> Float

    perspective_get_film_width_ffi

    fn perspective_get_film_width_ffi(camera :
    Value
    ) -> Float

    perspective_get_focal_length_ffi

    fn perspective_get_focal_length_ffi(camera :
    Value
    ) -> Float

    perspective_set_focal_length_ffi

    fn perspective_set_focal_length_ffi(camera :
    Value
    , length : Float) -> Unit

    perspective_set_view_offset_ffi

    fn perspective_set_view_offset_ffi(camera :
    Value
    , x : Float, y : Float, width : Float, height : Float, aspect : Float, zoom : Float) -> Unit

    perspective_update_projection_matrix_ffi

    fn perspective_update_projection_matrix_ffi(camera :
    Value
    ) -> Unit

    request_animation_frame

    fn request_animation_frame(f : (Double) -> Unit) -> Double

    https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame

    vector2_add_ffi

    fn vector2_add_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_add_scalar_ffi

    fn vector2_add_scalar_ffi(vec :
    Value
    , s : Float) -> Unit

    vector2_add_scalar_vector_ffi

    fn vector2_add_scalar_vector_ffi(vec :
    Value
    , v :
    Value
    , s : Float) -> Unit

    vector2_add_vectors_ffi

    vector2_angle_ffi

    fn vector2_angle_ffi(vec :
    Value
    ) -> Float

    vector2_angle_to_ffi

    fn vector2_angle_to_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector2_ceil_ffi

    fn vector2_ceil_ffi(vec :
    Value
    ) -> Unit

    vector2_clamp_ffi

    vector2_clamp_length_ffi

    fn vector2_clamp_length_ffi(vec :
    Value
    , min : Float, max : Float) -> Unit

    vector2_clamp_scalar_ffi

    fn vector2_clamp_scalar_ffi(vec :
    Value
    , min : Float, max : Float) -> Unit

    vector2_clone_ffi

    fn vector2_clone_ffi(vec :
    Value
    ) -> Vector2

    vector2_copy_ffi

    fn vector2_copy_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_cross_ffi

    fn vector2_cross_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector2_distance_to_ffi

    fn vector2_distance_to_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector2_distance_to_squared_ffi

    fn vector2_distance_to_squared_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector2_divide_ffi

    fn vector2_divide_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_divide_scalar_ffi

    fn vector2_divide_scalar_ffi(vec :
    Value
    , s : Float) -> Unit

    vector2_dot_ffi

    fn vector2_dot_ffi(vec :
    Value
    , s : Float) -> Float

    vector2_equals_ffi

    fn vector2_equals_ffi(vec :
    Value
    , v : Vector2) -> Bool

    vector2_floor_ffi

    fn vector2_floor_ffi(vec :
    Value
    ) -> Unit

    vector2_get_component_ffi

    fn vector2_get_component_ffi(vec :
    Value
    , index : Int) -> Float

    vector2_length_ffi

    fn vector2_length_ffi(vec :
    Value
    ) -> Float

    vector2_length_sq_ffi

    fn vector2_length_sq_ffi(vec :
    Value
    ) -> Float

    vector2_lerp_ffi

    fn vector2_lerp_ffi(vec :
    Value
    , v :
    Value
    , alpha : Float) -> Unit

    vector2_lerp_vectors_ffi

    fn vector2_lerp_vectors_ffi(vec :
    Value
    , v1 :
    Value
    , v2 :
    Value
    , alpha : Float) -> Unit

    vector2_manhattan_distance_to_ffi

    fn vector2_manhattan_distance_to_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector2_manhattan_length_ffi

    fn vector2_manhattan_length_ffi(vec :
    Value
    ) -> Float

    vector2_max_ffi

    fn vector2_max_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_min_ffi

    fn vector2_min_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_multiply_ffi

    fn vector2_multiply_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_multiply_scalar_ffi

    fn vector2_multiply_scalar_ffi(vec :
    Value
    , s : Float) -> Unit

    vector2_negate_ffi

    fn vector2_negate_ffi(vec :
    Value
    ) -> Unit

    vector2_normalize_ffi

    fn vector2_normalize_ffi(vec :
    Value
    ) -> Unit

    vector2_random_ffi

    fn vector2_random_ffi(vec :
    Value
    ) -> Unit

    vector2_rotate_around_ffi

    fn vector2_rotate_around_ffi(vec :
    Value
    , center :
    Value
    , angle : Float) -> Unit

    vector2_round_ffi

    fn vector2_round_ffi(vec :
    Value
    ) -> Unit

    vector2_round_to_zero_ffi

    fn vector2_round_to_zero_ffi(vec :
    Value
    ) -> Unit

    vector2_set_component_ffi

    fn vector2_set_component_ffi(vec :
    Value
    , index : Int, value : Float) -> Unit

    vector2_set_ffi

    fn vector2_set_ffi(vec :
    Value
    , x : Float, y : Float) -> Unit

    vector2_set_length_ffi

    fn vector2_set_length_ffi(vec :
    Value
    , length : Float) -> Unit

    vector2_set_x_ffi

    fn vector2_set_x_ffi(vec :
    Value
    , x : Float) -> Unit

    vector2_set_y_ffi

    fn vector2_set_y_ffi(vec :
    Value
    , y : Float) -> Unit

    vector2_sub_ffi

    fn vector2_sub_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector2_sub_scalar_ffi

    fn vector2_sub_scalar_ffi(vec :
    Value
    , scalar : Float) -> Unit

    vector2_sub_vectors_ffi

    vector3_add_ffi

    fn vector3_add_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_add_scalar_ffi

    fn vector3_add_scalar_ffi(vec :
    Value
    , s : Float) -> Unit

    vector3_add_scaled_vector_ffi

    fn vector3_add_scaled_vector_ffi(vec :
    Value
    , v :
    Value
    , s : Float) -> Unit

    vector3_add_vectors_ffi

    vector3_angle_to_ffi

    fn vector3_angle_to_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector3_applye_axis_angle_ffi

    fn vector3_applye_axis_angle_ffi(vec :
    Value
    , axis :
    Value
    , angle : Float) -> Unit

    vector3_ceil_ffi

    fn vector3_ceil_ffi(vec :
    Value
    ) -> Unit

    vector3_clamp_ffi

    vector3_clamp_length_ffi

    fn vector3_clamp_length_ffi(vec :
    Value
    , minv : Float, maxv : Float) -> Unit

    vector3_clamp_scalar_ffi

    fn vector3_clamp_scalar_ffi(vec :
    Value
    , minv : Float, maxv : Float) -> Unit

    vector3_clone_ffi

    fn vector3_clone_ffi(vec :
    Value
    ) -> Vector3

    vector3_copy_ffi

    fn vector3_copy_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_cross_ffi

    fn vector3_cross_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_cross_vectors_ffi

    vector3_distance_to_ffi

    fn vector3_distance_to_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector3_distance_to_squared_ffi

    fn vector3_distance_to_squared_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector3_divide_ffi

    fn vector3_divide_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_divide_scalar_ffi

    fn vector3_divide_scalar_ffi(vec :
    Value
    , scalar : Float) -> Unit

    vector3_dot_ffi

    fn vector3_dot_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector3_equals_ffi

    fn vector3_equals_ffi(vec :
    Value
    , v :
    Value
    ) -> Bool

    vector3_floor_ffi

    fn vector3_floor_ffi(vec :
    Value
    ) -> Unit

    vector3_get_component_ffi

    fn vector3_get_component_ffi(vec :
    Value
    , index : Int) -> Float

    vector3_length_ffi

    fn vector3_length_ffi(vec :
    Value
    ) -> Float

    vector3_length_sq_ffi

    fn vector3_length_sq_ffi(vec :
    Value
    ) -> Float

    vector3_lerp_ffi

    fn vector3_lerp_ffi(vec :
    Value
    , v :
    Value
    , alpha : Float) -> Unit

    vector3_lerp_vectors_ffi

    fn vector3_lerp_vectors_ffi(vec :
    Value
    , v1 :
    Value
    , v2 :
    Value
    , alpha : Float) -> Vector3

    vector3_manhattan_distance_to_ffi

    fn vector3_manhattan_distance_to_ffi(vec :
    Value
    , v :
    Value
    ) -> Float

    vector3_manhattan_length_ffi

    fn vector3_manhattan_length_ffi(vec :
    Value
    ) -> Float

    vector3_max_ffi

    vector3_min_ffi

    vector3_multiply_ffi

    fn vector3_multiply_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_multiply_scalar_ffi

    fn vector3_multiply_scalar_ffi(vec :
    Value
    , v : Float) -> Vector3

    vector3_multiply_vectors_ffi

    vector3_negate_ffi

    fn vector3_negate_ffi(vec :
    Value
    ) -> Unit

    vector3_normalize_ffi

    fn vector3_normalize_ffi(vec :
    Value
    ) -> Unit

    vector3_project_ffi

    fn vector3_project_ffi(vec :
    Value
    , camera :
    Value
    ) -> Unit

    vector3_project_on_plane_ffi

    fn vector3_project_on_plane_ffi(vec :
    Value
    , plane :
    Value
    ) -> Unit

    vector3_project_on_vector_ffi

    fn vector3_project_on_vector_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_random_direction_ffi

    fn vector3_random_direction_ffi(vec :
    Value
    ) -> Unit

    vector3_random_ffi

    fn vector3_random_ffi(vec :
    Value
    ) -> Unit

    vector3_reflect_ffi

    fn vector3_reflect_ffi(vec :
    Value
    , normal :
    Value
    ) -> Unit

    vector3_round_ffi

    fn vector3_round_ffi(vec :
    Value
    ) -> Unit

    vector3_round_to_zero_ffi

    fn vector3_round_to_zero_ffi(vec :
    Value
    ) -> Unit

    vector3_set_component_ffi

    fn vector3_set_component_ffi(vec :
    Value
    , index : Int, value : Float) -> Unit

    vector3_set_ffi

    fn vector3_set_ffi(vec :
    Value
    , x : Float, y : Float, z : Float) -> Unit

    vector3_set_from_cylindrical_coords_ffi

    fn vector3_set_from_cylindrical_coords_ffi(vec :
    Value
    , radius : Float, theta : Float, y : Float) -> Unit

    vector3_set_from_spherical_coords_ffi

    fn vector3_set_from_spherical_coords_ffi(vec :
    Value
    , radius : Float, phi : Float, theta : Float) -> Unit

    vector3_set_length_ffi

    fn vector3_set_length_ffi(vec :
    Value
    , length : Float) -> Unit

    vector3_set_scalar_ffi

    fn vector3_set_scalar_ffi(vec :
    Value
    , scalar : Float) -> Unit

    vector3_set_x_ffi

    fn vector3_set_x_ffi(vec :
    Value
    , x : Float) -> Unit

    vector3_set_y_ffi

    fn vector3_set_y_ffi(vec :
    Value
    , y : Float) -> Unit

    vector3_set_z_ffi

    fn vector3_set_z_ffi(vec :
    Value
    , z : Float) -> Unit

    vector3_sub_ffi

    fn vector3_sub_ffi(vec :
    Value
    , v :
    Value
    ) -> Unit

    vector3_sub_scalar_ffi

    fn vector3_sub_scalar_ffi(vec :
    Value
    , s : Float) -> Unit

    vector3_sub_vectors_ffi

    vector3_unproject_ffi

    fn vector3_unproject_ffi(vec :
    Value
    , camera :
    Value
    ) -> Unit

    vector3_x_ffi

    fn vector3_x_ffi(vec :
    Value
    ) -> Float

    vector3_y_ffi

    fn vector3_y_ffi(vec :
    Value
    ) -> Float

    vector3_z_ffi

    fn vector3_z_ffi(vec :
    Value
    ) -> Float