00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Jeff Lait 00008 * Side Effects Software Inc 00009 * 123 Front Street West, Suite 1401 00010 * Toronto, Ontario 00011 * Canada M5J 2M2 00012 * 416-504-9876 00013 * 00014 * NAME: RBD_SharedAffectorList.h ( RBD Library, C++) 00015 * 00016 * COMMENTS: 00017 * Provides a holder for shared lists of affectors. These 00018 * store the proxy RBD objects for the affectors and any 00019 * spatial partitioning data that is useful. 00020 */ 00021 00022 #ifndef __RBD_SharedAffectorList__ 00023 #define __RBD_SharedAffectorList__ 00024 00025 #include "RBD_API.h" 00026 #include <UT/UT_PtrArray.h> 00027 #include <SIM/SIM_ColliderInfo.h> 00028 00029 class UT_TokenString; 00030 class RBD_Object; 00031 class RBD_ObjectTree; 00032 class RBD_Solver; 00033 class RBD_SharedAffectorList; 00034 00035 typedef UT_PtrArray<RBD_SharedAffectorList *> RBD_SharedAffectorListArray; 00036 00037 // 00038 // RBD Shared affector list definition 00039 // 00040 class RBD_API RBD_SharedAffectorList 00041 { 00042 public: 00043 RBD_SharedAffectorList(); 00044 ~RBD_SharedAffectorList(); 00045 00046 // These functions are used when accessing the list. 00047 int entries() const 00048 { return myAffectors.entries(); } 00049 RBD_Object *operator()(int i) const 00050 { return myAffectors(i); } 00051 const SIM_Collider *getCollider(int i, SIM_Object *obj) 00052 { return myColliderInfoArray(i).getCollider(obj); } 00053 SIM_Collider::SIM_ImpactApplyType getImpactApplyType(int i) 00054 { return myColliderInfoArray(i).getImpactApplyType(); } 00055 00056 // Gets the overlapping objects from our trees. 00057 void findOverlapIdx(const RBD_Solver *solver, 00058 RBD_Object *obj, 00059 UT_IntArray &overlap); 00060 // Dirties the object tree in case some of the solving objects have moved. 00061 void setObjectTreeDirty(); 00062 00063 // These functions are used when building the list. 00064 RBD_Object *&operator()(int i) 00065 { return myAffectors(i); } 00066 SIM_ColliderInfoArray &getColliderInfoArray() 00067 { return myColliderInfoArray; } 00068 void resizeAffectors(); 00069 00070 private: 00071 UT_PtrArray<RBD_Object *> myAffectors; 00072 SIM_ColliderInfoArray myColliderInfoArray; 00073 RBD_ObjectTree *myMutualObjectTree; 00074 RBD_ObjectTree *myOtherObjectTree; 00075 }; 00076 00077 #endif 00078
1.5.9