Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

StaticMesh.cpp 783B

1234567891011121314151617181920212223242526272829303132333435
  1. /*!
  2. * \file src/StaticMesh.cpp
  3. * \brief Static Model Meshes
  4. *
  5. * \author xythobuz
  6. */
  7. #include "global.h"
  8. #include "World.h"
  9. #include "StaticMesh.h"
  10. #include "imgui/imgui.h"
  11. bool StaticMesh::showBoundingBox = false;
  12. BoundingSphere& StaticMesh::getBoundingSphere() {
  13. return World::getMesh(mesh).getBoundingSphere();
  14. }
  15. void StaticMesh::display(glm::mat4 MVP) {
  16. World::getMesh(mesh).display(MVP);
  17. if (showBoundingBox) {
  18. bbox1->display(MVP, glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
  19. bbox2->display(MVP, glm::vec3(1.0f, 0.0f, 1.0f), glm::vec3(0.0f, 0.0f, 1.0f));
  20. }
  21. }
  22. void StaticMesh::displayUI() {
  23. ImGui::Text("%03d", id);
  24. ImGui::NextColumn();
  25. ImGui::Text("%03d // and two bboxes", mesh);
  26. ImGui::NextColumn();
  27. }