pub struct SpringState3D {
pub position: [f64; 3],
pub velocity: [f64; 3],
pub target: [f64; 3],
}Expand description
3D Spring state (x, y, z) evaluated independently across components.
Fields§
§position: [f64; 3]§velocity: [f64; 3]§target: [f64; 3]Implementations§
Source§impl SpringState3D
impl SpringState3D
Sourcepub const fn new(
position: [f64; 3],
velocity: [f64; 3],
target: [f64; 3],
) -> Self
pub const fn new( position: [f64; 3], velocity: [f64; 3], target: [f64; 3], ) -> Self
Creates a new SpringState3D.
Sourcepub fn evaluate_at(
&self,
config: &SpringConfig,
t: f64,
) -> ([f64; 3], [f64; 3], bool)
pub fn evaluate_at( &self, config: &SpringConfig, t: f64, ) -> ([f64; 3], [f64; 3], bool)
Evaluate 3D spring state at t seconds.
Sourcepub fn step(&mut self, config: &SpringConfig, dt: f64) -> bool
pub fn step(&mut self, config: &SpringConfig, dt: f64) -> bool
Advance the 3D spring state by dt seconds.
Trait Implementations§
Source§impl Clone for SpringState3D
impl Clone for SpringState3D
impl Copy for SpringState3D
Source§impl Debug for SpringState3D
impl Debug for SpringState3D
Source§impl PartialEq for SpringState3D
impl PartialEq for SpringState3D
impl StructuralPartialEq for SpringState3D
Auto Trait Implementations§
impl Freeze for SpringState3D
impl RefUnwindSafe for SpringState3D
impl Send for SpringState3D
impl Sync for SpringState3D
impl Unpin for SpringState3D
impl UnsafeUnpin for SpringState3D
impl UnwindSafe for SpringState3D
Blanket Implementations§
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
Mutably borrows from an owned value. Read more