Jump to content

3.0 with workerCollisions = true cannot move camera


kyptov
 Share

Recommended Posts

I noticed that too before 3.0, but with an ellipsoid. The movements are then increasingly slowed down, as if gravity was growing stronger. I do not know how to explain, but I stop using workerCollisions because of it.

Link to comment
Share on other sites

I digged a little and found that camera.getTarget() returning previous value (all collision disabled including worker)

I use next code to move camera forward on custom event in requestAnimationFrame and camera not moving.

const vec3 = camera.getTarget().subtract(camera.position);
vec3.normalize().scaleInPlace(MOVE_SPEED * frontward);
camera.cameraDirection.addInPlace(vec3);

I localized moving only to Z axis and logged z values

console.log(camera.getTarget().z, camera.position.z, camera.getTarget().z - camera.position.z);

and here the log

-13999 -14000 1
-13999 -13990 -9
-13989 -13991 2
-13990 -13981.9 -8.100000000000364

Camera is moving, but forward and backward. Looks like camera.getTarget() returning previous value.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...