Skip to content

Bad getPerpendicularVector usage #11

@shill-lucasfilm

Description

@shill-lucasfilm

This particular method of generating a perpendicular vector doesn't return a unit vector in most cases, so the following line (as well as line 137) should normalize() the result, otherwise you'll end up with a different distribution of rays than the one that's intended:

This is just something I happened across while skimming the code quickly, so I haven't looked for other uses elsewhere in this sample or the others.

It's maybe not a horrendous error, since a quick test suggests that the mean norm is ~0.96, but the worse case can be ~0.82.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions