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-2018 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 
00106         eTRIGGER_SHAPE                  = (1<<2),
00107 
00113         eVISUALIZATION                  = (1<<3)
00114     };
00115 };
00116 
00122 typedef PxFlags<PxShapeFlag::Enum,PxU8> PxShapeFlags;
00123 PX_FLAGS_OPERATORS(PxShapeFlag::Enum,PxU8)
00124 
00125 
00126 
00142 class PxShape : public PxBase
00143 {
00144 public:
00145 
00156     virtual     void                    release() = 0;
00157 
00166     virtual     PxU32                   getReferenceCount() const = 0;
00167 
00173     virtual     void                    acquireReference() = 0;
00174 
00182     virtual     PxGeometryType::Enum    getGeometryType() const = 0;
00183 
00195     virtual     void                    setGeometry(const PxGeometry& geometry) = 0;
00196 
00197 
00206     virtual     PxGeometryHolder        getGeometry() const = 0;
00207 
00208 
00220     virtual     bool                    getBoxGeometry(PxBoxGeometry& geometry) const = 0;
00221 
00233     virtual     bool                    getSphereGeometry(PxSphereGeometry& geometry) const = 0;
00234 
00246     virtual     bool                    getCapsuleGeometry(PxCapsuleGeometry& geometry) const = 0;
00247 
00259     virtual     bool                    getPlaneGeometry(PxPlaneGeometry& geometry) const = 0;
00260 
00272     virtual     bool                    getConvexMeshGeometry(PxConvexMeshGeometry& geometry) const = 0;
00273 
00285     virtual     bool                    getTriangleMeshGeometry(PxTriangleMeshGeometry& geometry) const = 0;
00286 
00287 
00299     virtual     bool                    getHeightFieldGeometry(PxHeightFieldGeometry& geometry) const = 0;
00300 
00308     virtual     PxRigidActor*           getActor() const = 0;
00309 
00310 
00311 /************************************************************************************************/
00312 
00316 
00335     virtual     void                    setLocalPose(const PxTransform& pose)       = 0;
00336 
00346     virtual     PxTransform             getLocalPose()                  const   = 0;
00347 
00349 /************************************************************************************************/
00350 
00354 
00365     virtual     void                    setSimulationFilterData(const PxFilterData& data)   = 0;
00366 
00372     virtual     PxFilterData            getSimulationFilterData()                   const   = 0;
00373 
00381     virtual     void                    setQueryFilterData(const PxFilterData& data)    = 0;
00382 
00388     virtual     PxFilterData            getQueryFilterData()                    const   = 0;
00389 
00391 /************************************************************************************************/
00392 
00403     virtual     void                    setMaterials(PxMaterial*const* materials, PxU16 materialCount)  = 0;
00404 
00414     virtual     PxU16                   getNbMaterials()        const   = 0;
00415 
00430     virtual     PxU32                   getMaterials(PxMaterial** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const   = 0;
00431     
00450     virtual     PxMaterial*             getMaterialFromInternalFaceIndex(PxU32 faceIndex) const = 0;
00451 
00468     virtual     void                    setContactOffset(PxReal contactOffset)  = 0;
00469 
00477     virtual     PxReal                  getContactOffset() const    = 0;
00478 
00494     virtual     void                    setRestOffset(PxReal restOffset)    = 0;
00495 
00503     virtual     PxReal                  getRestOffset() const   = 0;
00504 
00505 
00517     virtual         void                        setTorsionalPatchRadius(PxReal radius) = 0;
00518 
00529     virtual         PxReal                      getTorsionalPatchRadius() const = 0;
00530 
00542     virtual         void                        setMinTorsionalPatchRadius(PxReal radius) = 0;
00543 
00554     virtual         PxReal                      getMinTorsionalPatchRadius() const = 0;
00555 
00556 
00557 /************************************************************************************************/
00558 
00571     virtual     void                    setFlag(PxShapeFlag::Enum flag, bool value) = 0;
00572 
00578     virtual     void                    setFlags(PxShapeFlags inFlags) = 0;
00579 
00587     virtual     PxShapeFlags            getFlags() const = 0;
00588 
00594     virtual     bool                    isExclusive() const = 0;
00595 
00608     virtual     void                    setName(const char* name)       = 0;
00609 
00610 
00617     virtual     const char*             getName()           const   = 0;
00618 
00619 
00620     virtual     const char*             getConcreteTypeName() const { return "PxShape"; }
00621 
00622 /************************************************************************************************/
00623 
00624                 void*                   userData;   
00625 
00626 protected:
00627     PX_INLINE                           PxShape(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00628     PX_INLINE                           PxShape(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags), userData(NULL) {}
00629     virtual                             ~PxShape() {}
00630     virtual     bool                    isKindOf(const char* name) const { return !::strcmp("PxShape", name) || PxBase::isKindOf(name); }
00631 
00632 };
00633 
00634 #if !PX_DOXYGEN
00635 } // namespace physx
00636 #endif
00637 
00639 #endif


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