flag.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #include "flag.h"
  2. #include <qmatrix4x4.h>
  3. #include <qvectornd.h>
  4. namespace Render::Geom {
  5. namespace {
  6. const QMatrix4x4 k_identity_matrix;
  7. }
  8. auto Flag::create(float world_x, float world_z, const QVector3D &flagColor,
  9. const QVector3D &poleColor,
  10. float scale) -> Flag::FlagMatrices {
  11. FlagMatrices result;
  12. result.pennantColor = flagColor;
  13. result.poleColor = poleColor;
  14. result.pole = k_identity_matrix;
  15. result.pole.translate(world_x, (0.15F + 0.35F) * scale, world_z);
  16. result.pole.scale(0.05F * scale, 0.70F * scale, 0.05F * scale);
  17. result.pennant = k_identity_matrix;
  18. result.pennant.translate(world_x + 0.20F * scale, (0.60F + 0.15F) * scale,
  19. world_z);
  20. result.pennant.scale(0.38F * scale, 0.28F * scale, 0.03F * scale);
  21. result.finial = k_identity_matrix;
  22. result.finial.translate(world_x, (0.90F + 0.15F) * scale, world_z);
  23. result.finial.scale(0.10F * scale, 0.10F * scale, 0.10F * scale);
  24. return result;
  25. }
  26. } // namespace Render::Geom