max123 Posted November 13, 2017 Share Posted November 13, 2017 6 minutes ago, adam said: In the case, the user should be reusing Rays. When you call public pickWithRay(ray: Ray, predicate: (mesh: Mesh) => boolean, fastCheck?: boolean): PickingInfo { return this._internalPick(world => { if (!this._pickWithRayInverseMatrix) { this._pickWithRayInverseMatrix = Matrix.Identity(); } world.invertToRef(this._pickWithRayInverseMatrix); return Ray.Transform(ray, this._pickWithRayInverseMatrix); }, predicate, fastCheck); } Ray.Transform returns new Ray. Quote Link to comment Share on other sites More sharing options...
adam Posted November 13, 2017 Share Posted November 13, 2017 max123 1 Quote Link to comment Share on other sites More sharing options...
adam Posted November 13, 2017 Share Posted November 13, 2017 There are actually 2 objects getting created there. A pickingInfo object and a Ray. The Ray creation could be eliminated by using a tmpRay in the scene.pickWithRay functions. To eliminate the pickingInfo object creation, there would need to be a new scene.pickWithRayToRef which the user would pass a pickingInfo object. (this one looks a little difficult and might not be worth it) Quote Link to comment Share on other sites More sharing options...
max123 Posted November 13, 2017 Share Posted November 13, 2017 9 minutes ago, adam said: There are actually 2 objects getting created there. A pickingInfo object and a Ray. The Ray creation could be eliminated by using a tmpRay in the scene.pickWithRay functions. To eliminate the pickingInfo object creation, there would need to be a new scene.pickWithRayToRef which the user would pass a pickingInfo object. (this one looks a little difficult and might not be worth it) Well, a pickInfo object is a necessary evil: you do need to return the result of picking Quote Link to comment Share on other sites More sharing options...
adam Posted November 13, 2017 Share Posted November 13, 2017 If you could pass the function your own pickingInfo object then it could pass that to a new mesh.intersectsToRef and eliminate the creation of PickingInfo here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.abstractMesh.ts#L1817 Like I said though, it might not be worth the trouble. max123 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Share Posted November 13, 2017 Always eager to improve the engine. I will work on removing this ugly Ray.Transform Regarding camera, the inputs are pretty well separated to me: http://doc.babylonjs.com/how_to/customizing_camera_inputs Then each camera has a specific design (ArcRotate, Free). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Share Posted November 13, 2017 Ok the Ray.Transform will be fixed with next nightly @max123: Feel free to give us other feedback / improvements that you may have. It is the best way to improve the engine max123 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Share Posted November 13, 2017 For your CSS remark: I agree we should not have to do it but it saves us so many questions on why the inputs are not working on my canvas Perhaps we should add a: engine.dontTouchMyzIndex or something along these lines Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 13, 2017 Share Posted November 13, 2017 Personally, I have found BJS to not be OOP enough. Not in the framework itself, but in ones ability to easily subclass something in typescript. I just have been doing PR's to switch private properties / methods to protected in instances where I have hit walls. I also reorganized Mesh a little, so cloning can be done in the constructor, otherwise you could not clone a mesh sub-class. FYI, there is no relationship between OOP and trash creation. Any design can create tons of short lifetime garbage with ease. This is not as bad as burying references to objects in other objects beyond when they need them, so stuff can never fall out of scope and be garbage collected. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Share Posted November 13, 2017 I'm convinced it is not possible to satisfy everyone. But I assure you we are trying hard max123, RaananW and Dad72 3 Quote Link to comment Share on other sites More sharing options...
max123 Posted November 14, 2017 Share Posted November 14, 2017 16 hours ago, Deltakosh said: Always eager to improve the engine. I will work on removing this ugly Ray.Transform Regarding camera, the inputs are pretty well separated to me: http://doc.babylonjs.com/how_to/customizing_camera_inputs Then each camera has a specific design (ArcRotate, Free). As I said, I don't disagree with decisions made - It's just we all have our own view of what's best Quote Link to comment Share on other sites More sharing options...
max123 Posted November 14, 2017 Share Posted November 14, 2017 hahaha you beat me to it, @Deltakosh! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
max123 Posted November 14, 2017 Share Posted November 14, 2017 16 hours ago, JCPalmer said: FYI, there is no relationship between OOP and trash creation. Any design can create tons of short lifetime garbage with ease. This is not as bad as burying references to objects in other objects beyond when they need them, so stuff can never fall out of scope and be garbage collected. Agreed. Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 14, 2017 Share Posted November 14, 2017 @max123 Hey thank you for your feedback Max, it's always appreciated to have constructive comments. About the inspector, maybe I can help ? Indeed, the inspector is HTML/CSS based and I have to say it's a real pain in the ass to create a side panel But you can create a div and ask the inspector to be created in this specific div (described here: http://doc.babylonjs.com/how_to/debug_layer) Let me know if you need anything, even new features Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 14, 2017 Share Posted November 14, 2017 For you@max123: https://github.com/BabylonJS/Babylon.js/commit/9824853960fc2a4be97b1acb6907244c8df9f05e brianzinn, jerome and adam 3 Quote Link to comment Share on other sites More sharing options...
jerome Posted November 14, 2017 Share Posted November 14, 2017 Even with expensive software products or other service Premium offers, you will never meet such a fast and dedicated free answer and fix. Maybe, this is THE reason that you might consider about choosing BJS over ... anything else MarianG, GameMonetize, Arte and 1 other 4 Quote Link to comment Share on other sites More sharing options...
max123 Posted November 15, 2017 Share Posted November 15, 2017 You guys rock!@Temechon, I'll give it a go Temechon 1 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.