~ubuntu-branches/ubuntu/intrepid/blender/intrepid-updates

« back to all changes in this revision

Viewing changes to extern/bullet/BulletDynamics/Dynamics/BU_Joint.h

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-08-08 02:45:40 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080808024540-kkjp7ekfivzhuw3l
Tags: 2.46+dfsg-4
* Fix python syntax warning in import_dxf.py, which led to nasty output
  in installation/upgrade logs during byte-compilation, using a patch
  provided by the script author (Closes: #492280):
   - debian/patches/45_fix_python_syntax_warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Bullet Continuous Collision Detection and Physics Library
3
 
Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
 
 
5
 
This software is provided 'as-is', without any express or implied warranty.
6
 
In no event will the authors be held liable for any damages arising from the use of this software.
7
 
Permission is granted to anyone to use this software for any purpose, 
8
 
including commercial applications, and to alter it and redistribute it freely, 
9
 
subject to the following restrictions:
10
 
 
11
 
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12
 
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13
 
3. This notice may not be removed or altered from any source distribution.
14
 
*/
15
 
 
16
 
#ifndef BU_Joint_H
17
 
#define BU_Joint_H
18
 
 
19
 
class RigidBody;
20
 
class BU_Joint;
21
 
#include "SimdScalar.h"
22
 
 
23
 
struct BU_ContactJointNode {
24
 
  BU_Joint *joint;              // pointer to enclosing BU_Joint object
25
 
  RigidBody*body;                       // *other* body this joint is connected to
26
 
};
27
 
typedef SimdScalar dVector3[4];
28
 
 
29
 
 
30
 
class BU_Joint  {
31
 
  
32
 
public:
33
 
        // naming convention: the "first" body this is connected to is node[0].body,
34
 
  // and the "second" body is node[1].body. if this joint is only connected
35
 
  // to one body then the second body is 0.
36
 
 
37
 
  // info returned by getInfo1 function. the constraint dimension is m (<=6).
38
 
  // i.e. that is the total number of rows in the jacobian. `nub' is the
39
 
  // number of unbounded variables (which have lo,hi = -/+ infinity).
40
 
 
41
 
  BU_Joint();
42
 
  virtual ~BU_Joint();
43
 
  
44
 
 
45
 
  struct Info1 {
46
 
    int m,nub;
47
 
  };
48
 
 
49
 
  // info returned by getInfo2 function
50
 
 
51
 
  struct Info2 {
52
 
    // integrator parameters: frames per second (1/stepsize), default error
53
 
    // reduction parameter (0..1).
54
 
    SimdScalar fps,erp;
55
 
 
56
 
    // for the first and second body, pointers to two (linear and angular)
57
 
    // n*3 jacobian sub matrices, stored by rows. these matrices will have
58
 
    // been initialized to 0 on entry. if the second body is zero then the
59
 
    // J2xx pointers may be 0.
60
 
    SimdScalar *J1l,*J1a,*J2l,*J2a;
61
 
 
62
 
    // elements to jump from one row to the next in J's
63
 
    int rowskip;
64
 
 
65
 
    // right hand sides of the equation J*v = c + cfm * lambda. cfm is the
66
 
    // "constraint force mixing" vector. c is set to zero on entry, cfm is
67
 
    // set to a constant value (typically very small or zero) value on entry.
68
 
    SimdScalar *c,*cfm;
69
 
 
70
 
    // lo and hi limits for variables (set to -/+ infinity on entry).
71
 
    SimdScalar *lo,*hi;
72
 
 
73
 
    // findex vector for variables. see the LCP solver interface for a
74
 
    // description of what this does. this is set to -1 on entry.
75
 
    // note that the returned indexes are relative to the first index of
76
 
    // the constraint.
77
 
    int *findex;
78
 
  };
79
 
 
80
 
  // virtual function table: size of the joint structure, function pointers.
81
 
  // we do it this way instead of using C++ virtual functions because
82
 
  // sometimes we need to allocate joints ourself within a memory pool.
83
 
 
84
 
  virtual void GetInfo1 (Info1 *info)=0;
85
 
  virtual void GetInfo2 (Info2 *info)=0;
86
 
 
87
 
  int flags;                    // dJOINT_xxx flags
88
 
  BU_ContactJointNode node[2];          // connections to bodies. node[1].body can be 0
89
 
   SimdScalar lambda[6];                // lambda generated by last step
90
 
};
91
 
 
92
 
 
93
 
#endif //BU_Joint_H