Struct SkeletalPlayer
pub struct SkeletalPlayer { /* private fields */ }Expand description
Buffers are allocated once on validated scene admission, never on advance. Geometry stays in the authored bind frame; output can receive a uniform orbit transform without altering the rig or losing attachment alignment.
Implementations§
§impl SkeletalPlayer
impl SkeletalPlayer
pub fn from_section<S>(
section: &S,
positions: &[[f32; 3]],
normals: &[[f32; 3]],
uv: &[[f32; 2]],
indices: &[u32],
) -> Result<SkeletalPlayer, PlayerError>where
S: SkeletalSectionSource + ?Sized,
pub fn from_section<S>(
section: &S,
positions: &[[f32; 3]],
normals: &[[f32; 3]],
uv: &[[f32; 2]],
indices: &[u32],
) -> Result<SkeletalPlayer, PlayerError>where
S: SkeletalSectionSource + ?Sized,
Builds a player from a skeletal section + mesh attributes with the default 42 MiB resident budget; validates vertex/index/normal inputs and fails closed (InvalidInput/BudgetExceeded).
pub fn from_section_with_budget<S>(
section: &S,
positions: &[[f32; 3]],
normals: &[[f32; 3]],
uv: &[[f32; 2]],
indices: &[u32],
resident_budget: usize,
) -> Result<SkeletalPlayer, PlayerError>where
S: SkeletalSectionSource + ?Sized,
pub fn from_section_with_budget<S>(
section: &S,
positions: &[[f32; 3]],
normals: &[[f32; 3]],
uv: &[[f32; 2]],
indices: &[u32],
resident_budget: usize,
) -> Result<SkeletalPlayer, PlayerError>where
S: SkeletalSectionSource + ?Sized,
As from_section with an explicit caller byte budget — the admission pass counts borrowed inputs plus encoded section size and refuses before allocating beyond either bound.
pub fn allocated_bytes(&self) -> usize
pub fn allocated_bytes(&self) -> usize
Estimated resident bytes for joints, clips, tracks, keys, fit data — tracked against the 42 MiB budget.
pub fn set_body_fit<F>(
&mut self,
fit: &F,
min: [f32; 3],
max: [f32; 3],
) -> Result<(), PlayerError>where
F: BodyFitSource + ?Sized,
pub fn set_body_fit<F>(
&mut self,
fit: &F,
min: [f32; 3],
max: [f32; 3],
) -> Result<(), PlayerError>where
F: BodyFitSource + ?Sized,
Applies a BodyFitSource inside [min,max] bounds; validates all scale fields are finite (≤100) and hidden-key payloads bounded (128 keys / 4 KiB); identity fit clears the override. Fails closed on BudgetExceeded.
pub fn set_output_frame(
&mut self,
origin: [f32; 3],
scale: f32,
) -> Result<(), PlayerError>
pub fn set_output_frame( &mut self, origin: [f32; 3], scale: f32, ) -> Result<(), PlayerError>
Sets world origin/scale; rejects non-finite or out-of-range values.
pub fn set_root(&mut self, root: Motor) -> Result<(), PlayerError>
pub fn set_root(&mut self, root: Motor) -> Result<(), PlayerError>
Sets the root Motor transform; InvalidInput on a non-unit/invalid motor.
pub fn set_joint_delta(
&mut self,
id: u64,
delta: Motor,
) -> Result<(), PlayerError>
pub fn set_joint_delta( &mut self, id: u64, delta: Motor, ) -> Result<(), PlayerError>
Persistent local control delta, composed after the sampled clip pose. Wheels, steering and authored constraints use the same skinning path.
pub fn select_clip(
&mut self,
id: u64,
fade_seconds: f64,
) -> Result<(), PlayerError>
pub fn select_clip( &mut self, id: u64, fade_seconds: f64, ) -> Result<(), PlayerError>
Switches to clip id with fade_seconds blend; no-op when already active (still validates fade range); delegates to restart_clip otherwise.
pub fn restart_clip(
&mut self,
id: u64,
fade_seconds: f64,
) -> Result<(), PlayerError>
pub fn restart_clip( &mut self, id: u64, fade_seconds: f64, ) -> Result<(), PlayerError>
Restarts clip id at t=0, snapshotting current pose for the fade_seconds transition (≤10 s); UnknownClip when id is not registered.
pub fn seek(&mut self, time: f64) -> Result<(), PlayerError>
pub fn seek(&mut self, time: f64) -> Result<(), PlayerError>
Deterministic fixture/replay positioning, without a wall-clock source.
pub fn advance_pose_only(
&mut self,
dt_seconds: f64,
) -> Result<PlaybackReceipt, PlayerError>
pub fn advance_pose_only( &mut self, dt_seconds: f64, ) -> Result<PlaybackReceipt, PlayerError>
Evaluates hierarchical joint Motors and updates the GPU dual-quaternion
skinning palette (current + prev for TAA motion vectors) with zero heap
allocation and without executing the CPU per-vertex skinning loop.
pub fn advance_pose_only_with_mode(
&mut self,
dt_seconds: f64,
reduced_motion: bool,
) -> Result<PlaybackReceipt, PlayerError>
pub fn advance_pose_only_with_mode( &mut self, dt_seconds: f64, reduced_motion: bool, ) -> Result<PlaybackReceipt, PlayerError>
As Self::advance_pose_only, with an explicit reduced_motion flag.
pub fn advance_pose_only_with_policy(
&mut self,
dt_seconds: f64,
reduced_motion: bool,
policy: PoseTimePolicy,
) -> Result<PlaybackReceipt, PlayerError>
pub fn advance_pose_only_with_policy( &mut self, dt_seconds: f64, reduced_motion: bool, policy: PoseTimePolicy, ) -> Result<PlaybackReceipt, PlayerError>
Explicit closed-interval sampling avoids wrapping a requested final contact boundary to the first pose. Stored clip metadata is unchanged.
pub fn advance(
&mut self,
dt_seconds: f64,
reduced_motion: bool,
) -> Result<PlaybackReceipt, PlayerError>
pub fn advance( &mut self, dt_seconds: f64, reduced_motion: bool, ) -> Result<PlaybackReceipt, PlayerError>
Samples and deforms from immutable bind data, avoiding accumulated drift. Reduced motion selects the authored first pose and disables transitions.
pub fn advance_with_policy(
&mut self,
dt_seconds: f64,
reduced_motion: bool,
policy: PoseTimePolicy,
) -> Result<PlaybackReceipt, PlayerError>
pub fn advance_with_policy( &mut self, dt_seconds: f64, reduced_motion: bool, policy: PoseTimePolicy, ) -> Result<PlaybackReceipt, PlayerError>
The same policy is used for pose evaluation and skinning. Hosts with a separate contact pass must select it consistently for both phases.
pub fn gpu_motor_palette(&self) -> &[GpuJointMotorPair]
pub fn gpu_motor_palette(&self) -> &[GpuJointMotorPair]
Current GPU dual-quaternion skinning motor palette (current_r/d + prev_r/d).
pub fn world_motors(&self) -> &[Motor]
pub fn world_motors(&self) -> &[Motor]
Current world-space joint Motors.
pub fn skinning_palette(&self) -> &[Motor]
pub fn skinning_palette(&self) -> &[Motor]
Current skinning Motor palette ($M_{\text{world}} \circ M_{\text{inv_bind}}$).
pub fn prev_skinning_palette(&self) -> &[Motor]
pub fn prev_skinning_palette(&self) -> &[Motor]
Previous frame’s skinning Motor palette.
pub fn attachment(&self, joint_id: u64) -> Option<Motor>
pub fn attachment(&self, joint_id: u64) -> Option<Motor>
Attachment globals are in authored world space, as are rig roots.
Auto Trait Implementations§
impl Freeze for SkeletalPlayer
impl RefUnwindSafe for SkeletalPlayer
impl Send for SkeletalPlayer
impl Sync for SkeletalPlayer
impl Unpin for SkeletalPlayer
impl UnsafeUnpin for SkeletalPlayer
impl UnwindSafe for SkeletalPlayer
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more