pub struct Assembly<B> { /* private fields */ }Expand description
Owned, bounded authoring plan; see the executable module recipes. At most 4096 bodies, 16384 total colliders, 32 children per body and 4096 joints. Storage grows on authoring; there is no steady-tick allocation promise.
Implementations§
Source§impl<B> Assembly<B>
impl<B> Assembly<B>
Sourcepub const fn new() -> Assembly<B>
pub const fn new() -> Assembly<B>
Empty plan. No storage is allocated until entries are staged.
Sourcepub fn add_body<C>(
&mut self,
body: impl Into<B>,
children: impl IntoIterator<Item = C>,
) -> Result<LocalBodyId, PhysicsError>
pub fn add_body<C>( &mut self, body: impl Into<B>, children: impl IntoIterator<Item = C>, ) -> Result<LocalBodyId, PhysicsError>
Stage an existing dimensional body and its ordered collider children. Count errors leave the plan unchanged; rejected inputs are dropped. Geometry/mass/dimension validation occurs at world preflight. Iteration stops after the first excess child, even for an unbounded iterator. Conversions and iterator/Drop panics are caller-code boundaries.
Sourcepub fn add_joint(
&mut self,
a: LocalBodyId,
b: LocalBodyId,
desc: impl Into<JointDesc>,
) -> Result<LocalJointId, PhysicsError>
pub fn add_joint( &mut self, a: LocalBodyId, b: LocalBodyId, desc: impl Into<JointDesc>, ) -> Result<LocalJointId, PhysicsError>
Stage a joint with assembly-local endpoints and ordinary local anchors.
Forward references are allowed; all endpoints/descriptors are validated
at insertion. None reference rotation captures insertion-time relative
body rotation, exactly as insert_joint does. Capacity errors retain the
plan; caller conversions and their panics occur before publication.
Sourcepub fn body_count(&self) -> usize
pub fn body_count(&self) -> usize
Staged body count; see the module recipe.
Sourcepub fn collider_count(&self) -> usize
pub fn collider_count(&self) -> usize
Staged collider count across all bodies; see the module recipe.
Sourcepub fn joint_count(&self) -> usize
pub fn joint_count(&self) -> usize
Staged joint count; see the module recipe.