HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
KIN_Bone.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: KIN_Bone.h ( Kinematics Library, C++)
7  *
8  * COMMENTS:
9  * class for storing bone specification
10  */
11 
12 #ifndef __KIN_Bone__
13 #define __KIN_Bone__
14 
15 #include "KIN_API.h"
16 #include "KIN_AngleConstraint.h"
17 #include <UT/UT_Matrix4.h>
18 #include <SYS/SYS_Types.h>
19 #include <string.h>
20 
22 {
23 public:
25  {
26  myRot[0] = myRot[1] = myRot[2] = 0.0;
27  myLength = 0.0;
28  myDampening = 0.0;
29  myExtraXform.identity();
30  myData = 0;
31  }
33  {
34  }
35 
36  fpreal getRotate( int axis ) const { return myRot[axis]; }
37  void getRotates( fpreal *r ) const
38  { memcpy( r, myRot, sizeof(myRot) ); }
39  const UT_Matrix4R &getExtraXform() const { return myExtraXform; }
40 
41  fpreal getLength() const { return myLength; }
42  fpreal getDampening() const { return myDampening; }
43  const void *getData() const { return myData; }
44  fpreal constrain(int axis, fpreal angle, fpreal step) const
45  { return myConstraint.constrain(axis, angle, step); }
46 
47  void setRotate( int axis, fpreal r )
48  { myRot[axis] = r; }
49  void setRotates( const fpreal *r )
50  { memcpy( myRot, r, sizeof(myRot) ); }
51  void setExtraXform(const UT_Matrix4R &xform)
52  { myExtraXform = xform; }
53 
54  void setLength( fpreal l ) { myLength = l; }
55  void setDampening( fpreal d ){ myDampening = d; }
56  void setData( const void *d ){ myData = d; }
57  void setConstraint( fpreal rest[3], fpreal xrange[2],
58  fpreal yrange[2], fpreal zrange[2],
59  fpreal damp[3], fpreal roll[3] )
60  {
61  myConstraint.setConstraint(rest, xrange, yrange,
62  zrange, damp, roll);
63  }
64 
65  int64 getMmemoryUsage(bool inclusive) const
66  {
67  return inclusive ? sizeof(*this) : 0;
68  }
69 
70 private:
71  fpreal myRot[3];
72  fpreal myLength;
73  fpreal myDampening;
74  UT_Matrix4R myExtraXform;
75  const void *myData;
76  KIN_AngleConstraint myConstraint;
77 };
78 
79 #endif
80 
KIN_Bone()
Definition: KIN_Bone.h:24
void getRotates(fpreal *r) const
Definition: KIN_Bone.h:37
~KIN_Bone()
Definition: KIN_Bone.h:32
const void * getData() const
Definition: KIN_Bone.h:43
fpreal getLength() const
Definition: KIN_Bone.h:41
void setLength(fpreal l)
Definition: KIN_Bone.h:54
fpreal getDampening() const
Definition: KIN_Bone.h:42
void setRotates(const fpreal *r)
Definition: KIN_Bone.h:49
void setExtraXform(const UT_Matrix4R &xform)
Definition: KIN_Bone.h:51
long long int64
Definition: SYS_Types.h:100
void setDampening(fpreal d)
Definition: KIN_Bone.h:55
const UT_Matrix4R & getExtraXform() const
Definition: KIN_Bone.h:39
void setConstraint(fpreal rest[3], fpreal xrange[2], fpreal yrange[2], fpreal zrange[2], fpreal damp[3], fpreal roll[3])
Definition: KIN_Bone.h:57
T angle(const Vec2< T > &v1, const Vec2< T > &v2)
Definition: Vec2.h:480
fpreal constrain(int axis, fpreal angle, fpreal step) const
Definition: KIN_Bone.h:44
void setData(const void *d)
Definition: KIN_Bone.h:56
void setRotate(int axis, fpreal r)
Definition: KIN_Bone.h:47
double fpreal
Definition: SYS_Types.h:263
fpreal getRotate(int axis) const
Definition: KIN_Bone.h:36
#define KIN_API
Definition: KIN_API.h:10
GLboolean r
Definition: glcorearb.h:1221
GA_API const UT_StringHolder rest
int64 getMmemoryUsage(bool inclusive) const
Definition: KIN_Bone.h:65