Skip to main content

RaylibDraw3D

Trait RaylibDraw3D 

Source
pub trait RaylibDraw3D {
Show 33 methods // Provided methods fn draw_point3D( &mut self, position: impl Into<Vector3>, color: impl Into<Color>, ) { ... } fn draw_triangle3D( &mut self, v1: impl Into<Vector3>, v2: impl Into<Vector3>, v3: impl Into<Vector3>, color: impl Into<Color>, ) { ... } fn draw_triangle_strip3D( &mut self, points: &[Vector3], color: impl Into<Color>, ) { ... } fn draw_line_3D( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, color: impl Into<Color>, ) { ... } fn draw_circle_3D( &mut self, center: impl Into<Vector3>, radius: f32, rotation_axis: impl Into<Vector3>, rotation_angle: f32, color: impl Into<Color>, ) { ... } fn draw_cube( &mut self, position: impl Into<Vector3>, width: f32, height: f32, length: f32, color: impl Into<Color>, ) { ... } fn draw_cube_v( &mut self, position: impl Into<Vector3>, size: impl Into<Vector3>, color: impl Into<Color>, ) { ... } fn draw_cube_wires( &mut self, position: impl Into<Vector3>, width: f32, height: f32, length: f32, color: impl Into<Color>, ) { ... } fn draw_cube_wires_v( &mut self, position: impl Into<Vector3>, size: impl Into<Vector3>, color: impl Into<Color>, ) { ... } fn draw_mesh( &mut self, mesh: impl AsRef<Mesh>, material: WeakMaterial, transform: Matrix, ) { ... } fn draw_mesh_instanced( &mut self, mesh: impl AsRef<Mesh>, material: WeakMaterial, transforms: &[Matrix], ) { ... } fn draw_sphere( &mut self, center_pos: impl Into<Vector3>, radius: f32, color: impl Into<Color>, ) { ... } fn draw_sphere_ex( &mut self, center_pos: impl Into<Vector3>, radius: f32, rings: i32, slices: i32, color: impl Into<Color>, ) { ... } fn draw_sphere_wires( &mut self, center_pos: impl Into<Vector3>, radius: f32, rings: i32, slices: i32, color: impl Into<Color>, ) { ... } fn draw_cylinder( &mut self, position: impl Into<Vector3>, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: impl Into<Color>, ) { ... } fn draw_cylinder_ex( &mut self, start_position: impl Into<Vector3>, end_position: impl Into<Vector3>, radius_start: f32, radius_end: f32, slices: i32, color: impl Into<Color>, ) { ... } fn draw_cylinder_wires( &mut self, position: impl Into<Vector3>, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: impl Into<Color>, ) { ... } fn draw_cylinder_wires_ex( &mut self, start_position: impl Into<Vector3>, end_position: impl Into<Vector3>, radius_start: f32, radius_end: f32, slices: i32, color: impl Into<Color>, ) { ... } fn draw_capsule( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, radius: f32, slices: i32, rings: i32, color: impl Into<Color>, ) { ... } fn draw_capsule_wires( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, radius: f32, slices: i32, rings: i32, color: impl Into<Color>, ) { ... } fn draw_plane( &mut self, center_pos: impl Into<Vector3>, size: impl Into<Vector2>, color: impl Into<Color>, ) { ... } fn draw_ray(&mut self, ray: Ray, color: impl Into<Color>) { ... } fn draw_grid(&mut self, slices: i32, spacing: f32) { ... } fn draw_model( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, ) { ... } fn draw_model_ex( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, rotation_angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, ) { ... } fn draw_model_wires( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, ) { ... } fn draw_model_wires_ex( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, rotation_angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, ) { ... } fn draw_bounding_box( &mut self, bbox: impl Into<BoundingBox>, color: impl Into<Color>, ) { ... } fn draw_billboard( &mut self, camera: impl Into<Camera3D>, texture: &Texture2D, center: impl Into<Vector3>, size: f32, tint: impl Into<Color>, ) { ... } fn draw_billboard_rec( &mut self, camera: Camera3D, texture: &Texture2D, source_rec: impl Into<Rectangle>, center: impl Into<Vector3>, size: impl Into<Vector2>, tint: impl Into<Color>, ) { ... } fn draw_billboard_pro( &mut self, camera: impl Into<Camera3D>, texture: impl Into<Texture>, source: impl Into<Rectangle>, position: impl Into<Vector3>, up: impl Into<Vector3>, size: impl Into<Vector2>, origin: impl Into<Vector2>, rotation: f32, tint: impl Into<Color>, ) { ... } fn draw_model_points( &mut self, model: impl Into<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, ) { ... } fn draw_model_points_ex( &mut self, model: impl Into<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, ) { ... }
}

Provided Methods§

Source

fn draw_point3D( &mut self, position: impl Into<Vector3>, color: impl Into<Color>, )

Draw a point in 3D space, actually a small line

Source

fn draw_triangle3D( &mut self, v1: impl Into<Vector3>, v2: impl Into<Vector3>, v3: impl Into<Vector3>, color: impl Into<Color>, )

Source

fn draw_triangle_strip3D(&mut self, points: &[Vector3], color: impl Into<Color>)

// Draw a triangle strip defined by points

Source

fn draw_line_3D( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, color: impl Into<Color>, )

Draws a line in 3D world space.

Source

fn draw_circle_3D( &mut self, center: impl Into<Vector3>, radius: f32, rotation_axis: impl Into<Vector3>, rotation_angle: f32, color: impl Into<Color>, )

