Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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"
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 }
00260
00261 #endif // NX_RENDER_MESH_ACTOR_H