Skip to content

Commit

Permalink
Merge pull request #73 from hotstreams/detached6
Browse files Browse the repository at this point in the history
fix instance transformation
  • Loading branch information
hotstreams authored Aug 28, 2024
2 parents 6c0adac + 3da6ba2 commit 53c0eeb
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 53c0eeb

Please sign in to comment.