xeokit / xeokit-sdk

Open source JavaScript SDK for viewing high-detail, full-precision 3D BIM and AEC models in the Web browser.
https://xeokit.io
Other
715 stars 286 forks source link

Using rotation params property in XKTLoader breaks scene.pick(origin: [...], direction: [...]) #448

Closed juho-ylikyla closed 3 years ago

juho-ylikyla commented 3 years ago

Describe the bug When loading an XKT model, there is the possibility to rotate the model. If you give any rotation parameter to the load function, eg: rotation: [0, 0, 0]

the scene.pick with origin and direction breaks.

window.viewer.scene.pick({
              pickSurface: true,
              origin: [somewhere],
              direction: [0, 0, 10]

It will give a randomly picked entity, seemingly depending on the current camera position.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://xeokit.github.io/xeokit-sdk/examples/#picking_ray_surface
  2. Edit the loading function https://github.com/xeokit/xeokit-sdk/blob/master/examples/picking_ray_surface.html#L57 by adding there rotation: [0,0,0]
  3. Load the model
  4. See that the selected entity is fixed.

Screen recording issue

xeolabs commented 3 years ago

Fixed by https://github.com/xeokit/xeokit-sdk/issues/494