From 249e26dcd5c008baccbddcbea7f6f3dac45446ee Mon Sep 17 00:00:00 2001 From: "a.pilote" Date: Thu, 14 Jul 2022 17:45:06 -0400 Subject: [PATCH] Removed euler, only quaternion and dirty flag --- Editor/src/ComponentsPanel/TransformPanel.h | 46 +++++++++-- Editor/src/Windows/EditorInterface.cpp | 6 +- Nuake/Maths.cpp | 13 ++++ Nuake/src/Core/Maths.h | 2 + Nuake/src/Core/Physics/BulletDebugDrawer.cpp | 4 +- Nuake/src/Rendering/Renderer.cpp | 2 +- .../Components/CharacterControllerComponent.h | 2 +- .../Scene/Components/RigidbodyComponent.cpp | 4 +- .../Scene/Components/TransformComponent.cpp | 76 +++++++++++++++++-- .../src/Scene/Components/TransformComponent.h | 38 ++++++++-- Nuake/src/Scene/Scene.cpp | 2 +- Nuake/src/Scene/Systems/PhysicsSystem.cpp | 12 +-- Nuake/src/Scene/Systems/QuakeMapBuilder.cpp | 14 ++-- Nuake/src/Scene/Systems/TransformSystem.cpp | 37 ++++----- Nuake/src/Scripting/Modules/SceneModule.h | 11 +-- 15 files changed, 203 insertions(+), 66 deletions(-) create mode 100644 Nuake/Maths.cpp diff --git a/Editor/src/ComponentsPanel/TransformPanel.h b/Editor/src/ComponentsPanel/TransformPanel.h index 7eba2c65..d6c797e5 100644 --- a/Editor/src/ComponentsPanel/TransformPanel.h +++ b/Editor/src/ComponentsPanel/TransformPanel.h @@ -10,6 +10,7 @@ public: void Draw(Nuake::Entity entity) override { + using namespace Nuake; Nuake::TransformComponent& component = entity.GetComponent(); BeginComponentTable(TRANSFORM, Nuake::TransformComponent); { @@ -17,30 +18,63 @@ public: ImGui::Text("Translation"); ImGui::TableNextColumn(); - ImGuiHelper::DrawVec3("Translation", &component.Translation); + Vector3 position = component.GetLocalPosition(); + ImGuiHelper::DrawVec3("Translation", &position); + if (position != component.GetLocalPosition()) + component.SetLocalPosition(position); + ImGui::TableNextColumn(); - ComponentTableReset(component.Translation, Nuake::Vector3(0, 0, 0)); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); + std::string resetLabel = std::string(ICON_FA_UNDO) + "##ResetTranslation"; + if (ImGui::Button(resetLabel.c_str())) + component.SetLocalPosition(Vector3(0, 0, 0)); + + ImGui::PopStyleColor(); } ImGui::TableNextColumn(); { ImGui::Text("Rotation"); ImGui::TableNextColumn(); - //ImGuiHelper::DrawVec3("Rotation", &component.Rotation); + Vector3 eulerAngles = glm::eulerAngles(component.GetLocalRotation()); + ImGuiHelper::DrawVec3("Rotation", &eulerAngles); + + Vector3 eulerLocal = glm::eulerAngles(component.GetLocalRotation()); + if (eulerLocal != eulerAngles) + { + Quat rotation = QuatFromEuler(eulerAngles.x, eulerAngles.y, eulerAngles.z); + //component.SetLocalRotation(rotation); + } ImGui::TableNextColumn(); - //ComponentTableReset(component.Rotation, Nuake::Vector3(0, 0, 0)); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); + std::string resetLabel = std::string(ICON_FA_UNDO) + "##ResetRotation"; + if (ImGui::Button(resetLabel.c_str())) + { + component.SetLocalRotation(Quat(1, 0, 0, 0)); + } + ImGui::PopStyleColor(); } ImGui::TableNextColumn(); { ImGui::Text("Scale"); ImGui::TableNextColumn(); - ImGuiHelper::DrawVec3("Scale", &component.Scale); + Vector3 localScale = component.GetLocalScale(); + ImGuiHelper::DrawVec3("Scale", &localScale); + + if (localScale != component.GetLocalScale()) + component.SetLocalScale(localScale); + ImGui::TableNextColumn(); - ComponentTableReset(component.Scale, Nuake::Vector3(1, 1, 1)); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); + std::string resetLabel = std::string(ICON_FA_UNDO) + "##ResetScale"; + if (ImGui::Button(resetLabel.c_str())) + component.SetLocalScale(Vector3(1, 1, 1)); + + ImGui::PopStyleColor(); } } EndComponentTable(); diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index f18865b9..623a5709 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -122,8 +122,8 @@ namespace Nuake { if (ImGuizmo::IsUsing()) { - tc.LocalTransform = transform; - tc.GlobalTransform = transform; + tc.SetLocalTransform(transform); + tc.SetGlobalTransform(transform); //Entity currentParent = Selection.Entity; //if (parent.HasParent) @@ -233,7 +233,7 @@ namespace Nuake { if (ImGui::Selectable("Focus camera")) { Ref editorCam = Engine::GetCurrentScene()->m_EditorCamera; - editorCam->Translation = entity.GetComponent().Translation; + editorCam->Translation = entity.GetComponent().GetGlobalPosition(); Vector3 camDirection = entity.GetComponent().CameraInstance->GetDirection(); editorCam->SetDirection(camDirection); } diff --git a/Nuake/Maths.cpp b/Nuake/Maths.cpp new file mode 100644 index 00000000..64b593f3 --- /dev/null +++ b/Nuake/Maths.cpp @@ -0,0 +1,13 @@ +#include "src/Core/Maths.h" + +namespace Nuake +{ + Quat QuatFromEuler(float x, float y, float z) + { + // Taken from: https://gamedev.stackexchange.com/questions/13436/glm-euler-angles-to-quaternion + Quat QuatAroundX = Quat(x, Vector3(1.0, 0.0, 0.0)); + Quat QuatAroundY = Quat(y, Vector3(0.0, 1.0, 0.0)); + Quat QuatAroundZ = Quat(z, Vector3(0.0, 0.0, 1.0)); + return QuatAroundX * QuatAroundY * QuatAroundZ; + } +} \ No newline at end of file diff --git a/Nuake/src/Core/Maths.h b/Nuake/src/Core/Maths.h index 3e2725a0..58d8ddd4 100644 --- a/Nuake/src/Core/Maths.h +++ b/Nuake/src/Core/Maths.h @@ -16,4 +16,6 @@ namespace Nuake using Color = glm::vec4; using Matrix4 = glm::mat4; using Matrix3 = glm::mat3; + + Quat QuatFromEuler(float x, float y, float z); } diff --git a/Nuake/src/Core/Physics/BulletDebugDrawer.cpp b/Nuake/src/Core/Physics/BulletDebugDrawer.cpp index 6d617623..b59aef84 100644 --- a/Nuake/src/Core/Physics/BulletDebugDrawer.cpp +++ b/Nuake/src/Core/Physics/BulletDebugDrawer.cpp @@ -8,8 +8,8 @@ namespace Nuake { TransformComponent tc = TransformComponent(); - tc.Translation = glm::vec3(from.x(), from.y(), from.z()); - tc.Scale = glm::vec3(1.0f); + //tc.Translation = glm::vec3(from.x(), from.y(), from.z()); + //tc.Scale = glm::vec3(1.0f); //tc.Rotation = glm::vec3(0.0f); glBegin(GL_LINES); diff --git a/Nuake/src/Rendering/Renderer.cpp b/Nuake/src/Rendering/Renderer.cpp index 803ff0b9..541fcaec 100644 --- a/Nuake/src/Rendering/Renderer.cpp +++ b/Nuake/src/Rendering/Renderer.cpp @@ -156,7 +156,7 @@ namespace Nuake int idx = m_Lights.size(); Vector3 direction = light.GetDirection(); - Vector3 pos = transform.GlobalTranslation; + Vector3 pos = transform.GetGlobalPosition(); //light.m_Framebuffer->GetTexture(GL_DEPTH_ATTACHMENT)->Bind(17); diff --git a/Nuake/src/Scene/Components/CharacterControllerComponent.h b/Nuake/src/Scene/Components/CharacterControllerComponent.h index 21d1cd4f..ef3a55bb 100644 --- a/Nuake/src/Scene/Components/CharacterControllerComponent.h +++ b/Nuake/src/Scene/Components/CharacterControllerComponent.h @@ -36,7 +36,7 @@ namespace Nuake { btVector3 pos = CharacterController->m_motionTransform.getOrigin(); glm::vec3 finalPos = glm::vec3(pos.x(), pos.y(), pos.z()); - tc.Translation = finalPos; + tc.SetLocalPosition(finalPos); } }; } diff --git a/Nuake/src/Scene/Components/RigidbodyComponent.cpp b/Nuake/src/Scene/Components/RigidbodyComponent.cpp index 3038f572..61749eb6 100644 --- a/Nuake/src/Scene/Components/RigidbodyComponent.cpp +++ b/Nuake/src/Scene/Components/RigidbodyComponent.cpp @@ -48,7 +48,7 @@ namespace Nuake { glm::vec3 newPosition = m_Rigidbody->GetPosition(); glm::vec3 newRotation = m_Rigidbody->GetRotation(); - tc->Translation = newPosition; + //tc->Translation = newPosition; //tc->Rotation = newRotation; } @@ -59,7 +59,7 @@ namespace Nuake { btTransform newTransform; newTransform.setIdentity(); - newTransform.setOrigin(btVector3(tc->Translation.x, tc->Translation.t, tc->Translation.z)); + //newTransform.setOrigin(btVector3(tc->Translation.x, tc->Translation.t, tc->Translation.z)); btQuaternion quat; //quat.setEulerZYX(tc->Rotation.x, tc->Rotation.y, tc->Rotation.z); diff --git a/Nuake/src/Scene/Components/TransformComponent.cpp b/Nuake/src/Scene/Components/TransformComponent.cpp index 033bcbe3..614d6234 100644 --- a/Nuake/src/Scene/Components/TransformComponent.cpp +++ b/Nuake/src/Scene/Components/TransformComponent.cpp @@ -18,13 +18,67 @@ namespace Nuake GlobalTransform = Matrix4(1); } - void TransformComponent::SetRotation(float x, float y, float z) + void TransformComponent::SetLocalRotation(const Quat& quat) { - Quat QuatAroundX = Quat(1.0, 0.0, 0.0, x); - Quat QuatAroundY = Quat(0.0, 1.0, 0.0, y); - Quat QuatAroundZ = Quat(0.0, 0.0, 1.0, z); - Quat finalOrientation = QuatAroundX * QuatAroundY * QuatAroundZ; - Rotation = finalOrientation; + Rotation = quat; + Dirty = true; + } + + Quat TransformComponent::GetLocalRotation() const + { + return Rotation; + } + + Quat TransformComponent::GetGlobalRotation() const + { + return GlobalRotation; + } + + void TransformComponent::SetGlobalRotation(const Quat& rotation) + { + GlobalRotation = rotation; + } + + Vector3 TransformComponent::GetLocalPosition() const + { + return Translation; + } + + void TransformComponent::SetLocalPosition(const Vector3& position) + { + Translation = position; + Dirty = true; + } + + Vector3 TransformComponent::GetGlobalPosition() const + { + return GlobalTranslation; + } + + void TransformComponent::SetGlobalPosition(const Vector3& position) + { + GlobalTranslation = position; + } + + Vector3 TransformComponent::GetLocalScale() const + { + return Scale; + } + + void TransformComponent::SetLocalScale(const Vector3& scale) + { + Scale = scale; + Dirty = true; + } + + Vector3 TransformComponent::GetGlobalScale() const + { + return GlobalScale; + } + + void TransformComponent::SetGlobalScale(const Vector3& scale) + { + GlobalScale = scale; } Matrix4 TransformComponent::GetGlobalTransform() const @@ -32,8 +86,18 @@ namespace Nuake return GlobalTransform; } + void TransformComponent::SetGlobalTransform(const Matrix4& transform) + { + GlobalTransform = transform; + } + Matrix4 TransformComponent::GetLocalTransform() const { return LocalTransform; } + + void TransformComponent::SetLocalTransform(const Matrix4& transform) + { + LocalTransform = transform; + } } diff --git a/Nuake/src/Scene/Components/TransformComponent.h b/Nuake/src/Scene/Components/TransformComponent.h index a61b66ba..6a972dff 100644 --- a/Nuake/src/Scene/Components/TransformComponent.h +++ b/Nuake/src/Scene/Components/TransformComponent.h @@ -5,9 +5,7 @@ namespace Nuake { class TransformComponent { - public: - bool Dirty = true; - + private: Vector3 Translation; Quat Rotation; Vector3 Scale; @@ -18,20 +16,40 @@ namespace Nuake Matrix4 LocalTransform; Matrix4 GlobalTransform; - + public: + bool Dirty = true; TransformComponent(); Matrix4 GetGlobalTransform() const; - Matrix4 GetLocalTransform() const; + void SetGlobalTransform(const Matrix4& transform); - void SetRotation(float x, float y, float z); + Matrix4 GetLocalTransform() const; + void SetLocalTransform(const Matrix4& transform); + + void SetLocalRotation(const Quat& quat); + Quat GetLocalRotation() const; + + void SetGlobalRotation(const Quat& quat); + Quat GetGlobalRotation() const; + + Vector3 GetLocalPosition() const; + void SetLocalPosition(const Vector3& position); + + Vector3 GetGlobalPosition() const; + void SetGlobalPosition(const Vector3& position); + + void SetLocalScale(const Vector3& scale); + Vector3 GetLocalScale() const; + + void SetGlobalScale(const Vector3& scale); + Vector3 GetGlobalScale() const; json Serialize() { BEGIN_SERIALIZE(); SERIALIZE_VAL_LBL("Type", "TransformComponent"); SERIALIZE_VEC3(Translation); - //SERIALIZE_VEC3(Rotation); + SERIALIZE_VEC4(Rotation); SERIALIZE_VEC3(Scale); END_SERIALIZE(); } @@ -40,8 +58,12 @@ namespace Nuake { BEGIN_DESERIALIZE(); this->Translation = Vector3(j["Translation"]["x"], j["Translation"]["y"], j["Translation"]["z"]); - //this->Rotation = Vector3(j["Rotation"]["x"], j["Rotation"]["y"], j["Rotation"]["z"]); + if(j.contains("Rotation")) + this->Rotation = Quat(j["Rotation"]["w"], j["Rotation"]["x"], j["Rotation"]["y"], j["Rotation"]["z"]); this->Scale = Vector3(j["Scale"]["x"], j["Scale"]["y"], j["Scale"]["z"]); + + LocalTransform = Matrix4(1); + GlobalTransform = Matrix4(1); return true; } }; diff --git a/Nuake/src/Scene/Scene.cpp b/Nuake/src/Scene/Scene.cpp index 8f79c1c7..830890a8 100644 --- a/Nuake/src/Scene/Scene.cpp +++ b/Nuake/src/Scene/Scene.cpp @@ -135,7 +135,7 @@ namespace Nuake { { auto [transform, camera, parent] = view.get(e); cam = camera.CameraInstance; - cam->Translation = transform.GlobalTranslation; + cam->Translation = transform.GetGlobalPosition(); break; } } diff --git a/Nuake/src/Scene/Systems/PhysicsSystem.cpp b/Nuake/src/Scene/Systems/PhysicsSystem.cpp index f3fdec59..9fb2d111 100644 --- a/Nuake/src/Scene/Systems/PhysicsSystem.cpp +++ b/Nuake/src/Scene/Systems/PhysicsSystem.cpp @@ -33,7 +33,7 @@ namespace Nuake BoxColliderComponent& boxComponent = ent.GetComponent(); Ref boxShape = CreateRef(boxComponent.Size); - Ref btRigidbody = CreateRef(mass, transform.Translation, boxShape); + Ref btRigidbody = CreateRef(mass, transform.GetGlobalPosition(), boxShape); rigidbody.m_Rigidbody = btRigidbody; @@ -49,7 +49,7 @@ namespace Nuake { auto [transform, cc] = ccview.get(e); - cc.CharacterController = CreateRef(cc.Height, cc.Radius, cc.Mass, transform.Translation); + cc.CharacterController = CreateRef(cc.Height, cc.Radius, cc.Mass, transform.GetLocalPosition()); Entity ent = Entity({ e, m_Scene }); cc.CharacterController->SetEntity(ent); @@ -67,7 +67,7 @@ namespace Nuake for (auto m : brush.Meshes) { Ref meshShape = CreateRef(m); - Ref btRigidbody = CreateRef(0.0f, transform.GlobalTranslation, meshShape); + Ref btRigidbody = CreateRef(0.0f, transform.GetGlobalPosition(), meshShape); btRigidbody->SetEntityID(Entity{ e, m_Scene }); brush.Rigidbody.push_back(btRigidbody); PhysicsManager::Get()->RegisterBody(btRigidbody); @@ -80,7 +80,7 @@ namespace Nuake auto [transform, brush, trigger] = bspTriggerView.get(e); Ref meshShape = CreateRef(brush.Meshes[0]); - Ref ghostBody = CreateRef(transform.GlobalTranslation, meshShape); + Ref ghostBody = CreateRef(transform.GetGlobalPosition(), meshShape); trigger.GhostObject = ghostBody; PhysicsManager::Get()->RegisterGhostBody(ghostBody); @@ -100,8 +100,8 @@ namespace Nuake for (auto& r : brush.Rigidbody) { - r->m_Transform->setOrigin(btVector3(transform.GlobalTranslation.x, transform.GlobalTranslation.y, transform.GlobalTranslation.z)); - r->UpdateTransform(*r->m_Transform); + //r->m_Transform->setOrigin(btVector3(transform.GlobalTranslation.x, transform.GlobalTranslation.y, transform.GlobalTranslation.z)); + //r->UpdateTransform(*r->m_Transform); } if (!brush.IsFunc) diff --git a/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp b/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp index ce3e907a..4d556f59 100644 --- a/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp +++ b/Nuake/src/Scene/Systems/QuakeMapBuilder.cpp @@ -51,9 +51,9 @@ namespace Nuake { parent.AddChild(brushEntity); - transformComponent.Translation = Vector3(brush->center.y * (1.0f / 64), + transformComponent.SetGlobalPosition(Vector3(brush->center.y * (1.0f / 64), brush->center.z * ScaleFactor * (1.0f / 64), - brush->center.x * ScaleFactor * (1.0f / 64)); + brush->center.x * ScaleFactor * (1.0f / 64))); BSPBrushComponent& bsp = brushEntity.AddComponent(); bsp.IsSolid = false; @@ -113,10 +113,10 @@ namespace Nuake { parent.AddChild(brushEntity); - transformComponent.Translation = Vector3( + transformComponent.SetGlobalPosition(Vector3( brush->center.y * ScaleFactor * (1.0f / 64), brush->center.z * ScaleFactor * (1.0f / 64), - brush->center.x * ScaleFactor * (1.0f / 64)); + brush->center.x * ScaleFactor * (1.0f / 64))); int index_offset = 0; int lastTextureID = -1; @@ -247,10 +247,10 @@ namespace Nuake { parent.AddChild(brushEntity); - transformComponent.Translation = Vector3( + transformComponent.SetLocalPosition(Vector3( brush->center.y * ScaleFactor * (1.0f / 64), brush->center.z * ScaleFactor * (1.0f / 64), - brush->center.x * ScaleFactor * (1.0f / 64)); + brush->center.x * ScaleFactor * (1.0f / 64))); int index_offset = 0; int lastTextureID = -1; @@ -422,7 +422,7 @@ namespace Nuake { float z = String::ToFloat(splits[0]); Vector3 position = Vector3(x, y, z) * ScaleFactor * (1.0f / 64.0f); - newEntity.GetComponent().Translation = position; + newEntity.GetComponent().SetLocalPosition(position); } if (key == "classname") diff --git a/Nuake/src/Scene/Systems/TransformSystem.cpp b/Nuake/src/Scene/Systems/TransformSystem.cpp index 56c046af..60083469 100644 --- a/Nuake/src/Scene/Systems/TransformSystem.cpp +++ b/Nuake/src/Scene/Systems/TransformSystem.cpp @@ -52,11 +52,13 @@ namespace Nuake { if (transform.Dirty) { Matrix4 localTransform = Matrix4(1); - localTransform = glm::translate(transform.LocalTransform, transform.Translation); - localTransform = localTransform * glm::toMat4(transform.Rotation); - localTransform = glm::scale(transform.LocalTransform, transform.Scale); + localTransform = glm::translate(localTransform, transform.GetLocalPosition()); + localTransform = localTransform * glm::toMat4(transform.GetLocalRotation()); + localTransform = glm::scale(localTransform, transform.GetLocalScale()); - transform.LocalTransform = localTransform; + transform.SetLocalTransform(localTransform); + + transform.Dirty = false; } } @@ -69,36 +71,35 @@ namespace Nuake { if (!parent.HasParent) { // If no parents, then globalTransform is local transform. - transform.GlobalTransform = transform.LocalTransform; + transform.SetGlobalTransform(transform.GetLocalTransform()); continue; } Entity currentParent = Entity((entt::entity)e, m_Scene); - Matrix4 globalTransform = transform.LocalTransform; - Vector3 globalPosition = transform.Translation; - Quat globalOrientation = transform.Rotation; - Vector3 globalScale = transform.Scale; + Matrix4 globalTransform = transform.GetLocalTransform(); + Vector3 globalPosition = transform.GetLocalPosition(); + Quat globalOrientation = transform.GetLocalRotation(); + Vector3 globalScale = transform.GetLocalScale(); ParentComponent parentComponent = currentParent.GetComponent(); while (parentComponent.HasParent) { TransformComponent& transformComponent = parentComponent.Parent.GetComponent(); - globalTransform = transformComponent.LocalTransform * globalTransform; + globalTransform = transformComponent.GetLocalTransform() * globalTransform; - globalPosition += transformComponent.Translation; - globalOrientation *= transformComponent.Rotation; - globalScale *= transformComponent.Scale; + globalPosition += transformComponent.GetLocalPosition(); + globalOrientation *= transformComponent.GetLocalRotation(); + globalScale *= transformComponent.GetLocalScale(); parentComponent = parentComponent.Parent.GetComponent(); } - transform.GlobalTranslation = globalPosition; - transform.GlobalRotation = globalOrientation; - transform.GlobalScale = globalScale; - - transform.GlobalTransform = globalTransform; + transform.SetGlobalPosition(globalPosition); + transform.SetGlobalRotation(globalOrientation); + transform.SetGlobalScale(globalScale); + transform.SetGlobalTransform(globalTransform); } } } diff --git a/Nuake/src/Scripting/Modules/SceneModule.h b/Nuake/src/Scripting/Modules/SceneModule.h index f1de5073..4ad96008 100644 --- a/Nuake/src/Scripting/Modules/SceneModule.h +++ b/Nuake/src/Scripting/Modules/SceneModule.h @@ -217,9 +217,10 @@ namespace Nuake { Entity ent = Entity((entt::entity)handle, Engine::GetCurrentScene().get()); auto& transform = ent.GetComponent(); // set the slots - wrenSetSlotDouble(vm, 1, transform.Translation.x); - wrenSetSlotDouble(vm, 2, transform.Translation.y); - wrenSetSlotDouble(vm, 3, transform.Translation.z); + Vector3 position = transform.GetLocalPosition(); + wrenSetSlotDouble(vm, 1, position.x); + wrenSetSlotDouble(vm, 2, position.y); + wrenSetSlotDouble(vm, 3, position.z); // Fill the list wrenSetSlotNewList(vm, 0); @@ -255,7 +256,7 @@ namespace Nuake { float y = wrenGetSlotDouble(vm, 3); float z = wrenGetSlotDouble(vm, 4); - transform.SetRotation(x, y, z); + transform.SetLocalRotation(QuatFromEuler(x, y, z)); } static void SetTranslation(WrenVM* vm) @@ -268,7 +269,7 @@ namespace Nuake { float y = wrenGetSlotDouble(vm, 3); float z = wrenGetSlotDouble(vm, 4); - transform.Translation = Vector3(x, y, z); + transform.SetGlobalPosition(Vector3(x, y, z)); } static void TriggerGetOverlappingBodyCount(WrenVM* vm)