HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_BuildCollisionMaskFromPieces.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: SIM_BuildCollisionMaskFromPieces.h (SIMZ Library, C++)
7  *
8  * COMMENTS:
9  * Implements an operator to build a collision mask (and a field of collision
10  * velocities) from instanced rigid body pieces.
11  */
12 
13 #ifndef __SIM_BuildCollisionMaskFromPieces__
14 #define __SIM_BuildCollisionMaskFromPieces__
15 
16 #include "SIMZ_API.h"
17 
18 #include <GAS/GAS_SubSolver.h>
19 #include <SIM/SIM_RawField.h>
20 
21 class sim_ColliderInstance;
22 
23 // This class implements the collision mask building logic.
25 {
26 public:
27  GET_DATA_FUNC_S(GAS_NAME_COLLISION, CollisionField);
28  GET_DATA_FUNC_S(GAS_NAME_COLLISIONVELOCITY, CollisionVelocity);
29  GET_DATA_FUNC_S(GAS_NAME_STENCIL, StencilField);
30 
31  GET_DATA_FUNC_V3("wind", WindVelocity);
32 
33  GET_DATA_FUNC_B("clearmask", ClearMask);
34  GET_DATA_FUNC_F("minmaskval", StartingValue);
35 
36  GET_DATA_FUNC_I("referenceframe", CollectFrame);
37  GET_DATA_FUNC_I("input", Input);
38  GET_DATA_FUNC_S("soppath", SopPath);
39  GET_DATA_FUNC_S("instgeo", InstanceGeo);
40 
41  GET_DATA_FUNC_S("surfvol", SurfaceVolume);
42 
43 protected:
44  explicit SIM_BuildCollisionMaskFromPieces(const SIM_DataFactory* factory);
46 
47  bool solveGasSubclass(SIM_Engine& engine,
48  SIM_Object* obj,
49  SIM_Time time,
50  SIM_Time timestep) override;
51 
53  mask->shouldMultiThread(),
54  buildCollisionMask,
56  UT_VoxelArrayF**, vel,
57  const SIM_RawField*, stencil,
58  const UT_Array<sim_ColliderInstance>&, colliders,
59  bool, clear,
60  float, def_val,
61  const UT_Vector3&, neg_wind);
62  void buildCollisionMaskPartial(SIM_RawField* mask, UT_VoxelArrayF* vel[3],
63  const SIM_RawField* stencil,
65  bool clear, float def_val,
66  const UT_Vector3& neg_wind,
67  const UT_JobInfo& info) const;
68 
69 private:
70  static const SIM_DopDescription* getDopDescription();
71 
74  "Gas Build Collision Mask From Pieces",
75  getDopDescription());
76 };
77 
78 #endif
79 
#define SIMZ_API
Definition: SIMZ_API.h:10
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define GET_DATA_FUNC_V3(DataName, FuncName)
GT_API const UT_StringHolder time
#define GAS_NAME_COLLISION
Definition: GAS_Utils.h:21
virtual bool solveGasSubclass(SIM_Engine &engine, SIM_Object *obj, SIM_Time time, SIM_Time timestep)=0
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
#define GET_DATA_FUNC_I(DataName, FuncName)
IMATH_NAMESPACE::V2f float
#define THREADED_METHOD7_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6, PARMTYPE7, PARMNAME7)
#define GAS_NAME_COLLISIONVELOCITY
Definition: GAS_Utils.h:23
GLint GLuint mask
Definition: glcorearb.h:124
#define GET_DATA_FUNC_B(DataName, FuncName)
#define GET_DATA_FUNC_F(DataName, FuncName)
GLint GLfloat GLint stencil
Definition: glcorearb.h:1278
#define GET_DATA_FUNC_S(DataName, FuncName)
#define GAS_NAME_STENCIL
Definition: GAS_Utils.h:19