PhysX SDK 3.2 API Reference: PxSceneQueryFiltering.h Source File

PhysX SDK 3.2 API

PxSceneQueryFiltering.h

Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you 
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and 
00007 // any modifications thereto. Any use, reproduction, disclosure, or 
00008 // distribution of this software and related documentation without an express 
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 // 
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2012 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 #ifndef PX_PHYSICS_NX_SCENE_QUERY_FILTERING
00032 #define PX_PHYSICS_NX_SCENE_QUERY_FILTERING
00033 
00037 #include "PxPhysX.h"
00038 #include "PxFiltering.h"
00039 #include "foundation/PxFlags.h"
00040 
00041 #ifndef PX_DOXYGEN
00042 namespace physx
00043 {
00044 #endif
00045 
00046 class PxShape;
00047 class PxActor;
00048 struct PxSceneQueryHit;
00049 
00050 
00056 struct PxSceneQueryFilterFlag
00057 {
00058     enum Enum
00059     {
00060         eSTATIC             = (1<<0),                       
00061         eDYNAMIC            = (1<<1),                       
00062         ePREFILTER          = (1<<2),                       
00063         ePOSTFILTER         = (1<<3),                       
00064         eMESH_MULTIPLE      = (1<<4),                       
00065         eBACKFACE           = (1<<5),                       
00066     };
00067 };
00068 PX_COMPILE_TIME_ASSERT(PxSceneQueryFilterFlag::eSTATIC==(1<<0));
00069 PX_COMPILE_TIME_ASSERT(PxSceneQueryFilterFlag::eDYNAMIC==(1<<1));
00070 
00076 typedef PxFlags<PxSceneQueryFilterFlag::Enum,PxU16> PxSceneQueryFilterFlags;
00077 PX_FLAGS_OPERATORS(PxSceneQueryFilterFlag::Enum,PxU16);
00078 
00091 struct PxSceneQueryHitType
00092 {
00093     enum Enum
00094     {
00095         eNONE   = 0,    
00096         eTOUCH  = 1,    
00097         eBLOCK  = 2     
00098     };
00099 };
00100 
00117 struct PxSceneQueryFilterData
00118 {
00122     PX_INLINE PxSceneQueryFilterData() : flags(PxSceneQueryFilterFlag::eDYNAMIC | PxSceneQueryFilterFlag::eSTATIC) {}
00123 
00127     PX_INLINE PxSceneQueryFilterData(const PxFilterData& fd, PxSceneQueryFilterFlags f) : data(fd), flags(f) {}
00128 
00132     PX_INLINE PxSceneQueryFilterData(PxSceneQueryFilterFlags f) : flags(f) {}
00133 
00134     PxFilterData data;              
00135     PxSceneQueryFilterFlags flags;  
00136 };
00137 
00162 class PxSceneQueryFilterCallback
00163 {
00164 public:
00165 
00175     virtual PxSceneQueryHitType::Enum preFilter(const PxFilterData& filterData, PxShape* shape, PxSceneQueryFilterFlags& filterFlags) = 0;
00176 
00186     virtual PxSceneQueryHitType::Enum postFilter(const PxFilterData& filterData, const PxSceneQueryHit& hit) = 0;
00187 
00191     virtual ~PxSceneQueryFilterCallback() {}
00192 };
00193 
00194 
00218 //  /**
00219 //  \param[in] filterData0 The custom filter data of the query
00220 //  \param[in] filterData1 The custom filter data of the second object
00221 //  \param[in] constantBlock The constant global filter data (see #PxBatchQuery)
00222 //  \param[in] constantBlockSize Size of the global filter data (see #PxBatchQuery)
00223 //  \param[out] filterFlags Flags giving additional information on how an accepted pair should get processed
00224 //  \return Hit declaration.
00225 //
00226 //  @see PxBatchQueryPostFilterShader 
00227 //  */
00228 typedef PxSceneQueryHitType::Enum (*PxBatchQueryPreFilterShader)(   
00229     PxFilterData filterData0, 
00230     PxFilterData filterData1,
00231     const void* constantBlock, PxU32 constantBlockSize,
00232     PxSceneQueryFilterFlags& filterFlags);
00233 
00249 //  /**
00250 //  \param[in] filterData0 The custom filter data of the query
00251 //  \param[in] filterData1 The custom filter data of the shape
00252 //  \param[in] constantBlock The constant global filter data (see #PxBatchQuery)
00253 //  \param[in] constantBlockSize Size of the global filter data (see #PxBatchQuery)
00254 //  \param[in] hit declaration.
00255 //
00256 //  @see PxBatchQueryPreFilterShader 
00257 //  */
00258 
00259 typedef PxSceneQueryHitType::Enum (*PxBatchQueryPostFilterShader)(
00260     PxFilterData filterData0,
00261     PxFilterData filterData1,
00262     const void* constantBlock, PxU32 constantBlockSize,
00263     const PxSceneQueryHit& hit);
00264 
00265 #ifndef PX_DOXYGEN
00266 } // namespace physx
00267 #endif
00268 
00270 #endif


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