pub struct ProceduralMesh {Show 22 fields
pub asset_id: AssetId,
pub generator: String,
pub half_width: f32,
pub half_depth: f32,
pub ceiling_height: f32,
pub half_extents: Option<[f32; 3]>,
pub radius: Option<f32>,
pub height: Option<f32>,
pub segments: Option<u32>,
pub rings: Option<u32>,
pub subdivisions: Option<u32>,
pub amplitude: Option<f32>,
pub source: Option<String>,
pub elevation_min: Option<f32>,
pub elevation_max: Option<f32>,
pub size: Option<f32>,
pub profile: Option<Vec<[f32; 2]>>,
pub corner_radius: Option<f32>,
pub corner_segments: Option<u32>,
pub lod_levels: u32,
pub lod_distances: Vec<f32>,
pub locator: Option<PayloadLocator>,
}Expand description
Geometry built by a named generator at compile time. Use for standard shapes.
For custom / hand-authored geometry use Mesh instead.
Built-in generators:
ProceduralMesh {
generator: "room".into(),
half_width: 16.0,
half_depth: 20.0,
ceiling_height: 3.5,
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
generator: StringBuilt-in generator name (required), e.g. room, box, cylinder,
sphere, terrain, heightfield, skybox, or extrude.
half_width: f32Half-width along X (room / box / plane / terrain), in world units.
half_depth: f32Half-depth along Z (room / box / plane / terrain), in world units.
ceiling_height: f32Ceiling height for the room generator, in world units.
half_extents: Option<[f32; 3]>Half-extents [x, y, z] for the box generator.
radius: Option<f32>Radius for the cylinder and sphere generators.
height: Option<f32>Height for the cylinder and extrude generators.
segments: Option<u32>Number of radial segments around the cylinder and sphere generators.
rings: Option<u32>Number of horizontal rings on the sphere generator.
subdivisions: Option<u32>Grid subdivisions for the terrain and heightfield generators. Higher
is more detailed.
amplitude: Option<f32>Maximum height variation for the terrain generator, in world units.
source: Option<String>Path to a grayscale heightmap image for the heightfield generator.
elevation_min: Option<f32>Height mapped to black pixels in the heightfield source, in world units.
elevation_max: Option<f32>Height mapped to white pixels in the heightfield source, in world units.
size: Option<f32>Half-extent on all axes for the skybox generator, in world units.
Keep it below the camera’s far plane so the sky is not clipped.
profile: Option<Vec<[f32; 2]>>2D outline [[x, z], ...] extruded by the extrude generator.
corner_radius: Option<f32>Corner-rounding radius for the extrude generator. 0 keeps sharp corners.
corner_segments: Option<u32>Number of segments used to round each corner in the extrude generator.
lod_levels: u32Number of level-of-detail versions to generate, including the original.
1 (the default) generates none; values are clamped to [1, 8].
lod_distances: Vec<f32>Camera distances at which to switch to each lower-detail version; length
should be lod_levels - 1. Empty lets the build choose defaults.
locator: Option<PayloadLocator>Injected at load time from the compiled blob payload.
Trait Implementations§
Source§impl Clone for ProceduralMesh
impl Clone for ProceduralMesh
Source§fn clone(&self) -> ProceduralMesh
fn clone(&self) -> ProceduralMesh
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for ProceduralMesh
impl Component for ProceduralMesh
Source§const NAME: &'static str = "ProceduralMesh"
const NAME: &'static str = "ProceduralMesh"
Source§fn inject_locator(&mut self, locator: PayloadLocator)
fn inject_locator(&mut self, locator: PayloadLocator)
Source§fn inject_name(&mut self, id: AssetId)
fn inject_name(&mut self, id: AssetId)
Source§fn from_baked(bytes: &[u8]) -> Result<ProceduralMesh, CnResult>
fn from_baked(bytes: &[u8]) -> Result<ProceduralMesh, CnResult>
Source§impl ComponentSlot for ProceduralMesh
impl ComponentSlot for ProceduralMesh
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.Source§fn slot(s: &ComponentStorage) -> &Column<ProceduralMesh>
fn slot(s: &ComponentStorage) -> &Column<ProceduralMesh>
Source§fn slot_mut(s: &mut ComponentStorage) -> &mut Column<ProceduralMesh>
fn slot_mut(s: &mut ComponentStorage) -> &mut Column<ProceduralMesh>
Source§impl Debug for ProceduralMesh
impl Debug for ProceduralMesh
Source§impl Default for ProceduralMesh
impl Default for ProceduralMesh
Source§fn default() -> ProceduralMesh
fn default() -> ProceduralMesh
Source§impl<'de> Deserialize<'de> for ProceduralMeshwhere
ProceduralMesh: Default,
impl<'de> Deserialize<'de> for ProceduralMeshwhere
ProceduralMesh: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProceduralMesh, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProceduralMesh, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<ProceduralMesh> for ComponentAsset
impl From<ProceduralMesh> for ComponentAsset
Source§fn from(c: ProceduralMesh) -> ComponentAsset
fn from(c: ProceduralMesh) -> ComponentAsset
Source§impl PartialEq for ProceduralMesh
impl PartialEq for ProceduralMesh
impl RuntimeComponent for ProceduralMesh
Source§impl Serialize for ProceduralMesh
impl Serialize for ProceduralMesh
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ProceduralMesh
Auto Trait Implementations§
impl Freeze for ProceduralMesh
impl RefUnwindSafe for ProceduralMesh
impl Send for ProceduralMesh
impl Sync for ProceduralMesh
impl Unpin for ProceduralMesh
impl UnsafeUnpin for ProceduralMesh
impl UnwindSafe for ProceduralMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().