Expand description
Built-in components. Every one is plain serde data plus an optional fields() listing for the inspector.
Re-exports§
pub use crate::audio::AudioSource;pub use crate::gui::UiElement;pub use crate::gui::UiKind;pub use crate::mesh_edit::EditableMesh;pub use crate::neural::NeuralAgent;pub use crate::animation::TransformAnimation;pub use crate::cloth::Cloth;pub use crate::gameplay::Lifetime;pub use crate::gameplay::Tags;pub use crate::gameplay::Visibility;pub use crate::grass::Grass;pub use crate::tree::Tree;pub use crate::tree::TreePart;pub use crate::decal::Decal;pub use crate::interaction::Slider;pub use crate::interaction::Switch;pub use crate::meshmod::MeshModifiers;pub use crate::meshmod::ModifierStateCell;pub use crate::paint::TexturePaint;pub use crate::particles::ParticleEmitter;pub use crate::skeletal::Animator;pub use crate::skeletal::AnimatorState;pub use crate::ik::CharacterIk;pub use crate::ragdoll::Ragdoll;pub use crate::modifiers::Bob;pub use crate::modifiers::ColorCycle;pub use crate::modifiers::Pulse;pub use crate::modifiers::Spin;pub use crate::modifiers::Wobble;pub use crate::tween::MoveTween;pub use crate::voxel::VoxelClouds;pub use crate::voxel::VoxelSmoke;pub use crate::water::VoxelWater;
Structs§
- Camera
- Perspective or orthographic scene camera. The first primary camera is selected for gameplay.
- Collider
- Collision shape.
sizeis the full extent: box = (w, h, d); sphere = diameter in x; capsule/cylinder = diameter in x and total height in y; mesh/hull = a multiplier on the model (MeshRenderer.mesh, a box ofsizeif it has none). Scaled by the entity’s world scale. Without a RigidBody on the entity or an ancestor it is static geometry. - Dynamic
Mesh - Geometry produced at run time by a system (cloth, smoke, grass…). Not saved in scenes.
Bump
versionwheneverdatachanges so the renderer re-uploads it. - Global
Transform - World-space matrix, recomputed every frame from
TransformandParent. - Grass
Chunk - Marks a chunk entity created for a grass patch.
- Joint
- Connects this entity’s RigidBody to another body (by entity name) or to the world if
targetis empty. The joint is attached where the bodies currently are, so place objects first. Fixed: weld at the current pose. Ball/Hinge: pivot atanchor(local to this entity). Spring:anchoris where the other end is attached, relative to this entity. - Light
- Directional, point or spot light with optional directional shadow casting.
- Mesh
Renderer - Static/procedural mesh appearance consumed by the renderer. Texture/shader paths are asset-relative or built-in procedural keys.
- Name
- Human-readable entity label. Names are not required to be unique.
- Parent
- Runtime link to the parent entity. Saved in scenes as an index, not as a component.
- Rigid
Body - Physics body configuration and per-step motion requests. Dynamic results are written back into Transform and velocity by Physics::step.
- Script
Slot - One attached native script type and its saved editable properties.
- Scripts
- Rust scripts attached to an entity (several allowed). Property values live in
props. - Shape
- Parametric mesh. When an entity has both
ShapeandMeshRenderer, the shape is what is drawn. - Transform
- Local translation, Euler rotation and scale relative to the parent.
- Transient
- Marks entities created by systems (e.g. grass chunks). They are hidden from the hierarchy, never saved in scenes and not pickable.
Enums§
- Body
Kind - Dynamic bodies respond to forces, Fixed bodies stay still, Kinematic bodies follow transforms.
- Joint
Kind - Fixed weld, freely rotating ball, limited hinge, or damped spring constraint.
- Light
Kind - Directional lights illuminate globally; point/spot lights have a finite range.
- Shape
Kind - Collider shapes. Primitives use full extents;
Meshis the exact triangles of the entity’s model (for static level geometry),Hullits convex hull (for moving props). - Shape
Type - Procedural mesh families. Cube/plane use size, round shapes use radii, and Rock uses seed.
Traits§
- Component
- Editor-visible component contract: identity, serde persistence and editable fields.
Built-ins are registered in both
register_allandcrate::registry::Registry. Script libraries may access built-ins but must not register custom unloadable storage.
Functions§
- active_
camera - The camera the game looks through: the first
primarycamera, else the first camera at all. - mesh_
key - The mesh key an entity is drawn with: dynamic geometry, else its
Shape, elseMeshRenderer.mesh. - register_
all - Creates the storage of every built-in component. Must run on every new
World. - set_
active_ camera - Makes
camerathe only primary camera (the one the game looks through).