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>>,
}
Expand description

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]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for CPUMesh[src]

fn default() -> CPUMesh[src]

Returns the “default value” for a type. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.