APEX Framework: RenderMeshActor.h Source File

NVIDIA APEX

RenderMeshActor.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef RENDER_MESH_ACTOR_H
00013 #define RENDER_MESH_ACTOR_H
00014 
00020 #include "Actor.h"
00021 #include "Renderable.h"
00022 #include "UserRenderResourceManager.h"  // For RenderCullMode
00023 #include "foundation/PxVec3.h"
00024 
00025 namespace nvidia
00026 {
00027 namespace apex
00028 {
00029 
00030 PX_PUSH_PACK_DEFAULT
00031 
00032 class UserRenderInstanceBuffer;
00033 
00037 struct RenderMeshActorRaycastFlags
00038 {
00042     enum Enum
00043     {
00044         VISIBLE_PARTS = (1 << 0),
00045         INVISIBLE_PARTS =   (1 << 1),
00046 
00047         ALL_PARTS =         VISIBLE_PARTS | INVISIBLE_PARTS
00048     };
00049 };
00050 
00054 struct RenderMeshActorRaycastHitData
00055 {
00059     float       time;
00060 
00064     uint32_t    partIndex;
00065 
00069     uint32_t    submeshIndex;
00070 
00074     uint32_t    vertexIndices[3];
00075 
00079     PxVec3      normal;
00080 
00084     PxVec3      tangent;
00085 
00089     PxVec3      binormal;
00090 };
00091 
00092 
00096 class RenderMeshActor : public Actor, public Renderable
00097 {
00098 public:
00099 
00100     enum
00101     {
00102         InvalidInstanceID = 0xFFFFFFFF
00103     };
00104 
00113     virtual bool                    getVisibilities(uint8_t* visibilityArray, uint32_t visibilityArraySize) const = 0;
00114 
00118     virtual bool                    setVisibility(bool visible, uint16_t partIndex = 0) = 0;
00119 
00123     virtual bool                    isVisible(uint16_t partIndex = 0) const = 0;
00124 
00128     virtual uint32_t                visiblePartCount() const = 0;
00129 
00136     virtual const uint32_t*         getVisibleParts() const = 0;
00137 
00141     virtual uint32_t                getBoneCount() const = 0;
00142 
00146     virtual void                    setTM(const PxMat44& tm, uint32_t boneIndex = 0) = 0;
00147 
00155     virtual void                    setTM(const PxMat44& tm, const PxVec3& scale, uint32_t boneIndex = 0) = 0;
00156 
00160     virtual void                    updateBounds() = 0;
00161 
00165     virtual const PxMat44           getTM(uint32_t boneIndex = 0) const = 0;
00166 
00171     virtual void                    setReleaseResourcesIfNothingToRender(bool value) = 0;
00172 
00176     virtual void                    setBufferVisibility(bool bufferVisibility) = 0;
00177 
00181     virtual void                    setOverrideMaterial(uint32_t submeshIndex, const char* overrideMaterialName) = 0;
00182 
00190     virtual void                    syncVisibility(bool useLock = true) = 0;
00191 
00195     virtual UserRenderInstanceBuffer* getInstanceBuffer() const = 0;
00199     virtual void                    setInstanceBuffer(UserRenderInstanceBuffer* instBuf) = 0;
00203     virtual void                    setMaxInstanceCount(uint32_t count) = 0;
00210     virtual void                    setInstanceBufferRange(uint32_t from, uint32_t count) = 0;
00211 
00229     virtual bool                    rayCast(RenderMeshActorRaycastHitData& hitData,
00230                                             const PxVec3& worldOrig, const PxVec3& worldDisp,
00231                                             RenderMeshActorRaycastFlags::Enum flags = RenderMeshActorRaycastFlags::VISIBLE_PARTS,
00232                                             RenderCullMode::Enum winding = RenderCullMode::CLOCKWISE,
00233                                             int32_t partIndex = -1) const = 0;
00234 
00235 protected:
00236 
00237     virtual                         ~RenderMeshActor() {}
00238 };
00239 
00240 PX_POP_PACK
00241 
00242 }
00243 } // end namespace nvidia::apex
00244 
00245 #endif // RENDER_MESH_ACTOR_H

Generated on Fri Dec 15 2017 13:58:35
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.