pub trait TrajectoryModel: Send + Sync {
// Required methods
fn spawned(&self, from: Time, to: Time) -> Range<u64> ⓘ;
fn birth_time(&self, index: u64) -> Time;
fn state(
&self,
index: u64,
age_seconds: f32,
) -> Result<Option<Particle>, ValidationError>;
// Provided methods
fn duration(&self) -> Option<Duration> { ... }
fn analytic_upload(
&self,
_age_seconds: f32,
_primitive: InstanceKind,
_align_to_velocity: bool,
) -> Result<Option<AnalyticInstanceUpload>, ValidationError> { ... }
fn analytic_bounds(
&self,
_age_seconds: f32,
) -> Result<Option<Rect>, ValidationError> { ... }
}Expand description
A whole random-access particle trajectory, not separately composable forces.
Required Methods§
Sourcefn birth_time(&self, index: u64) -> Time
fn birth_time(&self, index: u64) -> Time
Exact integer-tick birth time of one stable ID.
Provided Methods§
Sourcefn duration(&self) -> Option<Duration>
fn duration(&self) -> Option<Duration>
Optional finite natural duration for timeline registration.
Sourcefn analytic_upload(
&self,
_age_seconds: f32,
_primitive: InstanceKind,
_align_to_velocity: bool,
) -> Result<Option<AnalyticInstanceUpload>, ValidationError>
fn analytic_upload( &self, _age_seconds: f32, _primitive: InstanceKind, _align_to_velocity: bool, ) -> Result<Option<AnalyticInstanceUpload>, ValidationError>
Optional seeded initial-state upload for supported random-access models. Custom models and unsupported precision retain the ordinary evaluated path.
Sourcefn analytic_bounds(
&self,
_age_seconds: f32,
) -> Result<Option<Rect>, ValidationError>
fn analytic_bounds( &self, _age_seconds: f32, ) -> Result<Option<Rect>, ValidationError>
Conservative extent of every particle center at this age, for models whose
Self::analytic_upload lets the GPU evaluate positions. Returning None keeps
the ordinary evaluated path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".