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

Single-axis hinge — locks the bodies' anchors together AND constrains their relative rotation to a single axis. More...

#include <Joints.hpp>

Public Attributes

entt::entity bodyA {entt::null}
entt::entity bodyB {entt::null}
glm::vec3 localAnchorA {0.0f}
glm::vec3 localAnchorB {0.0f}
glm::vec3 localAxisA {0.0f, 0.0f, 1.0f}
 Hinge axis in A's local space.
glm::vec3 localAxisB {0.0f, 0.0f, 1.0f}
 Hinge axis in B's local space.
float minAngle = 0.0f
 Limit angles in radians.
float maxAngle = 0.0f
bool hasLimit = false
bool motorEnabled = false
 Motor — if enabled, drive angularVelocity toward targetAngularSpeed with at most maxMotorTorque.
float targetAngularSpeed = 0.0f
float maxMotorTorque = 0.0f
glm::vec3 accumulatedAnchorImpulse {0.0f}
glm::vec3 accumulatedAngularImpulse {0.0f}

Detailed Description

Single-axis hinge — locks the bodies' anchors together AND constrains their relative rotation to a single axis.

Optional swing limit (relative to body A's local-space rest orientation).

Member Data Documentation

◆ accumulatedAnchorImpulse

glm::vec3 physics::HingeJoint::accumulatedAnchorImpulse {0.0f}

◆ accumulatedAngularImpulse

glm::vec3 physics::HingeJoint::accumulatedAngularImpulse {0.0f}

◆ bodyA

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

◆ bodyB

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

◆ hasLimit

bool physics::HingeJoint::hasLimit = false

◆ localAnchorA

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

◆ localAnchorB

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

◆ localAxisA

glm::vec3 physics::HingeJoint::localAxisA {0.0f, 0.0f, 1.0f}

Hinge axis in A's local space.

◆ localAxisB

glm::vec3 physics::HingeJoint::localAxisB {0.0f, 0.0f, 1.0f}

Hinge axis in B's local space.

◆ maxAngle

float physics::HingeJoint::maxAngle = 0.0f

◆ maxMotorTorque

float physics::HingeJoint::maxMotorTorque = 0.0f

◆ minAngle

float physics::HingeJoint::minAngle = 0.0f

Limit angles in radians.

When minAngle == maxAngle, the joint is locked; when both are zero, no limit is applied.

◆ motorEnabled

bool physics::HingeJoint::motorEnabled = false

Motor — if enabled, drive angularVelocity toward targetAngularSpeed with at most maxMotorTorque.

◆ targetAngularSpeed

float physics::HingeJoint::targetAngularSpeed = 0.0f

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