Struct rusty_spine::IkConstraint

source ·
pub struct IkConstraint { /* private fields */ }
Expand description

Implementations§

source§

impl IkConstraint

source

pub fn update(&self)

Applies the constraint to the constrained bones.

source

pub fn set_to_setup_pose(&self)

source

pub fn data(&self) -> CTmpRef<'_, Self, IkConstraintData>

The IK constraint’s setup pose data.

source

pub fn data_mut(&mut self) -> CTmpMut<'_, Self, IkConstraintData>

source

pub fn active(&self) -> bool

source

pub fn bend_direction(&self) -> i32

For two bone IK, controls the bend direction of the IK bones, either 1 or -1.

source

pub fn set_bend_direction(&mut self, value: i32)

source

pub fn compress(&self) -> bool

For one bone IK, when true and the target is too close, the bone is scaled to reach it.

source

pub fn set_compress(&mut self, value: bool)

source

pub fn mix(&self) -> f32

A percentage (0-1) that controls the mix between the constrained and unconstrained rotation.

For two bone IK: if the parent bone has local nonuniform scale, the child bone’s local Y translation is set to 0.

source

pub fn set_mix(&mut self, value: f32)

source

pub fn softness(&self) -> f32

For two bone IK, the target bone’s distance from the maximum reach of the bones where rotation begins to slow. The bones will not straighten completely until the target is this far out of range.

source

pub fn set_softness(&mut self, value: f32)

source

pub fn stretch(&self) -> bool

When true and the target is out of range, the parent bone is scaled to reach it.

For two bone IK: 1) the child bone’s local Y translation is set to 0, 2) stretch is not applied if softness is > 0, and 3) if the parent bone has local nonuniform scale, stretch is not applied.

source

pub fn set_stretch(&mut self, value: bool)

source

pub fn bones_count(&self) -> usize

source

pub fn bones(&self) -> CTmpPtrIterator<'_, IkConstraint, Bone, spBone>

The bones that will be modified by this IK constraint.

source

pub fn bone_at_index(&self, index: usize) -> Option<CTmpRef<'_, Self, Bone>>

source

pub fn target(&self) -> CTmpRef<'_, Self, Bone>

The bone that is the IK target.

source

pub fn target_mut(&mut self) -> CTmpMut<'_, Self, Bone>

source

pub const fn c_ptr(&self) -> *mut spIkConstraint

Get a pointer to the underlying spine-c type.

Trait Implementations§

source§

impl Debug for IkConstraint

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl NewFromPtr<spIkConstraint> for IkConstraint

source§

unsafe fn new_from_ptr(c_slot: *mut spIkConstraint) -> Self

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.