Skip to content

Class uipc::constitution::AffineBodyRevoluteJoint

ClassList > uipc > constitution > AffineBodyRevoluteJoint

Inherits the following classes: uipc::constitution::InterAffineBodyConstitution

Public Types

Type Name
typedef std::tuple< S< geometry::SimplicialComplexSlot >, S< geometry::SimplicialComplexSlot > > SlotTuple

Public Functions

Type Name
AffineBodyRevoluteJoint (const Json & config=default_config())
void apply_to (geometry::SimplicialComplex & edges, span< S< geometry::SimplicialComplexSlot > > l_geo_slots, span< S< geometry::SimplicialComplexSlot > > r_geo_slots, Float strength_ratio=Float{100})
Apply revolute joint to edges connecting affine bodies (single-instance mode).
void apply_to (geometry::SimplicialComplex & edges, span< S< geometry::SimplicialComplexSlot > > l_geo_slots, span< IndexT > l_instance_ids, span< S< geometry::SimplicialComplexSlot > > r_geo_slots, span< IndexT > r_instance_ids, span< Float > strength_ratios)
Apply revolute joint to edges connecting affine bodies (multi-instance mode).
geometry::SimplicialComplex create_geometry (span< const Vector3 > position0s, span< const Vector3 > position1s, span< S< geometry::SimplicialComplexSlot > > l_geo_slots, span< IndexT > l_instance_ids, span< S< geometry::SimplicialComplexSlot > > r_geo_slots, span< IndexT > r_instance_ids, span< Float > strength_ratios)
Create revolute joint geometry with world-space endpoint positions.
geometry::SimplicialComplex create_geometry (span< const Vector3 > l_position0, span< const Vector3 > l_position1, span< const Vector3 > r_position0, span< const Vector3 > r_position1, span< S< geometry::SimplicialComplexSlot > > l_geo_slots, span< IndexT > l_instance_ids, span< S< geometry::SimplicialComplexSlot > > r_geo_slots, span< IndexT > r_instance_ids, span< Float > strength_ratios)
Create revolute joint geometry with local-space endpoint positions.
virtual ~AffineBodyRevoluteJoint ()

Public Functions inherited from uipc::constitution::IConstitution

See uipc::constitution::IConstitution

Type Name
std::string_view name () noexcept const
std::string_view type () noexcept const
U64 uid () noexcept const
const builtin::UIDInfo & uid_info () noexcept const
virtual ~IConstitution () = default

Public Static Functions

Type Name
Json default_config ()

Protected Functions inherited from uipc::constitution::IConstitution

See uipc::constitution::IConstitution

Type Name
virtual U64 get_uid () noexcept const = 0

Public Types Documentation

typedef SlotTuple

using uipc::constitution::AffineBodyRevoluteJoint::SlotTuple =  std::tuple<S<geometry::SimplicialComplexSlot>, S<geometry::SimplicialComplexSlot> >;

Public Functions Documentation

function AffineBodyRevoluteJoint

uipc::constitution::AffineBodyRevoluteJoint::AffineBodyRevoluteJoint (
    const Json & config=default_config()
) 

function apply_to [1/2]

Apply revolute joint to edges connecting affine bodies (single-instance mode).

void uipc::constitution::AffineBodyRevoluteJoint::apply_to (
    geometry::SimplicialComplex & edges,
    span< S< geometry::SimplicialComplexSlot > > l_geo_slots,
    span< S< geometry::SimplicialComplexSlot > > r_geo_slots,
    Float strength_ratio=Float{100}
) 

This method assumes each geometry has exactly one instance (instance 0). All joints use the same strength ratio.

Parameters:

  • edges The simplicial complex containing the edges representing the joints.
  • l_geo_slots Left geometry slots for each joint.
  • r_geo_slots Right geometry slots for each joint.
  • strength_ratio The strength ratio of the joint constraint applied to all joints (default: 100).

function apply_to [2/2]

Apply revolute joint to edges connecting affine bodies (multi-instance mode).

void uipc::constitution::AffineBodyRevoluteJoint::apply_to (
    geometry::SimplicialComplex & edges,
    span< S< geometry::SimplicialComplexSlot > > l_geo_slots,
    span< IndexT > l_instance_ids,
    span< S< geometry::SimplicialComplexSlot > > r_geo_slots,
    span< IndexT > r_instance_ids,
    span< Float > strength_ratios
) 

This method supports geometries with multiple instances. Each joint can specify which instance of each geometry to connect, and can have its own strength ratio.

Parameters:

  • edges The simplicial complex containing the edges representing the joints.
  • l_geo_slots Left geometry slots for each joint.
  • l_instance_ids Instance IDs for the left geometries (must be in range [0, instances().size())).
  • r_geo_slots Right geometry slots for each joint.
  • r_instance_ids Instance IDs for the right geometries (must be in range [0, instances().size())).
  • strength_ratios The strength ratio for each joint (one per edge).

function create_geometry [1/2]

Create revolute joint geometry with world-space endpoint positions.

geometry::SimplicialComplex uipc::constitution::AffineBodyRevoluteJoint::create_geometry (
    span< const Vector3 > position0s,
    span< const Vector3 > position1s,
    span< S< geometry::SimplicialComplexSlot > > l_geo_slots,
    span< IndexT > l_instance_ids,
    span< S< geometry::SimplicialComplexSlot > > r_geo_slots,
    span< IndexT > r_instance_ids,
    span< Float > strength_ratios
) 

Builds a SimplicialComplex with 2*N vertices and N edges. Writes vertices.position from position0s/position1s. Does not write local position attributes.


function create_geometry [2/2]

Create revolute joint geometry with local-space endpoint positions.

geometry::SimplicialComplex uipc::constitution::AffineBodyRevoluteJoint::create_geometry (
    span< const Vector3 > l_position0,
    span< const Vector3 > l_position1,
    span< const Vector3 > r_position0,
    span< const Vector3 > r_position1,
    span< S< geometry::SimplicialComplexSlot > > l_geo_slots,
    span< IndexT > l_instance_ids,
    span< S< geometry::SimplicialComplexSlot > > r_geo_slots,
    span< IndexT > r_instance_ids,
    span< Float > strength_ratios
) 

Builds a SimplicialComplex with N edges. Writes local position attributes (l_position0, l_position1, r_position0, r_position1) on edges. Does not write vertices.position.


function ~AffineBodyRevoluteJoint

virtual uipc::constitution::AffineBodyRevoluteJoint::~AffineBodyRevoluteJoint () 

Public Static Functions Documentation

function default_config

static Json uipc::constitution::AffineBodyRevoluteJoint::default_config () 


The documentation for this class was generated from the following file include/uipc/constitution/affine_body_revolute_joint.h