Klamp't  0.9.0
RigidObject.h
1 #ifndef KLAMPT_RIGID_OBJECT_H
2 #define KLAMPT_RIGID_OBJECT_H
3 
4 #include <KrisLibrary/geometry/AnyGeometry.h>
5 #include <string>
6 #include "ManagedGeometry.h"
7 
8 namespace Klampt {
9  using namespace std;
10  using namespace Math3D;
11 
16 {
17 public:
20  bool Load(const char* fn);
21  bool Save(const char* fn);
27  bool LoadGeometry(const char* fn);
28  void SetMassFromGeometry(Real totalMass,Real surfaceFraction=1.0);
29  void SetMassFromBB(Real totalMass);
30  void InitCollisions();
31  void UpdateGeometry();
32  void DrawGL();
33  void DrawGLOpaque(bool opaque);
34 
35  string name;
36  string geomFile;
37  ManagedGeometry geometry;
38  RigidTransform T; //current transform
39  Vector3 w,v; //current angular velocity and velocity
40  Real mass; //mass
41  Vector3 com; //center of mass in local frame
42  Matrix3 inertia; //inertia matrix about com
43  Real kFriction;
44  Real kRestitution;
45  Real kStiffness,kDamping;
46 };
47 
48 } //namespace Klampt
49 
50 #endif
A (static) rigid object that may be manipulated.
Definition: RigidObject.h:15
A "smart" geometry loading class that caches previous geometries and maintains shared collision detec...
Definition: ManagedGeometry.h:62
Definition: ContactDistance.h:6