Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Forked from xeolabs/xeogl-debug-logPick.js
Last active February 18, 2021 21:28
Show Gist options
  • Select an option

  • Save molotovbliss/d661b62e30ed0998c54f85ebbe397f78 to your computer and use it in GitHub Desktop.

Select an option

Save molotovbliss/d661b62e30ed0998c54f85ebbe397f78 to your computer and use it in GitHub Desktop.
Drop in Chrome console to log info on each (pickable) Entity you click on -- #xeogl #debugging
// Console snippet to let you click on an Entity to get it's ID
// Set mySceneID to your Scene's ID, or leave as is to work with xeogl's default Scene.
var mySceneID = 0;
xeogl.scenes[mySceneID].input.on("mouseclicked", function (coords) {
var hit = scene.pick({
canvasPos: coords
});
if (hit) {
this.log("Picked Entity '" + hit.entity.id + "'");
} else {
this.log("Nothing picked.");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment