Struct SwingTwistConeConstraint
pub struct SwingTwistConeConstraint {
pub twist_axis: [f32; 3],
pub max_swing_y_rad: f32,
pub max_swing_z_rad: f32,
pub min_twist_rad: f32,
pub max_twist_rad: f32,
pub twist_coupling_narrowing: f32,
pub polygon_swing_rad: [[f32; 2]; 16],
pub polygon_vertex_count: u8,
pub has_translation_bounds: bool,
pub translation_min_m: [f32; 3],
pub translation_max_m: [f32; 3],
}Expand description
Coupled quaternion swing-twist reach cone with optional polygonal swing boundary, swing-dependent twist narrowing $[\tau_{\min}(\mathbf{s}), \tau_{\max}(\mathbf{s})]$, and synovial translation bounds.
Fields§
§twist_axis: [f32; 3]Unit twist axis along the child bone in parent/neutral space.
max_swing_y_rad: f32Maximum swing half-angle about local Y (radians, >= 0).
max_swing_z_rad: f32Maximum swing half-angle about local Z (radians, >= 0).
min_twist_rad: f32Minimum axial twist angle at neutral swing (radians, <= 0).
max_twist_rad: f32Maximum axial twist angle at neutral swing (radians, >= 0).
twist_coupling_narrowing: f32Fraction in [0.0, 0.95] by which twist bounds narrow at normalized swing eccentricity e = 1.
polygon_swing_rad: [[f32; 2]; 16]Optional convex polygon vertices (swing_y_rad, swing_z_rad) in tangent space when polygon_vertex_count >= 3.
polygon_vertex_count: u8Number of active vertices in polygon_swing_rad (0 uses elliptical (max_swing_y_rad, max_swing_z_rad)).
has_translation_bounds: boolEnables clamping of synovial joint translation inside [translation_min_m, translation_max_m].
translation_min_m: [f32; 3]Minimum local translation in meters.
translation_max_m: [f32; 3]Maximum local translation in meters.
Implementations§
§impl SwingTwistConeConstraint
impl SwingTwistConeConstraint
pub fn elliptical(
twist_axis: [f32; 3],
max_swing_y_rad: f32,
max_swing_z_rad: f32,
min_twist_rad: f32,
max_twist_rad: f32,
) -> SwingTwistConeConstraint
pub fn elliptical( twist_axis: [f32; 3], max_swing_y_rad: f32, max_swing_z_rad: f32, min_twist_rad: f32, max_twist_rad: f32, ) -> SwingTwistConeConstraint
Creates an elliptical swing-twist reach cone constraint.
pub fn with_twist_coupling(self, narrowing: f32) -> SwingTwistConeConstraint
pub fn with_twist_coupling(self, narrowing: f32) -> SwingTwistConeConstraint
Sets the swing-coupled twist narrowing fraction in [0.0, 0.95].
pub fn with_polygon_swing(
self,
vertices: &[[f32; 2]],
) -> Result<SwingTwistConeConstraint, SkeletalError>
pub fn with_polygon_swing( self, vertices: &[[f32; 2]], ) -> Result<SwingTwistConeConstraint, SkeletalError>
Replaces the elliptical swing boundary with a convex polygon in (swing_y, swing_z) radians.
pub fn with_translation_bounds(
self,
min_m: [f32; 3],
max_m: [f32; 3],
) -> SwingTwistConeConstraint
pub fn with_translation_bounds( self, min_m: [f32; 3], max_m: [f32; 3], ) -> SwingTwistConeConstraint
Enables synovial joint translation bounds in meters.
pub fn swing_coupled_twist_bounds(
&self,
swing_eccentricity_01: f32,
laxity_scale: f32,
) -> (f32, f32)
pub fn swing_coupled_twist_bounds( &self, swing_eccentricity_01: f32, laxity_scale: f32, ) -> (f32, f32)
Computes effective (min_twist_rad, max_twist_rad) at normalized swing eccentricity e in [0, 1].
pub fn project_quaternion(&self, q: [f32; 4], laxity_scale: f32) -> [f32; 4]
pub fn project_quaternion(&self, q: [f32; 4], laxity_scale: f32) -> [f32; 4]
Projects quaternion q ([w, x, y, z]) onto this swing-twist cone with zero heap allocation.
pub fn is_quaternion_within(
&self,
q: [f32; 4],
laxity_scale: f32,
tol_rad: f32,
) -> bool
pub fn is_quaternion_within( &self, q: [f32; 4], laxity_scale: f32, tol_rad: f32, ) -> bool
Returns true if q lies within tol_rad geodesic distance of its projection.
pub fn project_motor(&self, local_motor: Motor, laxity_scale: f32) -> Motor
pub fn project_motor(&self, local_motor: Motor, laxity_scale: f32) -> Motor
Projects a local PGA Motor onto this swing-twist cone and optional synovial translation bounds.
Trait Implementations§
§impl Clone for SwingTwistConeConstraint
impl Clone for SwingTwistConeConstraint
§fn clone(&self) -> SwingTwistConeConstraint
fn clone(&self) -> SwingTwistConeConstraint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SwingTwistConeConstraint
§impl Debug for SwingTwistConeConstraint
impl Debug for SwingTwistConeConstraint
§impl Default for SwingTwistConeConstraint
impl Default for SwingTwistConeConstraint
§fn default() -> SwingTwistConeConstraint
fn default() -> SwingTwistConeConstraint
§impl PartialEq for SwingTwistConeConstraint
impl PartialEq for SwingTwistConeConstraint
impl StructuralPartialEq for SwingTwistConeConstraint
Auto Trait Implementations§
impl Freeze for SwingTwistConeConstraint
impl RefUnwindSafe for SwingTwistConeConstraint
impl Send for SwingTwistConeConstraint
impl Sync for SwingTwistConeConstraint
impl Unpin for SwingTwistConeConstraint
impl UnsafeUnpin for SwingTwistConeConstraint
impl UnwindSafe for SwingTwistConeConstraint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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