Jump to content

checkCollisions inside the skybox


Alex10
 Share

Recommended Posts

I want to have a camera (the player) does not go beyond the stage. So I applied checkcollision on skybox. But it was used outside Cuba behind the scenes and inside the camera falls down from the edge of the stage.

var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(80, 5, -10), scene);camera.setTarget(BABYLON.Vector3.Zero());camera.ellipsoid = new BABYLON.Vector3(2, 2, 1);camera.checkCollisions = true;camera.applyGravity = true;// Skybox var skybox = BABYLON.Mesh.CreateBox("skyBox", 390.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("/skybox", scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skybox.material = skyboxMaterial; skybox.checkCollisions = true;

 

 

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