This repository has been archived by the owner on Feb 3, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Light visual is displayed wrong - it shows a cone corresponding to a light with double the angle than it should represent.
Example light:
It seems the math is just wrong in https://github.com/osrf/gazebo/blob/db40ad5e02f21e68e9924d725a49b3e107fecb45/gazebo/rendering/Light.cc#L314-L327
If we denote
inner_angle
by α, then the computation done in code to determine the corners of the pyramid is:Looking from a side, the situation is drawn here:
It follows from the top half-triangle that
tan(α) = (r*tan(α))/r = (angles[i]/r)
and thusα = atan(angles[i]/r)
... But asangles[i]
is just a multiple oftan(α)
, it is apparent that the angle at the apex of the upper half-triangle isinner_angle
. Then sum it up with the lower half-triangle, and you get angle at the apex of the light visual2*inner_angle
.If I add a light with halved
inner_angle
, the borders of the visual match the circle of the light exactly:This PR just applies the halving of the angle to fix the visuals.