DecalManager
Engine/source/T3D/decal/decalManager.h
Manage decals in the scene.
Classes:
Decal Addition
Decal Removal
removeDecal(DecalInstance * inst)
Public Types
Parent
Public Attributes
Protected Attributes
The clipper we keep around between decal updates to avoid excessive memory allocations.
bool
Vector< GFXVertexBufferHandle< DecalVertex > * >
Vector< GFXVertexBufferHandle< DecalVertex > * >
Protected Static Attributes
bool
Whether to render visualizations for debugging in the editor.
bool
bool
Protected Functions
_allocBuffers(DecalInstance * inst)
bool
_freeBuffers(DecalInstance * inst)
_getSizeClass(DecalInstance * inst)
Returns index used to index into the correct sized FreeListChunker for allocating vertex and index arrays.
_handleZoningChangedEvent(SceneZoneSpaceManager * zoneManager)
_renderDecalSpheres(ObjectRenderInst * inst, SceneRenderState * state, BaseMatInstance * overrideMat)
bool
Called when this is added to a SceneManager.
Called when this is removed from its current SceneManager.
prepRenderImage(SceneRenderState * state)
Called when the SceneManager is ready for the registration of render instances.
Public Functions
getClosestDecal(const Point3F & pos)
bool
isDirty()
Returns true if changes have been made since the last load/save.
bool
loadDecals(const UTF8 * fileName)
notifyDecalModified(DecalInstance * inst)
saveDecals(const UTF8 * fileName)
Public Static Functions
Detailed Description
Manage decals in the scene.
Decal Addition
addDecal(const Point3F & pos, const Point3F & normal, F32 rotAroundNormal, DecalData * decalData, F32 decalScale, S32 decalTexIndex, U8 flags)
Adds a decal using a normal and a rotation.
Parameters:
pos | The 3d position for the decal center. |
normal | The decal up vector. |
rotAroundNormal | The decal rotation around the normal. |
decalData | The datablock which defines this decal. |
decalScale | A scalar for adjusting the default size of the decal. |
decalTexIndex | Selects the texture coord index within the decal data to use. If it is less than zero then a random coord is selected. |
flags | The decal flags. |
addDecal(const Point3F & pos, const Point3F & normal, const Point3F & tangent, DecalData * decalData, F32 decalScale, S32 decalTexIndex, U8 flags)
Adds a decal using a normal and a tangent.
Parameters:
pos | The 3d position for the decal center. |
normal | The decal up vector. |
tanget | The decal right vector. |
decalData | The datablock which defines this decal. |
decalScale | A scalar for adjusting the default size of the decal. |
decalTexIndex | Selects the texture coord index within the decal data to use. If it is less than zero then a random coord is selected. |
flags | The decal flags. |
Decal Removal
removeDecal(DecalInstance * inst)
Public Types
typedef SceneObject Parent
Public Attributes
Vector< DecalInstance * > mDecalInstanceVec
Protected Attributes
FreeListChunkerUntyped * mChunkers [3]
Signal< void() > mClearDataSignal
ClippedPolyList mClipper
The clipper we keep around between decal updates to avoid excessive memory allocations.
Resource< DecalDataFile > mData
StringTableEntry mDataFileName
Vector< DecalInstance * > mDecalQueue
bool mDirty
Vector< GFXPrimitiveBufferHandle * > mPBPool
Vector< GFXPrimitiveBufferHandle * > mPBs
Vector< GFXVertexBufferHandle< DecalVertex > * > mVBPool
Vector< GFXVertexBufferHandle< DecalVertex > * > mVBs
Protected Static Attributes
bool smDebugRender
Whether to render visualizations for debugging in the editor.
F32 smDecalLifeTimeScale
bool smDecalsOn
const U32 smMaxIndices
const U32 smMaxVerts
bool smPoolBuffers
Protected Functions
_allocBuffers(DecalInstance * inst)
_createDataFile()
_freeBuffers(DecalInstance * inst)
_freePools()
_generateConvexHull(const Vector< Point3F > & points, Vector< Point3F > * outPoints)
_generateWindingOrder(const Point3F & cornerPoint, Vector< Point3F > * sortPoints)
_getSizeClass(DecalInstance * inst)
Returns index used to index into the correct sized FreeListChunker for allocating vertex and index arrays.
_handleZoningChangedEvent(SceneZoneSpaceManager * zoneManager)
_renderDecalSpheres(ObjectRenderInst * inst, SceneRenderState * state, BaseMatInstance * overrideMat)
isLeft(const Point3F & P0, const Point3F & P1, const Point3F & P2)
onSceneAdd()
Reimplemented from: SceneObject
onSceneRemove()
Reimplemented from: SceneObject
prepRenderImage(SceneRenderState * state)
Reimplemented from: SceneObject
Public Functions
DecalManager()
~DecalManager()
clearData()
clipDecal(DecalInstance * decal, Vector< Point3F > * edgeVerts, const Point2F * clipDepth)
DECLARE_CONOBJECT(DecalManager )
getClearDataSignal()
getClosestDecal(const Point3F & pos)
getDecal(S32 id)
getDecalDataFile()
isDirty()
Returns true if changes have been made since the last load/save.
loadDecals(const UTF8 * fileName)
notifyDecalModified(DecalInstance * inst)
raycast(const Point3F & start, const Point3F & end, bool savedDecalsOnly)
Return the closest DecalInstance hit by a ray.
saveDecals(const UTF8 * fileName)