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<Self, CnResult>
fn from_baked(bytes: &[u8]) -> Result<Self, CnResult>
Source§impl ComponentSlot for ProceduralMesh
impl ComponentSlot for ProceduralMesh
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.