Module Raylib_models

Basic 3d Shapes Drawing Functions (Module: models)

Basic geometric 3D shapes drawing functions

draw_line_3d start_pos end_pos color Draw a line in 3D world space

val draw_point_3d : Raylib_core.Vector3.t -> Raylib_core.Color.t -> unit

draw_point_3d position color Draw a point in 3D space, actually a small line

val draw_circle_3d : Raylib_core.Vector3.t -> float -> Raylib_core.Vector3.t -> float -> Raylib_core.Color.t -> unit

draw_circle_3d center radius rotation_axis rotation_angle color Draw a circle in 3D world space

draw_triangle_3d v1 v2 v3 color Draw a color-filled triangle (vertex in counter-clockwise order!)

val draw_triangle_strip_3d : Raylib_core.Vector3.t Raylib_core.ptr -> int -> Raylib_core.Color.t -> unit

draw_triangle_strip_3d points point_count color Draw a triangle strip defined by points

val draw_cube : Raylib_core.Vector3.t -> float -> float -> float -> Raylib_core.Color.t -> unit

draw_cube position width height length color Draw cube

draw_cube_v position size color Draw cube (Vector version)

val draw_cube_wires : Raylib_core.Vector3.t -> float -> float -> float -> Raylib_core.Color.t -> unit

draw_cube_wires position width height length color Draw cube wires

draw_cube_wires_v position size color Draw cube wires (Vector version)

val draw_sphere : Raylib_core.Vector3.t -> float -> Raylib_core.Color.t -> unit

draw_sphere center_pos radius color Draw sphere

val draw_sphere_ex : Raylib_core.Vector3.t -> float -> int -> int -> Raylib_core.Color.t -> unit

draw_sphere_ex center_pos radius rings slices color Draw sphere with extended parameters

val draw_sphere_wires : Raylib_core.Vector3.t -> float -> int -> int -> Raylib_core.Color.t -> unit

draw_sphere_wires center_pos radius rings slices color Draw sphere wires

val draw_cylinder : Raylib_core.Vector3.t -> float -> float -> float -> int -> Raylib_core.Color.t -> unit

draw_cylinder position radius_top radius_bottom height slices color Draw a cylinder/cone

val draw_cylinder_ex : Raylib_core.Vector3.t -> Raylib_core.Vector3.t -> float -> float -> int -> Raylib_core.Color.t -> unit

draw_cylinder_ex start_pos end_pos start_radius end_radius sides color Draw a cylinder with base at startPos and top at endPos

val draw_cylinder_wires : Raylib_core.Vector3.t -> float -> float -> float -> int -> Raylib_core.Color.t -> unit

draw_cylinder_wires position radius_top radius_bottom height slices color Draw a cylinder/cone wires

val draw_cylinder_wires_ex : Raylib_core.Vector3.t -> Raylib_core.Vector3.t -> float -> float -> int -> Raylib_core.Color.t -> unit

draw_cylinder_wires_ex start_pos end_pos start_radius end_radius sides color Draw a cylinder wires with base at startPos and top at endPos

val draw_capsule : Raylib_core.Vector3.t -> Raylib_core.Vector3.t -> float -> int -> int -> Raylib_core.Color.t -> unit

draw_capsule start_pos end_pos radius slices rings color Draw a capsule with the center of its sphere caps at startPos and endPos

val draw_capsule_wires : Raylib_core.Vector3.t -> Raylib_core.Vector3.t -> float -> int -> int -> Raylib_core.Color.t -> unit

draw_capsule_wires start_pos end_pos radius slices rings color Draw capsule wireframe with the center of its sphere caps at startPos and endPos

draw_plane center_pos size color Draw a plane XZ

val draw_ray : Raylib_core.Ray.t -> Raylib_core.Color.t -> unit

draw_ray ray color Draw a ray line

val draw_grid : int -> float -> unit

draw_grid slices spacing Draw a grid (centered at (0, 0, 0))

