Renderable mesh (dynamic data associated with RenderMeshAsset) More...
#include <RenderMeshActor.h>
Public Types | |
enum | { InvalidInstanceID = 0xFFFFFFFF } |
Public Member Functions | |
virtual bool | getVisibilities (uint8_t *visibilityArray, uint32_t visibilityArraySize) const =0 |
Returns the visibilities of all mesh parts in the given array. | |
virtual bool | setVisibility (bool visible, uint16_t partIndex=0)=0 |
Set the visibility of the indexed part. Returns true iff the visibility for the part is changed by this operation. | |
virtual bool | isVisible (uint16_t partIndex=0) const =0 |
Returns the visibility of the indexed part. | |
virtual uint32_t | visiblePartCount () const =0 |
Returns the number of visible parts. | |
virtual const uint32_t * | getVisibleParts () const =0 |
Returns an array of visible part indices. | |
virtual uint32_t | getBoneCount () const =0 |
Returns the number of bones used by this render mesh. | |
virtual void | setTM (const PxMat44 &tm, uint32_t boneIndex=0)=0 |
Sets the local-to-world transform for the indexed bone. The transform need not be orthonormal. | |
virtual void | setTM (const PxMat44 &tm, const PxVec3 &scale, uint32_t boneIndex=0)=0 |
Same as setTM(), but assumes tm is pure rotation. | |
virtual void | updateBounds ()=0 |
Update the axis-aligned bounding box which encloses all visible parts in their world-transformed poses. | |
virtual const PxMat44 | getTM (uint32_t boneIndex=0) const =0 |
Returns the local-to-world transform for the indexed bone. | |
virtual void | setReleaseResourcesIfNothingToRender (bool value)=0 |
If the number of visible parts becomes 0, or if instancing and the number of instances becomes 0, then release resources if this bool is true. | |
virtual void | setBufferVisibility (bool bufferVisibility)=0 |
If this set to true, render visibility will not be updated until the user calls syncVisibility(). | |
virtual void | setOverrideMaterial (uint32_t submeshIndex, const char *overrideMaterialName)=0 |
Sets the override material for the submesh with the given index. | |
virtual void | syncVisibility (bool useLock=true)=0 |
Sync render visibility with that set by the user. Only needed if bufferVisibility(true) is called, or bufferVisibility = true in the actor's descriptor. | |
virtual UserRenderInstanceBuffer * | getInstanceBuffer () const =0 |
get the user-provided instance buffer. | |
virtual void | setInstanceBuffer (UserRenderInstanceBuffer *instBuf)=0 |
applies the user-provided instance buffer to all submeshes. | |
virtual void | setMaxInstanceCount (uint32_t count)=0 |
allows the user to change the max instance count in the case that the instance buffer was changed | |
virtual void | setInstanceBufferRange (uint32_t from, uint32_t count)=0 |
sets the range for the instance buffer | |
virtual bool | rayCast (RenderMeshActorRaycastHitData &hitData, const PxVec3 &worldOrig, const PxVec3 &worldDisp, RenderMeshActorRaycastFlags::Enum flags=RenderMeshActorRaycastFlags::VISIBLE_PARTS, RenderCullMode::Enum winding=RenderCullMode::CLOCKWISE, int32_t partIndex=-1) const =0 |
Detailed Description
Renderable mesh (dynamic data associated with RenderMeshAsset)
Member Function Documentation
virtual bool nvidia::apex::RenderMeshActor::getVisibilities | ( | uint8_t * | visibilityArray, |
uint32_t | visibilityArraySize | ||
) | const [pure virtual] |
Returns the visibilities of all mesh parts in the given array.
The user must supply the array size. If the size is less than the part count, then the list will be truncated to fit the given array.
Returns true if any of the visibility values in visibilityArray are changed.
virtual const uint32_t* nvidia::apex::RenderMeshActor::getVisibleParts | ( | ) | const [pure virtual] |
Returns an array of visible part indices.
The size of this array is given by visiblePartCount(). Note: the indices are in an arbitrary order.
virtual bool nvidia::apex::RenderMeshActor::rayCast | ( | RenderMeshActorRaycastHitData & | hitData, |
const PxVec3 & | worldOrig, | ||
const PxVec3 & | worldDisp, | ||
RenderMeshActorRaycastFlags::Enum | flags = RenderMeshActorRaycastFlags::VISIBLE_PARTS , |
||
RenderCullMode::Enum | winding = RenderCullMode::CLOCKWISE , |
||
int32_t | partIndex = -1 |
||
) | const [pure virtual] |
Returns true if and only if a part is hit matching various criteria given in the function parameters. If a part is hit, the hitData field contains information about the ray intersection. (hitData may be modified even if the function returns false.) hitData (output) = information about the mesh at the hitpoint. See RenderMeshActorRaycastHitData. worldOrig = the origin of the ray in world space worldDisp = the displacement of the ray in world space (need not be normalized) flags = raycast control flags (see RenderMeshActorRaycastFlags) winding = winding filter for hit triangle. If RenderCullMode::CLOCKWISE or RenderCullMode::COUNTER_CLOCKWISE, then triangles will be assumed to have that winding, and will only contribute to the raycast if front-facing. If RenderCullMode::NONE, then all triangles will contribute. partIndex = If -1, then all mesh parts will be raycast, and the result returned for the earliest hit. Otherwise only the part indexed by partIndex will be raycast.
N.B. Currently only works for static (unskinned) and one transform per-part, single-weighted vertex skinning.
virtual void nvidia::apex::RenderMeshActor::setInstanceBufferRange | ( | uint32_t | from, |
uint32_t | count | ||
) | [pure virtual] |
sets the range for the instance buffer
- Parameters:
-
from the position in the buffer (measured in number of elements) to start reading from count number of instances to be rendered. Must not exceed maxInstances for this actor
virtual void nvidia::apex::RenderMeshActor::setTM | ( | const PxMat44 & | tm, |
const PxVec3 & | scale, | ||
uint32_t | boneIndex = 0 |
||
) | [pure virtual] |
Same as setTM(), but assumes tm is pure rotation.
This can allow some optimization. The user must supply scaling separately. The scale vector is interpreted as the diagonal of a diagonal matrix, applied before the rotation component of tm.
virtual void nvidia::apex::RenderMeshActor::syncVisibility | ( | bool | useLock = true | ) | [pure virtual] |
Sync render visibility with that set by the user. Only needed if bufferVisibility(true) is called, or bufferVisibility = true in the actor's descriptor.
If useLock == true, the RenderMeshActor's lock is used during the sync.
The documentation for this class was generated from the following file:
Generated on Fri Dec 15 2017 13:58:40
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.