feat: implement contact listeners
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "destrum/ObjectModel/GameObject.h"
|
||||
#include "destrum/Util/ModelDoc.h"
|
||||
#include "destrum/Components/Animator.h"
|
||||
#include <components/TriggerLoggerComponent.h>
|
||||
|
||||
|
||||
#include <filesystem>
|
||||
@@ -433,9 +434,15 @@ void LightKeeper::customInit()
|
||||
sphereMaterial = resources.materials().addSimpleColorMaterial({0.5f, 0.3f, 0.8f}, "Blue");
|
||||
|
||||
|
||||
auto obj = scene.CreateGameObject("GameObject");
|
||||
auto printComp = obj->AddComponent<PrintComponent>();
|
||||
printComp->SetMessage("Testing");
|
||||
// Trigger zone: a static box with a TriggerLoggerComponent.
|
||||
// Spheres spawned via the "Spawn ball" button fall through it.
|
||||
auto triggerObj = scene.CreateGameObject("TriggerBox");
|
||||
auto triggerBox = triggerObj->AddComponent<BoxCollider>(glm::vec3{3.0f, 3.0f, 3.0f});
|
||||
triggerBox->SetTrigger(true);
|
||||
auto triggerRb = triggerObj->AddComponent<Rigidbody>();
|
||||
triggerRb->SetType(RigidbodyType::Static);
|
||||
triggerObj->AddComponent<TriggerLoggerComponent>();
|
||||
triggerObj->GetTransform().SetWorldPosition({0.0f, 0.0f, 0.0f});
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user