NVIDIA(R) PhysX(R) SDK 3.4 API Reference: PxShape.h Source File

NVIDIA PhysX SDK 3.4 API

PxShape.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-2017 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 #ifndef PX_PHYSICS_NX_SHAPE
00031 #define PX_PHYSICS_NX_SHAPE
00032 
00036 #include "PxPhysXConfig.h"
00037 #include "common/PxBase.h"
00038 #include "geometry/PxGeometry.h"
00039 #include "geometry/PxGeometryHelpers.h"
00040 
00041 #if !PX_DOXYGEN
00042 namespace physx
00043 {
00044 #endif
00045 
00046 class PxBoxGeometry;
00047 class PxSphereGeometry;
00048 class PxCapsuleGeometry;
00049 class PxPlaneGeometry;
00050 class PxConvexMeshGeometry;
00051 class PxTriangleMeshGeometry;
00052 class PxHeightFieldGeometry;
00053 class PxRigidActor;
00054 struct PxFilterData;
00055 struct PxRaycastHit;
00056 struct PxSweepHit;
00057 
00063 struct PxShapeFlag
00064 {
00065     enum Enum
00066     {
00079         eSIMULATION_SHAPE               = (1<<0),
00080 
00084         eSCENE_QUERY_SHAPE              = (1<<1),
00085 
00108         eTRIGGER_SHAPE                  = (1<<2),
00109 
00115         eVISUALIZATION                  = (1<<3),
00116 
00120         ePARTICLE_DRAIN                 = (1<<4)
00121     };
00122 };
00123 
00129 typedef PxFlags<PxShapeFlag::Enum,PxU8> PxShapeFlags;
00130 PX_FLAGS_OPERATORS(PxShapeFlag::Enum,PxU8)
00131 
00132 
00133 
00149 class PxShape : public PxBase
00150 {
00151 public:
00152 
00163     virtual     void                    release() = 0;
00164 
00170     virtual     void                    acquireReference() = 0;
00171 
00179     virtual     PxGeometryType::Enum    getGeometryType() const = 0;
00180 
00192     virtual     void                    setGeometry(const PxGeometry& geometry) = 0;
00193 
00194 
00203     virtual     PxGeometryHolder        getGeometry() const = 0;
00204 
00205 
00217     virtual     bool                    getBoxGeometry(PxBoxGeometry& geometry) const = 0;
00218 
00230     virtual     bool                    getSphereGeometry(PxSphereGeometry& geometry) const = 0;
00231 
00243     virtual     bool                    getCapsuleGeometry(PxCapsuleGeometry& geometry) const = 0;
00244 
00256     virtual     bool                    getPlaneGeometry(PxPlaneGeometry& geometry) const = 0;
00257 
00269     virtual     bool                    getConvexMeshGeometry(PxConvexMeshGeometry& geometry) const = 0;
00270 
00282     virtual     bool                    getTriangleMeshGeometry(PxTriangleMeshGeometry& geometry) const = 0;
00283 
00295     virtual     bool                    getHeightFieldGeometry(PxHeightFieldGeometry& geometry) const = 0;
00296 
00304     virtual     PxRigidActor*           getActor() const = 0;
00305 
00306 
00307 /************************************************************************************************/
00308 
00312 
00331     virtual     void                    setLocalPose(const PxTransform& pose)       = 0;
00332 
00342     virtual     PxTransform             getLocalPose()                  const   = 0;
00343 
00345 /************************************************************************************************/
00346 
00350 
00361     virtual     void                    setSimulationFilterData(const PxFilterData& data)   = 0;
00362 
00368     virtual     PxFilterData            getSimulationFilterData()                   const   = 0;
00369 
00377     virtual     void                    setQueryFilterData(const PxFilterData& data)    = 0;
00378 
00384     virtual     PxFilterData            getQueryFilterData()                    const   = 0;
00385 
00387 /************************************************************************************************/
00388 
00399     virtual     void                    setMaterials(PxMaterial*const* materials, PxU16 materialCount)  = 0;
00400 
00410     virtual     PxU16                   getNbMaterials()        const   = 0;
00411 
00426     virtual     PxU32                   getMaterials(PxMaterial** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const   = 0;
00427     
00446     virtual     PxMaterial*             getMaterialFromInternalFaceIndex(PxU32 faceIndex) const = 0;
00447 
00464     virtual     void                    setContactOffset(PxReal contactOffset)  = 0;
00465 
00473     virtual     PxReal                  getContactOffset() const    = 0;
00474 
00490     virtual     void                    setRestOffset(PxReal restOffset)    = 0;
00491 
00499     virtual     PxReal                  getRestOffset() const   = 0;
00500 
00501 /************************************************************************************************/
00502 
00515     virtual     void                    setFlag(PxShapeFlag::Enum flag, bool value) = 0;
00516 
00522     virtual     void                    setFlags(PxShapeFlags inFlags) = 0;
00523 
00531     virtual     PxShapeFlags            getFlags() const = 0;
00532 
00538     virtual     bool                    isExclusive() const = 0;
00539 
00552     virtual     void                    setName(const char* name)       = 0;
00553 
00554 
00561     virtual     const char*             getName()           const   = 0;
00562 
00563 
00564     virtual     const char*             getConcreteTypeName() const { return "PxShape"; }
00565 
00566 /************************************************************************************************/
00567 
00568                 void*                   userData;   
00569 
00570 protected:
00571     PX_INLINE                           PxShape(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00572     PX_INLINE                           PxShape(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
00573     virtual                             ~PxShape() {}
00574     virtual     bool                    isKindOf(const char* name) const { return !::strcmp("PxShape", name) || PxBase::isKindOf(name); }
00575 
00576 };
00577 
00578 #if !PX_DOXYGEN
00579 } // namespace physx
00580 #endif
00581 
00583 #endif


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