Draws a circle in 3D world space.

Source

fn draw_cube( &mut self, position: impl Into<Vector3>, width: f32, height: f32, length: f32, color: impl Into<Color>, )

Draws a cube.

Source

fn draw_cube_v( &mut self, position: impl Into<Vector3>, size: impl Into<Vector3>, color: impl Into<Color>, )

Draws a cube (Vector version).

Source

fn draw_cube_wires( &mut self, position: impl Into<Vector3>, width: f32, height: f32, length: f32, color: impl Into<Color>, )

Draws a cube in wireframe.

Source

fn draw_cube_wires_v( &mut self, position: impl Into<Vector3>, size: impl Into<Vector3>, color: impl Into<Color>, )

Draws a cube in wireframe. (Vector Version)

Source

fn draw_mesh( &mut self, mesh: impl AsRef<Mesh>, material: WeakMaterial, transform: Matrix, )

Draw a 3d mesh with material and transform

Source

fn draw_mesh_instanced( &mut self, mesh: impl AsRef<Mesh>, material: WeakMaterial, transforms: &[Matrix], )

Draw multiple mesh instances with material and different transforms

Source

fn draw_sphere( &mut self, center_pos: impl Into<Vector3>, radius: f32, color: impl Into<Color>, )

Draws a sphere.

Source

fn draw_sphere_ex( &mut self, center_pos: impl Into<Vector3>, radius: f32, rings: i32, slices: i32, color: impl Into<Color>, )

Draws a sphere with extended parameters.

Source

fn draw_sphere_wires( &mut self, center_pos: impl Into<Vector3>, radius: f32, rings: i32, slices: i32, color: impl Into<Color>, )

Draws a sphere in wireframe.

Source

fn draw_cylinder( &mut self, position: impl Into<Vector3>, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder.

Source

fn draw_cylinder_ex( &mut self, start_position: impl Into<Vector3>, end_position: impl Into<Vector3>, radius_start: f32, radius_end: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder with extended parameters.

Source

fn draw_cylinder_wires( &mut self, position: impl Into<Vector3>, radius_top: f32, radius_bottom: f32, height: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder in wireframe.

Source

fn draw_cylinder_wires_ex( &mut self, start_position: impl Into<Vector3>, end_position: impl Into<Vector3>, radius_start: f32, radius_end: f32, slices: i32, color: impl Into<Color>, )

Draws a cylinder in wireframe with extended parameters.

Source

fn draw_capsule( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, radius: f32, slices: i32, rings: i32, color: impl Into<Color>, )

Draw capsule with the center of its sphere caps at startPos and endPos

Source

fn draw_capsule_wires( &mut self, start_pos: impl Into<Vector3>, end_pos: impl Into<Vector3>, radius: f32, slices: i32, rings: i32, color: impl Into<Color>, )

Draw capsule wireframe with the center of its sphere caps at startPos and endPos

Source

fn draw_plane( &mut self, center_pos: impl Into<Vector3>, size: impl Into<Vector2>, color: impl Into<Color>, )

Draws an X/Z plane.

Source

fn draw_ray(&mut self, ray: Ray, color: impl Into<Color>)

Draws a ray line.

Source

fn draw_grid(&mut self, slices: i32, spacing: f32)

Draws a grid (centered at (0, 0, 0)).

Source

fn draw_model( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, )

Draws a model (with texture if set).

Source

fn draw_model_ex( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, rotation_angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, )

Draws a model with extended parameters.

Source

fn draw_model_wires( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, )

Draws a model with wires (with texture if set).

Source

fn draw_model_wires_ex( &mut self, model: impl AsRef<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, rotation_angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, )

Draws a model with wires.

Source

fn draw_bounding_box( &mut self, bbox: impl Into<BoundingBox>, color: impl Into<Color>, )

Draws a bounding box (wires).

Source

fn draw_billboard( &mut self, camera: impl Into<Camera3D>, texture: &Texture2D, center: impl Into<Vector3>, size: f32, tint: impl Into<Color>, )

Draws a billboard texture.

Source

fn draw_billboard_rec( &mut self, camera: Camera3D, texture: &Texture2D, source_rec: impl Into<Rectangle>, center: impl Into<Vector3>, size: impl Into<Vector2>, tint: impl Into<Color>, )

Draws a billboard texture defined by source_rec.

Source

fn draw_billboard_pro( &mut self, camera: impl Into<Camera3D>, texture: impl Into<Texture>, source: impl Into<Rectangle>, position: impl Into<Vector3>, up: impl Into<Vector3>, size: impl Into<Vector2>, origin: impl Into<Vector2>, rotation: f32, tint: impl Into<Color>, )

Draw a billboard texture defined by source and rotation

Source

fn draw_model_points( &mut self, model: impl Into<Model>, position: impl Into<Vector3>, scale: f32, tint: impl Into<Color>, )

Draw a model as points

Source

fn draw_model_points_ex( &mut self, model: impl Into<Model>, position: impl Into<Vector3>, rotation_axis: impl Into<Vector3>, angle: f32, scale: impl Into<Vector3>, tint: impl Into<Color>, )

Draw a model as points with extended parameters

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, T> RaylibDraw3D for RaylibBlendMode<'a, T>

Source§

impl<'a, T> RaylibDraw3D for RaylibMode3D<'a, T>

Source§

impl<'a, T> RaylibDraw3D for RaylibScissorMode<'a, T>
where T: RaylibDraw3D,

Source§

impl<'a, T> RaylibDraw3D for RaylibShaderMode<'a, T>