Documentation for module: Graphics
Former-commit-id: 1757c33318443aade1dc38e16d053240d7dc885c
This commit is contained in:
@@ -7,16 +7,43 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
/*!
|
||||
* \ingroup graphics
|
||||
* \class Nz::InstancedRenderable
|
||||
* \brief Graphics class that represents an instancer renderable
|
||||
*
|
||||
* \remark This class is abstract
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Destructs the object and calls OnInstancedRenderableRelease
|
||||
*
|
||||
* \see OnInstancedRenderableRelease
|
||||
*/
|
||||
|
||||
InstancedRenderable::~InstancedRenderable()
|
||||
{
|
||||
OnInstancedRenderableRelease(this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Culls the instanced if not in the frustum
|
||||
* \return true If instanced is in the frustum
|
||||
*
|
||||
* \param frustum Symbolizing the field of view
|
||||
* \param transformMatrix Matrix transformation for our object
|
||||
*/
|
||||
|
||||
bool InstancedRenderable::Cull(const Frustumf& frustum, const InstanceData& instanceData) const
|
||||
{
|
||||
return frustum.Contains(instanceData.volume);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the bounding volume
|
||||
* \return Bounding volume of the instanced
|
||||
*/
|
||||
|
||||
const BoundingVolumef& InstancedRenderable::GetBoundingVolume() const
|
||||
{
|
||||
EnsureBoundingVolumeUpdated();
|
||||
@@ -24,11 +51,30 @@ namespace Nz
|
||||
return m_boundingVolume;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Invalidates data for instanced
|
||||
*
|
||||
* \param instanceData Pointer to data of instances
|
||||
* \param flags Flags for the instances
|
||||
*
|
||||
* \remark Produces a NazaraAssert if instanceData is invalid
|
||||
*/
|
||||
|
||||
void InstancedRenderable::InvalidateData(InstanceData* instanceData, UInt32 flags) const
|
||||
{
|
||||
NazaraAssert(instanceData, "Invalid instance data");
|
||||
|
||||
instanceData->flags |= flags;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Updates the bounding volume
|
||||
*
|
||||
* \param instanceData Pointer to data of instances
|
||||
*
|
||||
* \remark Produces a NazaraAssert if instanceData is invalid
|
||||
*/
|
||||
|
||||
void InstancedRenderable::UpdateBoundingVolume(InstanceData* instanceData) const
|
||||
{
|
||||
NazaraAssert(instanceData, "Invalid instance data");
|
||||
@@ -37,6 +83,14 @@ namespace Nz
|
||||
instanceData->volume.Update(instanceData->transformMatrix);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Updates the instance data
|
||||
*
|
||||
* \param instanceData Pointer to data of instances
|
||||
*
|
||||
* \remark Produces a NazaraAssert if instanceData is invalid
|
||||
*/
|
||||
|
||||
void InstancedRenderable::UpdateData(InstanceData* instanceData) const
|
||||
{
|
||||
NazaraAssert(instanceData, "Invalid instance data");
|
||||
|
||||
Reference in New Issue
Block a user