group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
physics::RagdollPbdJoint Struct Reference

One articulated joint in a PBD ragdoll skeleton. More...

#include <RagdollPbd.hpp>

Public Types

enum class  Kind : uint8_t { Point , Hinge , ConeTwist }

Public Attributes

entt::entity bodyA {entt::null}
 Parent.
entt::entity bodyB {entt::null}
 Child.
glm::vec3 localAnchorA {0.0f}
 Joint origin in parent local space.
glm::vec3 localAnchorB {0.0f}
 Joint origin in child local space.
Kind kind = Kind::Point
glm::vec3 axisLocalA {1.0f, 0.0f, 0.0f}
 Hinge / twist axis expressed in the parent's local frame.
float swingLimit = 1.4f
 Max half-cone angle for swing about the joint frame (radians).
float twistLimit = 0.8f
 Max ± twist angle for ConeTwist (radians).
float hingeMin = -1.5f
 Hinge angle bounds (radians). Used only when kind == Hinge.
float hingeMax = 0.05f

Detailed Description

One articulated joint in a PBD ragdoll skeleton.

Lifetime: one entity per joint, holds this single component. bodyA is the parent, bodyB the child. Anchors localAnchorA / localAnchorB are the joint origin in each body's local space — they MUST coincide in world space at all times (PBD enforces this).

Member Enumeration Documentation

◆ Kind

enum class physics::RagdollPbdJoint::Kind : uint8_t
strong
Enumerator
Point 

Ball-and-socket. Cone limit applied (swingLimit).

Hinge 

1-DOF rotation about axisLocalA. Clamped to [hingeMin, hingeMax].

ConeTwist 

Swing limit (cone) + twist limit about axisLocalA.

Member Data Documentation

◆ axisLocalA

glm::vec3 physics::RagdollPbdJoint::axisLocalA {1.0f, 0.0f, 0.0f}

Hinge / twist axis expressed in the parent's local frame.

◆ bodyA

entt::entity physics::RagdollPbdJoint::bodyA {entt::null}

Parent.

◆ bodyB

entt::entity physics::RagdollPbdJoint::bodyB {entt::null}

Child.

◆ hingeMax

float physics::RagdollPbdJoint::hingeMax = 0.05f

◆ hingeMin

float physics::RagdollPbdJoint::hingeMin = -1.5f

Hinge angle bounds (radians). Used only when kind == Hinge.

◆ kind

Kind physics::RagdollPbdJoint::kind = Kind::Point

◆ localAnchorA

glm::vec3 physics::RagdollPbdJoint::localAnchorA {0.0f}

Joint origin in parent local space.

◆ localAnchorB

glm::vec3 physics::RagdollPbdJoint::localAnchorB {0.0f}

Joint origin in child local space.

◆ swingLimit

float physics::RagdollPbdJoint::swingLimit = 1.4f

Max half-cone angle for swing about the joint frame (radians).

Point and ConeTwist consult this; Hinge ignores it.

◆ twistLimit

float physics::RagdollPbdJoint::twistLimit = 0.8f

Max ± twist angle for ConeTwist (radians).


The documentation for this struct was generated from the following file: