[][src]Enum amethyst_rendy::shape::Shape

pub enum Shape {
    Sphere(usizeusize),
    Cone(usize),
    Cube,
    Cylinder(usizeOption<usize>),
    Torus(f32f32usizeusize),
    IcoSphere(Option<usize>),
    Plane(Option<(usize, usize)>),
    Circle(usize),
}

Shape generators

Variants

Sphere(usizeusize)

Sphere, number of points around the equator, number of points pole to pole. Sphere has radius of 1, so it's diameter is 2 units

Cone(usize)

Cone, number of subdivisions around the radius, must be > 1

Cube

Cube with vertices in [-1, +1] range, so it's width is 2 units

Cylinder(usizeOption<usize>)

Cylinder, number of points across the radius, optional subdivides along the height

Torus(f32f32usizeusize)

Torus, radius from origin to center of tubular, tubular radius from toridal to surface, number of tube segments >= 3, number of segments around the tube

IcoSphere(Option<usize>)

Icosahedral sphere, number of subdivisions > 0 if given

Plane(Option<(usize, usize)>)

Plane, located in the XY plane, number of subdivisions along x and y axis if given

Circle(usize)

Circle, located in the XY plane, number of points around the circle

Methods

impl Shape[src]

pub fn upload<V, P>(
    &self,
    scale: Option<(f32, f32, f32)>,
    upload: ShapeUpload,
    progress: P
) -> Handle<Mesh> where
    V: FromShape + Into<MeshBuilder<'static>>,
    P: Progress
[src]

Generate Mesh for the Shape, and convert it into a Handle<Mesh>.

Parameters:

  • scale: Scale the shape by the given amounts along the x, y, z axes
  • upload: ECS resources needed for uploading the mesh
  • progress: Progress tracker

Type parameters:

V: Vertex format to use, must to be one of: * Vec<PosTex> * Vec<PosNormTex> * Vec<PosNormTangTex> * ComboMeshCreator P: Progress tracker type

pub fn generate<V>(
    &self,
    scale: Option<(f32, f32, f32)>
) -> MeshBuilder<'static> where
    V: FromShape + Into<MeshBuilder<'static>>, 
[src]

Generate MeshBuilder for the Shape

Parameters:

  • scale: Scale the shape by the given amounts along the x, y, z axes

Type parameters:

V: Vertex format to use, must to be one of: * Vec<PosTex> * Vec<PosNormTex> * Vec<PosNormTangTex> * ComboMeshCreator

pub fn generate_vertices<V>(&self, scale: Option<(f32, f32, f32)>) -> V where
    V: FromShape
[src]

Generate vertices for the Shape, in format V

Parameters:

  • scale: Scale the shape by the given amounts along the x, y, z axes

Type parameters:

V: Vertex format to use, must to be one of: * Vec<PosTex> * Vec<PosNormTex> * Vec<PosNormTangTex> * ComboMeshCreator

Trait Implementations

impl Clone for Shape[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Shape[src]

impl Serialize for Shape[src]

impl<'de> Deserialize<'de> for Shape[src]

Auto Trait Implementations

impl Unpin for Shape

impl Sync for Shape

impl Send for Shape

impl UnwindSafe for Shape

impl RefUnwindSafe for Shape

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.

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

impl<T> Erased for T[src]

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

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

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

impl<T> Clone for T where
    T: Clone
[src]