physics
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
HingeJoint Class Reference

Hinge Joint, a position constraint, and an orthogonality constraint. More...

#include "hinge_joint.hpp"

Public Member Functions

 HingeJoint (unsigned int indexA, vec3 anchorA, unsigned int indexB, vec3 anchorB, unsigned int axisA, unsigned int axisB, unsigned int axisC)
 Hinge Joint, a position constraint, and an orthogonality constraint. More...
 
int applyImpulse ()
 
int preStep (float dt)
 

Public Attributes

vec3 bias = vec3(0,0,0)
 
mat3 effective_mass = mat3(0.0f)
 
vec3 P = vec3(0,0,0)
 
vec2 bias2 = vec3(0,0,0)
 
mat2 effective_mass2 = mat2(0.0f)
 
vec2 P2 = vec2(0,0)
 
RigidBodybody_a
 
RigidBodybody_b
 
vec3 anchor_a
 
vec3 anchor_b
 
vec3 anchor_a_ws
 
vec3 anchor_b_ws
 
float dt = 0.02f
 
unsigned int body_a_index
 
unsigned int body_b_index
 
unsigned int axisA
 
unsigned int axisB
 
unsigned int axisC
 
bool unset = true
 

Static Public Attributes

static vector< HingeJoint * > allJoints
 

Detailed Description

Hinge Joint, a position constraint, and an orthogonality constraint.

Constructor & Destructor Documentation

◆ HingeJoint()

HingeJoint::HingeJoint ( unsigned int  indexA,
vec3  anchorA,
unsigned int  indexB,
vec3  anchorB,
unsigned int  axisA,
unsigned int  axisB,
unsigned int  axisC 
)

Hinge Joint, a position constraint, and an orthogonality constraint.

Parameters
[in]indexAID of the first RigidBody.
[in]anchorALocal position on the first RigidBody.
[in]indexBID of the second RigidBody.
[in]anchorBLocal position on the second RigidBody.
[in]axisAVector on the first RigidBody. (0, 1 or 2, for x,y,z respectively).
[in]axisBFirst Orthogonal vector on the second RigidBody. (0, 1 or 2, for x,y,z respectively).
[in]axisCSecond Orthgonal vector on the second RigidBody. (0, 1 or 2, for x,y,z respectively).

Member Function Documentation

◆ applyImpulse()

int HingeJoint::applyImpulse ( )

◆ preStep()

int HingeJoint::preStep ( float  dt)

Member Data Documentation

◆ allJoints

vector<HingeJoint*> HingeJoint::allJoints
static

◆ anchor_a

vec3 HingeJoint::anchor_a

◆ anchor_a_ws

vec3 HingeJoint::anchor_a_ws

◆ anchor_b

vec3 HingeJoint::anchor_b

◆ anchor_b_ws

vec3 HingeJoint::anchor_b_ws

◆ axisA

unsigned int HingeJoint::axisA

◆ axisB

unsigned int HingeJoint::axisB

◆ axisC

unsigned int HingeJoint::axisC

◆ bias

vec3 HingeJoint::bias = vec3(0,0,0)

◆ bias2

vec2 HingeJoint::bias2 = vec3(0,0,0)

◆ body_a

RigidBody* HingeJoint::body_a

◆ body_a_index

unsigned int HingeJoint::body_a_index

◆ body_b

RigidBody* HingeJoint::body_b

◆ body_b_index

unsigned int HingeJoint::body_b_index

◆ dt

float HingeJoint::dt = 0.02f

◆ effective_mass

mat3 HingeJoint::effective_mass = mat3(0.0f)

◆ effective_mass2

mat2 HingeJoint::effective_mass2 = mat2(0.0f)

◆ P

vec3 HingeJoint::P = vec3(0,0,0)

◆ P2

vec2 HingeJoint::P2 = vec2(0,0)

◆ unset

bool HingeJoint::unset = true

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