Skip to main content

PhysicsConstraint

Trait PhysicsConstraint 

Source
pub trait PhysicsConstraint {
    // Required methods
    fn dof(&self) -> usize;
    fn positional_error(&self) -> Vec<Real> ;
    fn is_active(&self) -> bool;

    // Provided method
    fn compliance(&self) -> Real { ... }
}
Expand description

Trait for position/velocity-level constraints between bodies.

Required Methods§

Source

fn dof(&self) -> usize

Number of degrees of freedom constrained (1–6).

Source

fn positional_error(&self) -> Vec<Real>

Evaluate the positional violation of this constraint. Returns a slice of dof() scalar violations.

Source

fn is_active(&self) -> bool

Whether this constraint is currently active.

Provided Methods§

Source

fn compliance(&self) -> Real

Compliance of the constraint (XPBD softness). 0 = rigid.

Implementors§