Skip to content

Raycasting lines built with InterleavedBufferGeometry fails due to hardcoded vertex access. PR in comments. #20365

@manthrax

Description

@manthrax
Description of the problem

Raycasting against lines built with InterleavedBufferGeometry fails due to hardcoded position access.

I'm including an example, and a fixed version of the Line.raycast function.

The fix repairs the hardcoded stride and lack of offset used in the position lookup.

https://codepen.io/manthrax/pen/KKzBEXa

Thanks to @usefulthink and Tom Delerue for finding/tracking down the problem!!

Three.js version
  • Dev
  • r120
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions