physics
spherical_joint.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include "body.hpp"
8 
14 public:
15 
16  vec3 bias = vec3(0,0,0);
17  mat3 effective_mass = mat3(0.0f);
18  vec3 P = vec3(0,0,0);
19 
22 
23  vec3 anchor_a;
24  vec3 anchor_b;
25 
28 
29  float dt = 0.02f;
30 
31  unsigned int body_a_index;
32  unsigned int body_b_index;
33 
34  bool unset = true;
35 
36  SphericalJoint(unsigned int indexA, vec3 anchorA, unsigned int indexB, vec3 anchorB);
37 
38  int applyImpulse();
39 
40  int preStep(float dt);
41 
42  static vector<SphericalJoint*> allJoints;
43 };
Ball-in-socket Joint, specifying an anchor on each body will constrain the two bodies at those points...
Definition: spherical_joint.hpp:13
SphericalJoint(unsigned int indexA, vec3 anchorA, unsigned int indexB, vec3 anchorB)
unsigned int body_a_index
Definition: spherical_joint.hpp:31
vec3 bias
Definition: spherical_joint.hpp:16
mat3 effective_mass
Definition: spherical_joint.hpp:17
float dt
Definition: spherical_joint.hpp:29
bool unset
Definition: spherical_joint.hpp:34
vec3 anchor_b_ws
Definition: spherical_joint.hpp:27
vec3 P
Definition: spherical_joint.hpp:18
RigidBody structure for organising data to model physics simulations of convex hull collisions...
Definition: body.hpp:224
int preStep(float dt)
vec3 anchor_a
Definition: spherical_joint.hpp:23
vec3 anchor_b
Definition: spherical_joint.hpp:24
unsigned int body_b_index
Definition: spherical_joint.hpp:32
RigidBody * body_b
Definition: spherical_joint.hpp:21
vec3 anchor_a_ws
Definition: spherical_joint.hpp:26
static vector< SphericalJoint * > allJoints
Definition: spherical_joint.hpp:42
RigidBody * body_a
Definition: spherical_joint.hpp:20