kurhlaa Posted December 7, 2017 Author Share Posted December 7, 2017 I feel there is a wrong default camera.ellipsoidOffset for Y. So the offset is normal from the sides, is double below the camera, and so is 0 above it. And it's impossible to change it. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted December 7, 2017 Share Posted December 7, 2017 Might be a wild goose chase, but why is only Y here?https://github.com/BabylonJS/Babylon.js/blob/0b952d7b215e4a96592624ca70e8b4dbe2e8a91b/src/Mesh/babylon.abstractMesh.ts#L1070https://doc.babylonjs.com/classes/3.0/vector3#subtractfromfloatstoref-x-y-z-result-rarr-vector3-classes-3-0-vector3- Wingnut 1 Quote Link to comment Share on other sites More sharing options...
satguru Posted December 7, 2017 Share Posted December 7, 2017 I think our assumption about how the ellipsoid is positioned in the mesh might be incorrect. See the discussion below, on how I think the ellipsoid is actually positioned in the mesh Also, as noted in that discussion, collision between two meshes is not between ellipsoid of one colliding with the ellipsoid of the other . It is between ellipsoid of one colliding with the surface of the other. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 7, 2017 Share Posted December 7, 2017 Wow, what a discussion THAT thread is/was! Phew. Yep, that throws a monkey wrench into everything we have going, here. Thanks for that "lead", Sat-g! Excellent new info. Update: My goofy showEllipsoid() and setEllipsoidPerBoundingBox() are going to need a re-think, that's for sure. Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted December 8, 2017 Author Share Posted December 8, 2017 @satguru, thanks! Useful info. So the ellipsoid by default isn't symmetrical to the object's center. But this doesn't work for me: camera.ellipsoid = new BABYLON.Vector3(1.5, 1.5, 1.5); camera.ellipsoidOffset = new BABYLON.Vector3(0, 1.5, 0); .. the ellipsoid's size above the camera is still 0 and big below it, like the offset is being ignored. And just to clarify - in my case I use and move camera (which has no size) with it's ellipsoid (which size is (1.5, 1.5, 1.5)), so the minimal distance to the box must be identical from all the sides - it doesn't happen to me. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 8, 2017 Share Posted December 8, 2017 In fact I think it is according to the size of the mesh. If the mesh is 4 units and the elipsoid is 1.5 units (3 units total) it (the camera) will go into of 0.5 in the mesh. On the other hand with the offeset, there is indeed a problem, because if one shifts it from 0.5 to the top, it should correct the problem, (the camera also goes down 0.5 when the ellipsoid goes up.) I notice that the offset works on the mesh, but it is not taken into account by the collision system. In other words, the offset works, but the collision does not take it into account. Conclusion, the bug is on the fact that the offet is not taken into account by the collision system, it correctly takes into account the initial elipsoid, but not after shift, even if the offset works correctly on the mesh . What do you think about @Deltakosh? Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 8, 2017 Share Posted December 8, 2017 Thx Dad! Good thinkin's. Meantime... Another test: https://www.babylonjs-playground.com/#WWCK0#86 Basic barrels demo with .setEllipsoidPerBoundingBox() disabled. Baby 'zoids'. "zoid" or "soid" are easier to type. Shift-Q and 'E' tests are different, now. No freezes, either, so E, Q, SHIFT-E and SHIFT-Q all work, even after collide. hmm. Those zoids "look" centered-on-mesh, by default. I suppose we could add a wireframe zoid to the camera, eh? Not for arc cams, though. Only free cams have zoids. Here is a barrels demo with a freeCam with 1.1, 1.1, 1.1 zoid radius... and we're looking-out thru the camera's zoid-sphere. Interesting-looking - a little camera.minZ corner clipping. Tweak camzoid size at line 63. We can even look-at the freecam with its new ellipsoidMesh... from a 2nd camera point-of-view. Can we "sim" cursoring that freecam, now? Then, we can watch it collide with junk, from arcCam view. Warning: I parented that camzoid to the freecam (line 77), and that might be a mis-positioning, per the Satguru info. Line 18 within my showEllipsoids() func... adjusts position for ellipsoidOffsets, in case anyone was curious about that. I hope I'm doing that correctly. I think showEllipsoids() is important for us. But, it was coded by me, and that means mistakes are likely. Anyway, moving-on... Notice the constructor in line 10. var sphere = BABYLON.MeshBuilder.CreateSphere("elli", { diameterX: this.ellipsoid.x * 2, diameterZ: this.ellipsoid.z * 2, diameterY: this.ellipsoid.y * 2 }, scene); Ellipsoid values are radii. I keep forgetting that, so I thought I would remind myself, and perhaps others. I love this type of studying, guys. Thx for tolerating me, and my sometimes-slow comprehension. We're still welcoming comments from everyone. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2017 Share Posted December 8, 2017 Can someone create PG which highlight what you think is an issue? Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted December 8, 2017 Author Share Posted December 8, 2017 30 minutes ago, Deltakosh said: Can someone create PG which highlight what you think is an issue? Please, check this post.. it has PG link and video how do I see it.. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 8, 2017 Share Posted December 8, 2017 Wingnut made more PG on the previous page https://www.babylonjs-playground.com/#WWCK0#78 (Key E for Up camera) And a video here : http://www.html5gamedevs.com/applications/core/interface/file/attachment.php?id=16160 Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2017 Share Posted December 8, 2017 I meant: a simple PG Ok le'ts try this: https://www.babylonjs-playground.com/#X2LMYT As you can see in the PG, I set the ellipsoid to 1 (let's only consider y azis so far). This is expected because the box is 2 in height. so it is contained in an ellipsoid with a radius of 1 But (and this is maybe something we need to change), by default, the ellipsoid is offset by its radius. so I need to set an ellipsoidOffset of 1 to compensate. Here is my proposal: I remove the ellipsoid automatic offset (which was done because this was done initially for camera and you want to the view to be on the "head" of the camera). Thoughts? Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted December 8, 2017 Author Share Posted December 8, 2017 @Deltakosh, please try 1 camera (for moving) and 1 mesh, not 2 meshes. The problem is that setting offset for camera's ellipsoid is being ignored Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2017 Share Posted December 8, 2017 exact..I will do both fix...Remove the auto offset on the meshes and add the ellipsoidoffset on camera stay tuned! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2017 Share Posted December 8, 2017 Ok now this PG is simpler: https://www.babylonjs-playground.com/#X2LMYT#1 And the camera.ellipsoidOffset is taken in account I also udpated the doc to reflect the change Thanks guys! Dad72 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 8, 2017 Share Posted December 8, 2017 Yum! I hope we didn't break older scenes. Thx DK and everyone else. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 8, 2017 Share Posted December 8, 2017 My deduction was well the collider that did not take into account the shift That seems fine to me now. Thank you DK Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 8, 2017 Share Posted December 8, 2017 1 hour ago, Deltakosh said: by default, the ellipsoid is offset by its radius I assume Y-offset by Y-radius. (duh, Wingy) @Dad72, yep, your video is showing exactly what K and I saw... but I/we thought that was incorrect, until I/we learned more stuff. Sorry for confusion. Thx for video! Quote Remove the auto offset on the meshes Is that we/they want? Or, should we/them still keep auto-offset, but set it to default 0,0,0 ? *shrug* Is that what was meant? (I guess I can test and find out) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 8, 2017 Share Posted December 8, 2017 Yes this bug was not easy to see and understand. This is not my video, but that of K. I just put a summary of the problem and to target more precisely what was the cause through all your various tests. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2017 Share Posted December 8, 2017 Quote Remove the auto offset on the meshes We still have the ellipsoidOffset but for bad reasons I was also adding an internal offset which does not make sense at all Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted December 8, 2017 Author Share Posted December 8, 2017 @Deltakosh, babylon.js (v3.1-rc-1) is fixed on Github now, but can't use the latest babylon.worker.js, I get: Uncaught TypeError: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': The provided value cannot be converted to a sequence. As a result - camera is not moving at all. Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted December 8, 2017 Author Share Posted December 8, 2017 Thanks with the first issue. There still exists the second one, probably not related to this one - I can move through the plane/wall - http://www.babylonjs-playground.com/#MJRGPB#4 There are normal collisions when moving from one side and (almost) no collisions when moving from the other. Should I create a new topic? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 9, 2017 Share Posted December 9, 2017 https://github.com/BabylonJS/Babylon.js/blob/master/src/Collisions/babylon.collider.ts#L191 embeddedInPlane. hmm. Makes ya wonder, eh? Special processing for when ellipsoid is completely flat, perhaps? Anyway, adjusted scene... https://www.babylonjs-playground.com/#MJRGPB#6 Left plane facing forward, right plane reversed, and yep, I see some major differences between the two. Let's ping our superhero again, huh? @Deltakosh, we are already missing you. Come tell us another bedtime story, ok? Quote Link to comment Share on other sites More sharing options...
satguru Posted December 9, 2017 Share Posted December 9, 2017 @Deltakosh Serialization/deserialization is not happening properly now. After Serialization/deserialization ellipsoid behaves as before. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 11, 2017 Share Posted December 11, 2017 can you provide a test case ? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 11, 2017 Share Posted December 11, 2017 @Deltakosh Do you have a moment to address kurhlaa's last post. (and mine, too). We are seeing shallow collision on ONE side of planes, deep collision (or no collision) when plane is reversed. https://www.babylonjs-playground.com/#MJRGPB#6 Left plane is forward, right plane is reversed. Thx for any words/thoughts. Advice/info from others... welcomed too, of course. 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.