Skip to content

Sphere intersection not correct #97

@athorwall

Description

@athorwall

https://github.com/rustgd/collision-rs/blob/master/src/volume/sphere.rs#L61 seems to be incorrect. Specifically the computation of tca:

let tca = l.dot(r.direction);

where tca is intended to be the length of the projection of l onto r.direction is incorrect - it needs to be divided by the magnitude of r.direction:

let tca = l.dot(r.direction) / r.direction.magnitude();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions