pub struct IkSolver3D { /* private fields */ }Expand description
Stateless 3D Inverse Kinematics solver suite (Analytic 2-Bone, FABRIK, and cone-limited CCD).
Implementations§
Source§impl IkSolver3D
Analytic 2-Bone, FABRIK, and cone-constrained CCD inverse kinematics implementations for IkSolver3D.
impl IkSolver3D
Analytic 2-Bone, FABRIK, and cone-constrained CCD inverse kinematics implementations for IkSolver3D.
Sourcepub fn solve_two_bone(
root: Vec3,
upper_len: f32,
lower_len: f32,
target: Vec3,
pole_target: Vec3,
) -> IkTwoBoneResult
pub fn solve_two_bone( root: Vec3, upper_len: f32, lower_len: f32, target: Vec3, pole_target: Vec3, ) -> IkTwoBoneResult
Solves exact analytic 2-bone IK with a pole vector controlling the knee/elbow bend plane.
§Arguments
Vec3- Root joint world position (hip or shoulder).f32- Upper bone segment length.f32- Lower bone segment length.Vec3- Desired end-effector target position.Vec3- World-space pole vector hint controlling knee/elbow orientation.
§Returns
IkTwoBoneResult- Solved mid-joint, end-effector, bone rotations, and residual error.
Sourcepub fn solve_fabrik(
positions: &mut [Vec3],
lengths: &[f32],
target: Vec3,
tolerance: f32,
max_iterations: usize,
) -> IkChainResult
pub fn solve_fabrik( positions: &mut [Vec3], lengths: &[f32], target: Vec3, tolerance: f32, max_iterations: usize, ) -> IkChainResult
Solves a multi-bone chain in place using FABRIK (Forward And Backward Reaching IK).
§Arguments
&mut [Vec3]- Mutable world-space joint positions (len >= 2; index0stays pinned).&[f32]- Segment lengths of lengthpositions.len() - 1.Vec3- Desired end-effector target position.f32- Reach convergence tolerance in world units.usize- Maximum FABRIK forward-backward iterations.
§Returns
IkChainResult- Executed iteration count, residual error, and reach status.
Sourcepub fn solve_ccd(
positions: &mut [Vec3],
constraints: &[IkBoneConstraint],
target: Vec3,
tolerance: f32,
max_iterations: usize,
) -> IkChainResult
pub fn solve_ccd( positions: &mut [Vec3], constraints: &[IkBoneConstraint], target: Vec3, tolerance: f32, max_iterations: usize, ) -> IkChainResult
Solves a multi-bone chain in place using Cyclic Coordinate Descent (CCD) with angular cone limits.
§Arguments
&mut [Vec3]- Mutable world-space joint positions (len >= 2; index0stays pinned).&[IkBoneConstraint]- Optional angular cone constraints per joint (0..positions.len() - 1).Vec3- Desired end-effector target position.f32- Reach convergence tolerance in world units.usize- Maximum CCD sweep iterations.
§Returns
IkChainResult- Executed iteration count, residual error, and reach status.
Source§impl IkSolver3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl IkSolver3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_default_tolerance(&self) -> f32
pub fn get_mut_default_tolerance(&mut self) -> &mut f32
pub fn set_default_tolerance(&mut self, val: f32) -> &mut Self
Trait Implementations§
Source§impl Clone for IkSolver3D
impl Clone for IkSolver3D
impl Copy for IkSolver3D
Source§impl Debug for IkSolver3D
impl Debug for IkSolver3D
Source§impl Default for IkSolver3D
impl Default for IkSolver3D
Source§impl PartialEq for IkSolver3D
impl PartialEq for IkSolver3D
impl StructuralPartialEq for IkSolver3D
Auto Trait Implementations§
impl Forget for IkSolver3D
impl Freeze for IkSolver3D
impl Move for IkSolver3D
impl RefUnwindSafe for IkSolver3D
impl Send for IkSolver3D
impl Sync for IkSolver3D
impl Unpin for IkSolver3D
impl UnsafeUnpin for IkSolver3D
impl UnwindSafe for IkSolver3D
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