NxRenderMeshActor.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-2014 NVIDIA Corporation. All rights reserved.
00027 
00028 #ifndef NX_RENDER_MESH_ACTOR_H
00029 #define NX_RENDER_MESH_ACTOR_H
00030 
00036 #include "NxApexActor.h"
00037 #include "NxApexRenderable.h"
00038 #include "NxUserRenderResourceManager.h"    // For NxRenderCullMode
00039 #include "foundation/PxVec3.h"
00040 
00041 namespace physx
00042 {
00043 namespace apex
00044 {
00045 
00046 PX_PUSH_PACK_DEFAULT
00047 
00048 class NxUserRenderInstanceBuffer;
00049 
00053 struct NxRenderMeshActorRaycastFlags
00054 {
00058     enum Enum
00059     {
00060         VISIBLE_PARTS = (1 << 0),
00061         INVISIBLE_PARTS =   (1 << 1),
00062 
00063         ALL_PARTS =         VISIBLE_PARTS | INVISIBLE_PARTS
00064     };
00065 };
00066 
00070 struct NxRenderMeshActorRaycastHitData
00071 {
00075     physx::PxF32    time;
00076 
00080     physx::PxU32    partIndex;
00081 
00085     physx::PxU32    submeshIndex;
00086 
00090     physx::PxU32    vertexIndices[3];
00091 
00095     physx::PxVec3   normal;
00096 
00100     physx::PxVec3   tangent;
00101 
00105     physx::PxVec3   binormal;
00106 };
00107 
00108 
00112 class NxRenderMeshActor : public NxApexActor, public NxApexRenderable
00113 {
00114 public:
00115 
00116     enum
00117     {
00118         InvalidInstanceID = 0xFFFFFFFF
00119     };
00120 
00129     virtual bool                    getVisibilities(physx::PxU8* visibilityArray, physx::PxU32 visibilityArraySize) const = 0;
00130 
00134     virtual bool                    setVisibility(bool visible, physx::PxU16 partIndex = 0) = 0;
00135 
00139     virtual bool                    isVisible(physx::PxU16 partIndex = 0) const = 0;
00140 
00144     virtual physx::PxU32            visiblePartCount() const = 0;
00145 
00152     virtual const physx::PxU32*     getVisibleParts() const = 0;
00153 
00157     virtual physx::PxU32            getBoneCount() const = 0;
00158 
00162     virtual void                    setTM(const physx::PxMat44& tm, physx::PxU32 boneIndex = 0) = 0;
00163 
00171     virtual void                    setTM(const physx::PxMat44& tm, const physx::PxVec3& scale, physx::PxU32 boneIndex = 0) = 0;
00172 
00176     virtual void                    updateBounds() = 0;
00177 
00181     virtual const physx::PxMat44    getTM(physx::PxU32 boneIndex = 0) const = 0;
00182 
00187     virtual void                    setReleaseResourcesIfNothingToRender(bool value) = 0;
00188 
00192     virtual void                    setBufferVisibility(bool bufferVisibility) = 0;
00193 
00197     virtual void                    setOverrideMaterial(PxU32 submeshIndex, const char* overrideMaterialName) = 0;
00198 
00206     virtual void                    syncVisibility(bool useLock = true) = 0;
00207 
00211     virtual NxUserRenderInstanceBuffer* getInstanceBuffer() const = 0;
00215     virtual void                    setInstanceBuffer(NxUserRenderInstanceBuffer* instBuf) = 0;
00219     virtual void                    setMaxInstanceCount(physx::PxU32 count) = 0;
00226     virtual void                    setInstanceBufferRange(physx::PxU32 from, physx::PxU32 count) = 0;
00227 
00245     virtual bool                    rayCast(NxRenderMeshActorRaycastHitData& hitData,
00246                                             const physx::PxVec3& worldOrig, const physx::PxVec3& worldDisp,
00247                                             NxRenderMeshActorRaycastFlags::Enum flags = NxRenderMeshActorRaycastFlags::VISIBLE_PARTS,
00248                                             NxRenderCullMode::Enum winding = NxRenderCullMode::CLOCKWISE,
00249                                             physx::PxI32 partIndex = -1) const = 0;
00250 
00251 protected:
00252 
00253     virtual                         ~NxRenderMeshActor() {}
00254 };
00255 
00256 PX_POP_PACK
00257 
00258 }
00259 } // end namespace physx::apex
00260 
00261 #endif // NX_RENDER_MESH_ACTOR_H

Generated on Mon Apr 28 2014 08:01:35

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