JLHolmes Posted September 22, 2017 Share Posted September 22, 2017 Hey guys... it's been a while, but things have been going pretty smooth with BJS. That is, until I upgraded to 3.0. My scene just up an disappeared! Digging into it, I found that it was when I set checkCollisions to true, the scene for that camera would just lock up the camera.... unable to move it at all. So.... sceneState.camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0.8, 1000, new BABYLON.Vector3(0,0,0), sceneState.scene); sceneState.camera.speed = 5; sceneState.camera.checkCollisions = true; sceneState.camera.ellipsoid = new BABYLON.Vector3(2, 5, 2); sceneState.camera.upperBetaLimit = Math.PI/2; sceneState.camera.wheelPrecision = .1; sceneState.camera.lowerRadiusLimit = sceneState.togScene.gridSize * 2; Fails... but... sceneState.camera = new BABYLON.ArcRotateCamera("ArcRotateCamera", 0, 0.8, 1000, new BABYLON.Vector3(0,0,0), sceneState.scene); sceneState.camera.speed = 5; sceneState.camera.upperBetaLimit = Math.PI/2; sceneState.camera.wheelPrecision = .1; sceneState.camera.lowerRadiusLimit = sceneState.togScene.gridSize * 2; ... is just fine. Thoughts? Did I miss some other setting or change with regard to moving to 3.0? (Actually, v3.1-alpha) Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 22, 2017 Share Posted September 22, 2017 Hi @JLHolmes, do you think you can reproduce it on the playground? Also - are you using the workers-collision, or the native collision? Quote Link to comment Share on other sites More sharing options...
JLHolmes Posted September 22, 2017 Author Share Posted September 22, 2017 I'm trying to repo it in the playground... it does not seem to happen in simple scenes... only when there's an object much larger than the camera's radius. How do I determine what type of collision is being used? Well... since I have not done anything special to pull in collision I assume I'm using native. Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 22, 2017 Share Posted September 22, 2017 I assume so as well Are you sure you are not stuck in a mesh when the camera is created? try changing the radius to something much larger and see if it works. Quote Link to comment Share on other sites More sharing options...
JLHolmes Posted September 22, 2017 Author Share Posted September 22, 2017 Yep... tried that. It doesn't matter how far out I set the radius. The camera is still locked in place. I'm trying to simply the scene to get at it more. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 23, 2017 Share Posted September 23, 2017 Hi guys... sorry to interrupt. JLH... are you using a ground? Is the ground set .checkCollisions = true? Was the ground created with .createGroundFromHeightMap? (thx) I did a little experimenting... http://playground.babylonjs.com/#NAM2N8#1 I am unable to reproduce the stuck camera symptom, so far. JLH's camera settings are in lines 55-61. I added two badly-Wingnut-coded funcs at the top... that I have used for other projects... .showEllipsoid() and .setEllipsoidPerBoundingBox(). After activating them in the lines 88/89, I realized they were failing... particularly the .refreshBoundingInfo() in line 6. Anyway, I learned very little... still testing... but in this version, line 98 reports (-infinity, -infinity,-infinity) and that concerns me. Activating line 91 is still causing errors, unless I ALSO activate line 90. hmm. Code: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.mesh.ts#L622 That's all I have. I can understand why .checkCollisions = true on a heightMap ground... might NOT use a standard mesh.ellipsoid. FreeCams with .applyGravity would act very strange if an .ellipsoid was used as a heightMap collider. FreeCams would never fall-to the ground in valleys between mountains.... because the .ellipsoid would span across the valley, mountain to mountain. Just testing, testing, testing, seeing what I can discover. Fellow forum helpers... join-in freely with comments and more playground tests. thx. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.