Ndk/GraphicsComponent: Add BoundingVolume
Former-commit-id: e053b21e5495e097a752c17bf2f9367f55b78d78
This commit is contained in:
@@ -26,11 +26,15 @@ namespace Ndk
|
||||
|
||||
inline void Attach(Nz::InstancedRenderableRef renderable, int renderOrder = 0);
|
||||
|
||||
inline void EnsureBoundingVolumeUpdate() const;
|
||||
inline void EnsureTransformMatrixUpdate() const;
|
||||
|
||||
inline const Nz::BoundingVolumef& GetBoundingVolume() const;
|
||||
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
private:
|
||||
inline void InvalidateBoundingVolume();
|
||||
void InvalidateRenderableData(const Nz::InstancedRenderable* renderable, Nz::UInt32 flags, unsigned int index);
|
||||
inline void InvalidateRenderables();
|
||||
inline void InvalidateTransformMatrix();
|
||||
@@ -41,6 +45,7 @@ namespace Ndk
|
||||
void OnDetached() override;
|
||||
void OnNodeInvalidated(const Nz::Node* node);
|
||||
|
||||
void UpdateBoundingVolume() const;
|
||||
void UpdateTransformMatrix() const;
|
||||
|
||||
NazaraSlot(Nz::Node, OnNodeInvalidation, m_nodeInvalidationSlot);
|
||||
@@ -61,7 +66,9 @@ namespace Ndk
|
||||
};
|
||||
|
||||
std::vector<Renderable> m_renderables;
|
||||
mutable Nz::BoundingVolumef m_boundingVolume;
|
||||
mutable Nz::Matrix4f m_transformMatrix;
|
||||
mutable bool m_boundingVolumeUpdated;
|
||||
mutable bool m_transformMatrixUpdated;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user