17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-28 14:37:29 +01:00

perf(instancing): cache instance rotation and group lod bands linearly

This commit is contained in:
2026-10-01 12:43:07 +02:00
parent 4eabf3c3b5
commit 2130d175e9
4 changed files with 93 additions and 78 deletions

View File

@@ -172,6 +172,8 @@ public:
public:
// methods
void RaPrepare(); // ustawienie animacji egzemplarza na wzorcu
// rotation and scale of the instance as a matrix: rotate y * rotate x * rotate z * scale
glm::mat4 const &rotation_scale();
void RaAnimate( unsigned int const Framestamp ); // przeliczenie animacji egzemplarza
// radius() subclass details, calculates node's bounding radius
@@ -190,6 +192,12 @@ public:
TModel3d *pModel { nullptr };
glm::vec3 vAngle; // bazowe obroty egzemplarza względem osi
glm::vec3 m_scale { 1.0f, 1.0f, 1.0f }; // per-axis scale (see Scale() accessors above)
// rotation and scale part of the instance transform, cached for the instanced render path.
// rebuilt by rotation_scale() whenever the angles or the scale differ from the ones it was built from
glm::mat4 m_rotationscale { 1.0f };
glm::vec3 m_rotationscaleangles { 0.0f, 0.0f, 0.0f };
glm::vec3 m_rotationscalescale { 1.0f, 1.0f, 1.0f };
bool m_rotationscalevalid { false };
material_data m_materialdata;
std::string asText; // tekst dla wyświetlacza znakowego