16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 19:49:19 +02:00

scale/endscale/localscale per node model

This commit is contained in:
2026-05-10 13:12:49 +02:00
parent 587077629f
commit 3419666070
9 changed files with 277 additions and 31 deletions

View File

@@ -143,6 +143,26 @@ public:
glm::vec3
Angles() const {
return vAngle; }
// per-axis scale, applied between rotation and the submodel-local transform chain.
// (1,1,1) = unchanged. Set by the `scale`/`endscale` scenario directives or the
// optional `scale <factor>` / `scale <x> <y> <z>` token inside a `node model` block.
// Per-axis values let you stretch a model along a single dimension; uniform input
// (single float) broadcasts to all three axes.
inline
void
Scale( glm::vec3 const &Factor ) {
m_scale = glm::vec3(
Factor.x > 0.0f ? Factor.x : 1.0f,
Factor.y > 0.0f ? Factor.y : 1.0f,
Factor.z > 0.0f ? Factor.z : 1.0f ); }
inline
void
Scale( float const Factor ) {
Scale( glm::vec3( Factor ) ); }
inline
glm::vec3 const &
Scale() const {
return m_scale; }
// members
std::list<std::shared_ptr<TAnimContainer>> m_animlist;
@@ -169,6 +189,7 @@ public:
std::shared_ptr<TAnimContainer> pRoot; // pojemniki sterujące, tylko dla aniomowanych submodeli
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)
material_data m_materialdata;
std::string asText; // tekst dla wyświetlacza znakowego