Skip to content

Commit

Permalink
Add color to DrawRay
Browse files Browse the repository at this point in the history
  • Loading branch information
edunad committed May 1, 2024
1 parent c34a0a6 commit 66e325f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rawrbox.physics_3d/include/rawrbox/physics/debugger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace rawrbox {
stencil->drawTriangle(v1, {}, color, v2, {}, color, v3, {}, color);
}

static void DrawRay(const JPH::RRayCast& ray) {
static void DrawRay(const JPH::RRayCast& ray, const rawrbox::Color& color = rawrbox::Colors::Red()) {
auto* renderer = rawrbox::RENDERER;
auto* camera = rawrbox::MAIN_CAMERA;
if (renderer == nullptr || camera == nullptr) return;
Expand All @@ -137,7 +137,7 @@ namespace rawrbox {
rawrbox::Vector3f start = camera->worldToScreen(rawrbox::PhysUtils::posToVec(ray.mOrigin));
rawrbox::Vector3f end = camera->worldToScreen(rawrbox::PhysUtils::posToVec(ray.mOrigin + ray.mDirection));

stencil->drawLine(start.xy(), end.xy(), rawrbox::Colors::Red());
stencil->drawLine(start.xy(), end.xy(), color);
}
};
} // namespace rawrbox
Expand Down

0 comments on commit 66e325f

Please sign in to comment.