HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RBD_SharedAffectorList.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: RBD_SharedAffectorList.h ( RBD Library, C++)
7  *
8  * COMMENTS:
9  * Provides a holder for shared lists of affectors. These
10  * store the proxy RBD objects for the affectors and any
11  * spatial partitioning data that is useful.
12  */
13 
14 #ifndef __RBD_SharedAffectorList__
15 #define __RBD_SharedAffectorList__
16 
17 #include "RBD_API.h"
18 #include <UT/UT_ValArray.h>
19 #include <SIM/SIM_ColliderInfo.h>
20 
21 class UT_TokenString;
22 class RBD_Object;
23 class RBD_ObjectTree;
24 class RBD_Solver;
26 
28 
29 //
30 // RBD Shared affector list definition
31 //
33 {
34 public:
37 
38  // These functions are used when accessing the list.
39  int entries() const
40  { return myAffectors.entries(); }
41  RBD_Object *operator()(int i) const
42  { return myAffectors(i); }
43  const SIM_Collider *getCollider(int i, SIM_Object *obj, const char *defaultlabel)
44  { return myColliderInfoArray(i).getCollider(obj, defaultlabel); }
46  { return myColliderInfoArray(i).getImpactApplyType(); }
47 
48  // Gets the overlapping objects from our trees.
49  void findOverlapIdx(const RBD_Solver *solver,
50  RBD_Object *obj,
51  UT_IntArray &overlap);
52  // Dirties the object tree in case some of the solving objects have moved.
53  void setObjectTreeDirty();
54 
55  // These functions are used when building the list.
57  { return myAffectors(i); }
59  { return myColliderInfoArray; }
60  void resizeAffectors();
61 
62 private:
63  UT_ValArray<RBD_Object *> myAffectors;
64  SIM_ColliderInfoArray myColliderInfoArray;
65  RBD_ObjectTree *myMutualObjectTree;
66  RBD_ObjectTree *myOtherObjectTree;
67 };
68 
69 #endif
70 
const SIM_Collider * getCollider(int i, SIM_Object *obj, const char *defaultlabel)
UT_ValArray< RBD_SharedAffectorList * > RBD_SharedAffectorListArray
RBD_Object *& operator()(int i)
#define RBD_API
Definition: RBD_API.h:10
png_uint_32 i
Definition: png.h:2877
SIM_ImpactApplyType
Defines the possible affector types when doing collision detection.
Definition: SIM_Collider.h:56
SIM_ColliderInfoArray & getColliderInfoArray()
RBD_Object * operator()(int i) const
SIM_Collider::SIM_ImpactApplyType getImpactApplyType(int i)