Changing engine to shared library

This commit is contained in:
Dynamitos
2023-08-26 15:19:12 +02:00
parent 4ab924f251
commit dcbce27fb2
20 changed files with 93 additions and 47 deletions
+6 -4
View File
@@ -49,14 +49,16 @@ void BVH::colliderCallback(entt::registry& registry, entt::entity entity)
void BVH::visualize()
{
for(const auto& node : staticNodes)
Array<DebugVertex> verts;
for (const auto& node : staticNodes)
{
node.box.visualize(gDebugVertices);
node.box.visualize(verts);
}
for(const auto& node : dynamicNodes)
for (const auto& node : dynamicNodes)
{
node.box.visualize(gDebugVertices);
node.box.visualize(verts);
}
addDebugVertices(verts);
}
void BVH::traverseStaticTree(const AABB& aabb, entt::entity source, int32 nodeIndex, Array<Pair<entt::entity, entt::entity>>& overlaps)
+2 -2
View File
@@ -284,11 +284,11 @@ void PhysicsSystem::calculateContacts(entt::entity id1, const ShapeBase& shape1,
const Vector v1 = point2 - point1;
const Vector v2 = point3 - point1;
const Vector faceNormal = glm::normalize(glm::cross(v1, v2));
Seele::gDebugVertices.add(DebugVertex{
addDebugVertex(DebugVertex{
.position = (point1 + point2 + point3) / 3.f,
.color = Vector(1, 0, 0)
});
Seele::gDebugVertices.add(DebugVertex{
addDebugVertex(DebugVertex{
.position = faceNormal + (point1 + point2 + point3) / 3.f,
.color = Vector(1, 0, 0)
});