Model loading/unloading functions

val load_model : string -> Raylib_core.Model.t

load_model file_name Load model from files (meshes and materials)

val load_model_from_mesh : Raylib_core.Mesh.t -> Raylib_core.Model.t

load_model_from_mesh mesh Load model from generated mesh (default material)

val is_model_valid : Raylib_core.Model.t -> bool

is_model_valid model Check if a model is valid (loaded in GPU, VAO/VBOs)

val unload_model : Raylib_core.Model.t -> unit

unload_model model Unload model (including meshes) from memory (RAM and/or VRAM)

val get_model_bounding_box : Raylib_core.Model.t -> Raylib_core.BoundingBox.t

get_model_bounding_box model Compute model bounding box limits (considers all meshes)

val draw_model : Raylib_core.Model.t -> Raylib_core.Vector3.t -> float -> Raylib_core.Color.t -> unit

draw_model model position scale tint Draw a model (with texture if set)

draw_model_ex model position rotation_axis rotation_angle scale tint Draw a model with extended parameters

val draw_model_wires : Raylib_core.Model.t -> Raylib_core.Vector3.t -> float -> Raylib_core.Color.t -> unit

draw_model_wires model position scale tint Draw a model wires (with texture if set)

draw_model_wires_ex model position rotation_axis rotation_angle scale tint Draw a model wires (with texture if set) with extended parameters

val draw_bounding_box : Raylib_core.BoundingBox.t -> Raylib_core.Color.t -> unit

draw_bounding_box box color Draw bounding box (wires)

draw_billboard camera texture position scale tint Draw a billboard texture

draw_billboard_rec camera texture source position size tint Draw a billboard texture defined by source

draw_billboard_pro camera texture source position up size origin rotation tint Draw a billboard texture defined by source and rotation

val upload_mesh : Raylib_core.Mesh.t Raylib_core.ptr -> bool -> unit

upload_mesh mesh dynamic Upload mesh vertex data in GPU and provide VAO/VBO ids

val update_mesh_buffer : Raylib_core.Mesh.t -> int -> unit Raylib_core.ptr -> int -> int -> unit

update_mesh_buffer mesh index data data_size offset Update mesh vertex data in GPU for a specific buffer index

val unload_mesh : Raylib_core.Mesh.t -> unit

unload_mesh mesh Unload mesh data from CPU and GPU

draw_mesh mesh material transform Draw a 3d mesh with material and transform

val draw_mesh_instanced : Raylib_core.Mesh.t -> Raylib_core.Material.t -> Raylib_core.Matrix.t Raylib_core.ptr -> int -> unit

draw_mesh_instanced mesh material transforms instances Draw multiple mesh instances with material and different transforms

val get_mesh_bounding_box : Raylib_core.Mesh.t -> Raylib_core.BoundingBox.t

get_mesh_bounding_box mesh Compute mesh bounding box limits

Mesh generation functions

val gen_mesh_tangents : Raylib_core.Mesh.t Raylib_core.ptr -> unit

gen_mesh_tangents mesh Compute mesh tangents

val export_mesh : Raylib_core.Mesh.t -> string -> bool

export_mesh mesh file_name Export mesh data to file, returns true on success

val export_mesh_as_code : Raylib_core.Mesh.t -> string -> bool

export_mesh_as_code mesh file_name Export mesh as code file (.h) defining multiple arrays of vertex attributes

val gen_mesh_poly : int -> float -> Raylib_core.Mesh.t

gen_mesh_poly sides radius Generate polygonal mesh

val gen_mesh_plane : float -> float -> int -> int -> Raylib_core.Mesh.t

gen_mesh_plane width length res_x res_z Generate plane mesh (with subdivisions)

val gen_mesh_cube : float -> float -> float -> Raylib_core.Mesh.t

gen_mesh_cube width height length Generate cuboid mesh

val gen_mesh_sphere : float -> int -> int -> Raylib_core.Mesh.t

