pub struct Prop {Show 16 fields
pub asset_id: AssetId,
pub model: Option<AssetId>,
pub mesh: Option<MeshHandle>,
pub material: Option<MaterialHandle>,
pub texture: Option<TextureHandle>,
pub position: [f32; 3],
pub rotation_deg: [f32; 3],
pub scale: [f32; 3],
pub collider: Option<PropCollider>,
pub interactable: bool,
pub pickup: bool,
pub parent: Option<AssetId>,
pub scene: Option<AssetId>,
pub prefab: String,
pub cull_distance: f32,
pub is_held: bool,
}Expand description
A scene object: places geometry at a world-space transform.
Reference either a Model (multi-mesh) or a single
Mesh/ProceduralMesh. model takes precedence
when both are set.
Rotation notes:
rotation_deg[0]= pitch (tilt forward/back)rotation_deg[1]= yaw (spin on vertical axis), most commonrotation_deg[2]= roll (tilt side-to-side)
Prop {
position: [4.0, 0.4, -8.0],
..Default::default()
};Fields§
§asset_id: AssetIdAsset identity; injected via inject_name. Not part of args.
model: Option<AssetId>A Model asset. When set, the prop renders all sub-meshes of
that model (each with its own material) sharing this prop’s transform.
Takes precedence over mesh and material.
mesh: Option<MeshHandle>A Mesh or ProceduralMesh asset this prop
renders. Used when model is unset.
material: Option<MaterialHandle>A Material to use for this prop. When set it takes
precedence over texture and provides the albedo texture plus the
lighting parameters (roughness, metallic, tint, emissive). Used when
model is unset.
texture: Option<TextureHandle>A Texture to use for this prop. Older field: ignored when
material is set. Unset uses the first declared texture (or a white
fallback).
position: [f32; 3]World-space position [x, y, z].
rotation_deg: [f32; 3]Euler rotation in degrees [pitch, yaw, roll], applied in YXZ order (yaw first so that rotating around the vertical axis is intuitive).
scale: [f32; 3]Non-uniform scale [x, y, z]. Defaults to [1, 1, 1].
collider: Option<PropCollider>Optional collision volume. When present, the prop blocks the player; when absent the prop is non-solid.
interactable: boolWhen true, the player can interact with this prop: pressing the interact key (E) while close and facing it triggers its rotation behaviour.
pickup: boolWhen true, the player can pick up and carry this prop with the interact key (E). A companion PropBody must also be declared so the prop falls correctly after being dropped.
parent: Option<AssetId>Another Prop whose world transform this prop inherits. When set,
position, rotation_deg, and scale are relative to the parent’s
world transform. The parent must be declared in the same world; circular
chains are treated as an error.
scene: Option<AssetId>Scene this prop belongs to. Resolved automatically from the
naming convention (a prop named <scene>_* belongs to scene <scene>);
you don’t set this directly. None means the prop is visible in every
scene. Used by scene switches for per-scene visibility.
prefab: StringName of a Prefab to instantiate at this prop’s transform. When
set, it expands into concrete child props and lights, replacing this
prop. Cannot be combined with model or mesh.
cull_distance: f32Optional view-distance cutoff in world units. When > 0 the prop is hidden once the camera is further than this from it. 0 (default) keeps the prop visible at any distance.
is_held: boolSet at runtime while the prop is being carried. Not serialised. While true, PhysicsSystem drives the prop as a kinematic body that follows the camera instead of simulating it dynamically.
Trait Implementations§
Source§impl Component for Prop
impl Component for Prop
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§fn inject_locator(&mut self, _locator: PayloadLocator)
fn inject_locator(&mut self, _locator: PayloadLocator)
Source§impl ComponentSlot for Prop
impl ComponentSlot for Prop
Source§const DISCRIMINANT: u8
const DISCRIMINANT: u8
ComponentId.