Jump to content

A callback for camera collision ?


Vousk-prod.
 Share

Recommended Posts

Hello,

I'm playing with an ArcRotateCamera and collisions and I wonder if I can be informed that collision occurs.

I'm simply using

scene.collisionsEnabled = true;camera.checkCollisions = true;myMesh.checkCollisions = true;

Works great, but I'd like to be informed when my camera collide with the mesh. Is there a callback system or something ? I didn't find such in the source code.

I could eventually use mesh.intersectsPoint() and define my camera position as the checked point, but that won't take the camera's collisionRadius in account. I can aslo create a non visible sphere, parent it to the camera and check for mesh intersecting with this dummy sphere, but that's not so elegant. Is there a direct way to know collision occured ?

Link to comment
Share on other sites

But if I have lots of meshes added on the fly, with camera collision system to call newMesh.checkCollisions = true at each spawn is enough to take every required meshes in account, but with mesh intersection system I'll have to check the dummy object intersecting with every mesh at each render loop... wouldn't that drop down performance ?

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...