Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: pick invalid mesh #3

Open
jiexx opened this issue Sep 29, 2015 · 4 comments
Open

bug fix: pick invalid mesh #3

jiexx opened this issue Sep 29, 2015 · 4 comments

Comments

@jiexx
Copy link

jiexx commented Sep 29, 2015

bug fix: if there are more mesh picked, GUISystem.enableClick() will
result in all mesh be picked. in actually, GUISystem.enableClick should
pick only 2D bGUI mesh.

@jiexx
Copy link
Author

jiexx commented Sep 29, 2015

commit e8ae08b0a1548a035eba1c42585fdfe334b719c8
Author: unknown jluo.roger@jluo.qinmaohao.com
Date: Tue Sep 29 14:50:44 2015 +0800

bug fix: if there are more mesh picked, GUISystem.enableClick() will
result in all mesh be picked. in actually, GUISystem.enableClick should
pick only 2D bGUI mesh.

diff --git a/dist/bGUI-1.3.0.js b/dist/bGUI-1.3.0.js
index 8f3b586..62fc407 100644
--- a/dist/bGUI-1.3.0.js
+++ b/dist/bGUI-1.3.0.js
@@ -98,7 +98,7 @@ var bGUI = bGUI || {};
@@ -98,7 +98,7 @@ var bGUI = bGUI || {};
};
_this._scene._updatePointerPosition(evt);
var pickResult = _this._scene.pick(_this._scene._pointerX, _this._scene._pointerY, predicate, false, _this.getCamera());

  •        if (pickResult.hit) {
         };
         _this._scene._updatePointerPosition(evt);
         var pickResult = _this._scene.pick(_this._scene._pointerX, _this._scene._pointerY, predicate, false, _this.getCamera());
    
  •        if (pickResult.hit) {
    
  •        if (pickResult.hit && _this.getObjectByName(pickResult.pickedMesh.name) != null) {
             if (pickResult.pickedMesh.actionManager) {
                 pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pic                 }
    
    @@ -110,7 +110,7 @@ var bGUI = bGUI || {};
    };
    _this._scene._updatePointerPosition(evt);
    var pickResult = _this._scene.pick(_this._scene._pointerX, _this._scene._pointerY, predicate, false, _this.getCamera());
  •        if (pickResult.hit) {
    
  •        if (pickResult.hit && _this.getObjectByName(pickResult.pickedMesh.name) != null) {
             if (pickResult.pickedMesh.actionManager) {
                 pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickUpTrigger, BABYLON.ActionEvent.CreateNew(pickResult.p                 }
    
    diff --git a/src/GUISystem.js b/src/GUISystem.js
    index 6383fa8..ec7eba0 100644
    --- a/src/GUISystem.js
    +++ b/src/GUISystem.js
    @@ -154,7 +154,7 @@ var bGUI = bGUI || {};
    };
    _this._scene._updatePointerPosition(evt);
    var pickResult = _this._scene.pick(_this._scene._pointerX, _this._scene._pointerY, predicate, false, _this.getCamera());
  •        if (pickResult.hit) {
    
  •        if (pickResult.hit && _this.getObjectByName(pickResult.pickedMesh.name) != null) {^M
             if (pickResult.pickedMesh.actionManager) {
                 pickResult.pickedMesh.actionManager.processTrigger(BABYLON.ActionManager.OnPickTrigger, BABYLON.ActionEvent.CreateNew(pickResult.pic                 }
    
    @@ -167,7 +167,7 @@ var bGUI = bGUI || {};
    };
    _this._scene._updatePointerPosition(evt);
    var pickResult = _this._scene.pick(_this._scene._pointerX, _this._scene._pointerY, predicate, false, _this.getCamera());
  •        if (pickResult.hit) {
    
  •        if (pickResult.hit && _this.getObjectByName(pickResult.pickedMesh.name) != null) {^M
             if (pickResult.pickedMesh.actionManager) {
             }
    

@jiexx
Copy link
Author

jiexx commented Sep 29, 2015

this will fix it

@Temechon
Copy link
Owner

Thank you Jiexx. Is it possible for you to do a pull request for this ?
Thanks :)

@ghost
Copy link

ghost commented Jul 22, 2018

i want to access pickResult.pickedMesh.index & pickResult.pickedMesh.picked value but unable to do it..??

any one can help?
plz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants