Example Collider3D implementation

This commit is contained in:
2023-02-24 22:51:31 -08:00
parent cf222c469c
commit d5fdc29cb4
10 changed files with 104 additions and 81 deletions

View File

@ -10,6 +10,7 @@
#include "scene/components/display/MeshHost.hpp"
#include "scene/components/display/material/SimpleTexturedMaterial.hpp"
#include "scene/components/example/ExampleSpin.hpp"
#include "scene/components/physics/3d/CubeCollider.hpp"
namespace Dawn {
class SimpleSpinningCubePrefab :
@ -31,8 +32,9 @@ namespace Dawn {
void prefabInit(AssetManager *man) override {
auto meshRenderer = this->addComponent<MeshRenderer>();
meshHost = this->addComponent<MeshHost>();
auto spinning = this->addComponent<ExampleSpin>();
material = this->addComponent<SimpleTexturedMaterial>();
auto spinning = this->addComponent<ExampleSpin>();
auto collider = this->addComponent<CubeCollider>();
meshHost->mesh.createBuffers(CUBE_VERTICE_COUNT, CUBE_INDICE_COUNT);
CubeMesh::buffer(&meshHost->mesh, glm::vec3(-0.5f, -0.5f, -0.5f), glm::vec3(1, 1, 1), 0, 0);