Struct three_d::CPUMesh[][src]

pub struct CPUMesh {
    pub name: String,
    pub material_name: Option<String>,
    pub positions: Vec<f32>,
    pub indices: Option<Vec<u32>>,
    pub normals: Option<Vec<f32>>,
    pub uvs: Option<Vec<f32>>,
    pub colors: Option<Vec<u8>>,
}

A CPU-side version of a triangle mesh (for example Mesh). Can be constructed manually or loaded via io or via the utility functions for generating simple triangle meshes.

Fields

name: Stringmaterial_name: Option<String>positions: Vec<f32>indices: Option<Vec<u32>>normals: Option<Vec<f32>>uvs: Option<Vec<f32>>colors: Option<Vec<u8>>

Implementations

impl CPUMesh[src]

pub fn square(size: f32) -> Self[src]

pub fn circle(radius: f32, angle_subdivisions: u32) -> Self[src]

pub fn sphere(radius: f32) -> Self[src]

pub fn cylinder(radius: f32, length: f32, angle_subdivisions: u32) -> Self[src]

pub fn cone(radius: f32, length: f32, angle_subdivisions: u32) -> Self[src]

pub fn arrow(radius: f32, length: f32, angle_subdivisions: u32) -> Self[src]

pub fn compute_normals(&mut self)[src]

Computes the per vertex normals and updates the normals of the mesh. It will override the current normals if they already exist.

pub fn compute_aabb(&self) -> AxisAlignedBoundingBox[src]

Computes the axis aligned bounding box of the mesh.

Trait Implementations

impl Debug for CPUMesh[src]

impl Default for CPUMesh[src]

Auto Trait Implementations

impl RefUnwindSafe for CPUMesh

impl Send for CPUMesh

impl Sync for CPUMesh

impl Unpin for CPUMesh

impl UnwindSafe for CPUMesh

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.