PxFiltering.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12 
13 
14 #ifndef PX_PHYSICS_NX_FILTERING
15 #define PX_PHYSICS_NX_FILTERING
16 
20 #include "PxPhysXConfig.h"
21 #include "foundation/PxFlags.h"
22 
23 #ifndef PX_DOXYGEN
24 namespace physx
25 {
26 #endif
27 
28 class PxActor;
29 class PxShape;
30 
31 
37 struct PxPairFlag
38 {
39  enum Enum
40  {
46  eSOLVE_CONTACT = (1<<0),
47 
55  eMODIFY_CONTACTS = (1<<1),
56 
71  eNOTIFY_TOUCH_FOUND = (1<<2),
72 
91  eNOTIFY_TOUCH_PERSISTS = (1<<3),
92 
109  eNOTIFY_TOUCH_LOST = (1<<4),
110 
129  eNOTIFY_TOUCH_CCD = (1<<5),
130 
140  eNOTIFY_THRESHOLD_FORCE_FOUND = (1<<6),
141 
154  eNOTIFY_THRESHOLD_FORCE_PERSISTS = (1<<7),
155 
168  eNOTIFY_THRESHOLD_FORCE_LOST = (1<<8),
169 
179  eNOTIFY_CONTACT_POINTS = (1<<9),
180 
187  eDETECT_DISCRETE_CONTACT = (1<<10),
188 
189 
203  eDETECT_CCD_CONTACT = (1<<11),
204 
217  ePRE_SOLVER_VELOCITY = (1<<12),
218 
227  ePOST_SOLVER_VELOCITY = (1<<13),
228 
243  eCONTACT_EVENT_POSE = (1<<14),
244 
245  eNEXT_FREE = (1<<15),
246 
252  PX_DEPRECATED eRESOLVE_CONTACTS = eSOLVE_CONTACT | eDETECT_DISCRETE_CONTACT,
253 
258  PX_DEPRECATED eCCD_LINEAR = eSOLVE_CONTACT | eDETECT_CCD_CONTACT,
259 
263  eCONTACT_DEFAULT = eSOLVE_CONTACT | eDETECT_DISCRETE_CONTACT,
264 
268  eTRIGGER_DEFAULT = eNOTIFY_TOUCH_FOUND | eNOTIFY_TOUCH_LOST | eDETECT_DISCRETE_CONTACT
269  };
270 };
271 
279 
280 
281 
282 
288 {
289  enum Enum
290  {
302  eKILL = (1<<0),
303 
317  eSUPPRESS = (1<<1),
318 
324  eCALLBACK = (1<<2),
325 
335  eNOTIFY = (1<<3) | eCALLBACK,
336 
348  eDEFAULT = 0
349  };
350 };
351 
359 
360 
361 
367 {
368 //= ATTENTION! =====================================================================================
369 // Changing the data layout of this class breaks the binary serialization format. See comments for
370 // PX_BINARY_SERIAL_VERSION. If a modification is required, please adjust the getBinaryMetaData
371 // function. If the modification is made on a custom branch, please change PX_BINARY_SERIAL_VERSION
372 // accordingly.
373 //==================================================================================================
374 
375  PX_INLINE PxFilterData(const PxEMPTY&)
376  {
377  }
378 
382  PX_INLINE PxFilterData()
383  {
384  word0 = word1 = word2 = word3 = 0;
385  }
386 
390  PX_INLINE PxFilterData(PxU32 w0, PxU32 w1, PxU32 w2, PxU32 w3) : word0(w0), word1(w1), word2(w2), word3(w3) {}
391 
395  PX_INLINE void setToDefault()
396  {
397  *this = PxFilterData();
398  }
399 
404 };
405 
406 
413 {
414  enum Enum
415  {
421 
427 
433 
439 
445 
451 
452  //brief internal use only!
453  eMAX_TYPE_COUNT = 16,
454 
455  //brief internal use only!
456  eUNDEFINED = eMAX_TYPE_COUNT-1
457  };
458 };
459 
460 
461 // For internal use only
463 {
464  enum Enum
465  {
466  eKINEMATIC = (1<<4),
467  eTRIGGER = (1<<5)
468  };
469 };
470 
471 
478 
479 
489 {
490  return static_cast<PxFilterObjectType::Enum>( (attr & (PxFilterObjectType::eMAX_TYPE_COUNT-1)) );
491 }
492 
493 
503 {
504  return ((attr & PxFilterObjectFlag::eKINEMATIC) != 0);
505 }
506 
507 
517 {
518  return ((attr & PxFilterObjectFlag::eTRIGGER) != 0);
519 }
520 
521 
577  (PxFilterObjectAttributes attributes0, PxFilterData filterData0,
578  PxFilterObjectAttributes attributes1, PxFilterData filterData1,
579  PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize);
580 
581 
582 
606 {
607 public:
608 
632  virtual PxFilterFlags pairFound( PxU32 pairID,
633  PxFilterObjectAttributes attributes0, PxFilterData filterData0, const PxActor* a0, const PxShape* s0,
634  PxFilterObjectAttributes attributes1, PxFilterData filterData1, const PxActor* a1, const PxShape* s1,
635  PxPairFlags& pairFlags) = 0;
636 
652  virtual void pairLost( PxU32 pairID,
653  PxFilterObjectAttributes attributes0,
654  PxFilterData filterData0,
655  PxFilterObjectAttributes attributes1,
656  PxFilterData filterData1,
657  bool objectRemoved) = 0;
658 
681  virtual bool statusChange(PxU32& pairID, PxPairFlags& pairFlags, PxFilterFlags& filterFlags) = 0;
682 
683 protected:
685 };
686 
687 #ifndef PX_DOXYGEN
688 } // namespace physx
689 #endif
690 
692 #endif


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com