gen_mesh_sphere radius rings slices Generate sphere mesh (standard sphere)

val gen_mesh_hemi_sphere : float -> int -> int -> Raylib_core.Mesh.t

gen_mesh_hemi_sphere radius rings slices Generate half-sphere mesh (no bottom cap)

val gen_mesh_cylinder : float -> float -> int -> Raylib_core.Mesh.t

gen_mesh_cylinder radius height slices Generate cylinder mesh

val gen_mesh_cone : float -> float -> int -> Raylib_core.Mesh.t

gen_mesh_cone radius height slices Generate cone/pyramid mesh

val gen_mesh_torus : float -> float -> int -> int -> Raylib_core.Mesh.t

gen_mesh_torus radius size rad_seg sides Generate torus mesh

val gen_mesh_knot : float -> float -> int -> int -> Raylib_core.Mesh.t

gen_mesh_knot radius size rad_seg sides Generate trefoil knot mesh

gen_mesh_heightmap heightmap size Generate heightmap mesh from image data

gen_mesh_cubicmap cubicmap cube_size Generate cubes-based map mesh from image data

val load_materials : string -> int Raylib_core.ptr -> Raylib_core.Material.t Raylib_core.ptr

load_materials file_name material_count Load materials from model file

val load_material_default : unit -> Raylib_core.Material.t

load_material_default () Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)

val is_material_valid : Raylib_core.Material.t -> bool

is_material_valid material Check if a material is valid (shader assigned, map textures loaded in GPU)

val unload_material : Raylib_core.Material.t -> unit

unload_material material Unload material from GPU memory (VRAM)

set_material_texture material map_type texture Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...)

val set_model_mesh_material : Raylib_core.Model.t Raylib_core.ptr -> int -> int -> unit

set_model_mesh_material model mesh_id material_id Set material for a mesh

val load_model_animations : string -> Raylib_core.ModelAnimation.t Raylib_core.CArray.t

load_model_animations file_name anim_count Load model animations from file

val update_model_animation : Raylib_core.Model.t -> Raylib_core.ModelAnimation.t -> int -> unit

update_model_animation model anim frame Update model animation pose (CPU)

val update_model_animation_ex : Raylib_core.Model.t -> Raylib_core.ModelAnimation.t -> float -> Raylib_core.ModelAnimation.t -> float -> float -> unit

update_model_animation_ex model animA frameA animB frameB blend Update model animation pose, blending two animations

val unload_model_animations : Raylib_core.ModelAnimation.t Raylib_core.CArray.t -> unit

unload_model_animations animations anim_count Unload animation array data

val is_model_animation_valid : Raylib_core.Model.t -> Raylib_core.ModelAnimation.t -> bool

is_model_animation_valid model anim Check model animation skeleton match

Collision detection functions

val check_collision_spheres : Raylib_core.Vector3.t -> float -> Raylib_core.Vector3.t -> float -> bool

check_collision_spheres center1 radius1 center2 radius2 Check collision between two spheres

val check_collision_boxes : Raylib_core.BoundingBox.t -> Raylib_core.BoundingBox.t -> bool

check_collision_boxes box1 box2 Check collision between two bounding boxes

val check_collision_box_sphere : Raylib_core.BoundingBox.t -> Raylib_core.Vector3.t -> float -> bool

check_collision_box_sphere box center radius Check collision between box and sphere

val get_ray_collision_sphere : Raylib_core.Ray.t -> Raylib_core.Vector3.t -> float -> Raylib_core.RayCollision.t

get_ray_collision_sphere ray center radius Get collision info between ray and sphere

get_ray_collision_box ray box Get collision info between ray and box

get_ray_collision_mesh ray mesh transform Get collision info between ray and mesh

get_ray_collision_triangle ray p1 p2 p3 Get collision info between ray and triangle

get_ray_collision_quad ray p1 p2 p3 p4 Get collision info between ray and quad