Skip to content

Commit

Permalink
Added landscapes
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-beqiraj committed May 10, 2024
1 parent 1939d0f commit f9689ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Engine/src/Physics/Physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void Prisma::Physics::update(float delta) {

prismaMatrix = prismaMatrix * glm::scale(glm::mat4(1.0f), scaling);

mesh->finalMatrix(prismaMatrix);
mesh->parent()->finalMatrix(prismaMatrix);
}
}

Expand Down
9 changes: 9 additions & 0 deletions UserEngine/src/UserEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ UserEngine::UserEngine() : Prisma::Engine{}

Prisma::NodeHelper nodeHelper;

nodeHelper.nodeIterator(m_sceneNode->root, [](auto mesh, auto parent) {
auto currentMesh = std::dynamic_pointer_cast<Prisma::Mesh>(mesh);
if (currentMesh) {
auto physicsComponent = std::make_shared<Prisma::PhysicsMeshComponent>();
physicsComponent->collisionData({ Prisma::Physics::Collider::BOX_COLLIDER,0.0,btVector3(0.0,0.0,0.0),true });
currentMesh->addComponent(physicsComponent);
}
});

Prisma::Physics::getInstance().physicsWorld()->dynamicsWorld->setGravity(btVector3(0.0,-10.0,0.0));

}
Expand Down

0 comments on commit f9689ca

Please sign in to comment.