Skip to content

Commit

Permalink
fix instance transformation
Browse files Browse the repository at this point in the history
fix bounding box for terrain vertex
turn off debug
fix scene instance visitor
  • Loading branch information
hotstreams committed Aug 28, 2024
1 parent 6c0adac commit 3da6ba2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/limitless/models/mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ namespace Limitless {
Box bounding_box {};

void calculateBoundingBox() {
//TODO: dispatch?
if (auto vnt = dynamic_cast<VertexStream<VertexNormalTangent>*>(stream.get()); vnt) {
bounding_box = Limitless::calculateBoundingBox(vnt->getVertices());
}
if (auto vnt = dynamic_cast<VertexStream<VertexTerrain>*>(stream.get()); vnt) {
bounding_box = Limitless::calculateBoundingBox(vnt->getVertices());
}
}
public:
// Mesh(std::vector<Vertex>&& vertices, VertexStreamUsage usage, VertexStreamDraw draw, std::string _name)
Expand Down
4 changes: 2 additions & 2 deletions include/limitless/renderer/renderer_settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ namespace Limitless {
/**
* Render System Axes
*/
bool coordinate_system_axes = true;
bool coordinate_system_axes = false;

/**
* Render bounding boxes
*/
bool bounding_box = true;
bool bounding_box = false;

class Builder {
private:
Expand Down
1 change: 1 addition & 0 deletions src/limitless/instances/instance_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Instance::Builder& Instance::Builder::bounding_box(const Box& box) {
std::shared_ptr<ModelInstance> Instance::Builder::asModel() {
if (dynamic_cast<Model*>(model_.get())) {
auto instance = std::make_shared<ModelInstance>(model_, position_);
initialize(*instance);
initialize(instance);
return instance;
}
Expand Down
1 change: 0 additions & 1 deletion src/limitless/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ Instances Scene::getInstances() const noexcept {
};

for (const auto& [_, instance] : instances) {
visitor(instance);
if (instance->isHidden()) {
continue;
}
Expand Down

0 comments on commit 3da6ba2

Please sign in to comment.