Former-commit-id: 2741c465f9acb4a190de0a29db4a3853700461fd [formerly be67ee144fe577767a11be40f79f3f2e85d030c0] [formerly 302a6d2c8a3222401890d217f01c24a03db9ebc8 [formerly 762367a1144c340b84b61eee9d7577dcdaf717c6]] Former-commit-id: 6504b78e4ce04d8eea0c10e7ce27bdda4b95f2dc [formerly 8d0fba6c2dde5dcc43cbea0e6e5fd2980af4b801] Former-commit-id: 75d1deaf21035eb1b630705017462b9e059149a9
85 lines
1.9 KiB
C++
85 lines
1.9 KiB
C++
// Copyright (C) 2015 Jérôme Leclercq
|
|
// This file is part of the "Nazara Engine - Graphics module"
|
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
|
|
|
namespace Nz
|
|
{
|
|
/*!
|
|
* \brief Constructs a InstancedRenderable object by default
|
|
*/
|
|
inline InstancedRenderable::InstancedRenderable() :
|
|
m_boundingVolumeUpdated(false)
|
|
{
|
|
}
|
|
|
|
/*!
|
|
* \brief Constructs a InstancedRenderable object by assignation
|
|
*
|
|
* \param renderable InstancedRenderable to copy into this
|
|
*/
|
|
inline InstancedRenderable::InstancedRenderable(const InstancedRenderable& renderable) :
|
|
RefCounted(),
|
|
m_boundingVolume(renderable.m_boundingVolume),
|
|
m_boundingVolumeUpdated(renderable.m_boundingVolumeUpdated)
|
|
{
|
|
}
|
|
|
|
/*!
|
|
* \brief Ensures that the bounding volume is up to date
|
|
*/
|
|
|
|
inline void InstancedRenderable::EnsureBoundingVolumeUpdated() const
|
|
{
|
|
if (!m_boundingVolumeUpdated)
|
|
UpdateBoundingVolume();
|
|
}
|
|
|
|
/*!
|
|
* \brief Invalidates the bounding volume
|
|
*/
|
|
|
|
inline void InstancedRenderable::InvalidateBoundingVolume()
|
|
{
|
|
m_boundingVolumeUpdated = false;
|
|
|
|
OnInstancedRenderableInvalidateBoundingVolume(this);
|
|
}
|
|
|
|
/*!
|
|
* \brief Invalidates the instance data based on flags
|
|
*
|
|
* \param flags Flags to invalidate
|
|
*/
|
|
|
|
inline void InstancedRenderable::InvalidateInstanceData(UInt32 flags)
|
|
{
|
|
OnInstancedRenderableInvalidateData(this, flags);
|
|
}
|
|
|
|
/*!
|
|
* \brief Sets the current instanced renderable with the content of the other one
|
|
* \return A reference to this
|
|
*
|
|
* \param renderable The other InstancedRenderable
|
|
*/
|
|
|
|
inline InstancedRenderable& InstancedRenderable::operator=(const InstancedRenderable& renderable)
|
|
{
|
|
m_boundingVolume = renderable.m_boundingVolume;
|
|
m_boundingVolumeUpdated = renderable.m_boundingVolumeUpdated;
|
|
|
|
return *this;
|
|
}
|
|
|
|
/*!
|
|
* \brief Updates the bounding volume
|
|
*/
|
|
|
|
inline void InstancedRenderable::UpdateBoundingVolume() const
|
|
{
|
|
MakeBoundingVolume();
|
|
|
|
m_boundingVolumeUpdated = true;
|
|
}
|
|
}
|