Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi I have created a new class like in tutorial 3 http://www.ambiera.com/copperlic... I simply want to be able to run a JS function when that object is clicked. I added a new property function to the class which is called from the construktor: LinkSceneNode.prototype.activateLink = function(engine, scene){ Where the '0' is an 'O'... Some sort of bug with '0nclick' phrase on this forum, see here -> "" <-. ("LinkSceneNode" is my classname instead of "MySceneNode" in the tut) When i'm debugging it in my webbrowser i can see that 'this' is pointing to the right SceneNode. My result is that nothing happens when i click on my sceneNode in WebGL. is there something i missed in the code or any information. [edit] the topic is bugged aswell. It's suppose to say 'Animator0nClick' with and 'O' |
||||
|
Is the bounding box of your scene node correct? If it is not a mesh node, the animator tries to use the bounding box to calculate if your node has been hit. |
||||
|
aha, ok... The first thing i did when i tried to solve this was, changing the parent to "MeshSceneNode" instead of only "SceneNode". Then i'll use its "getBoundingBox()" method and its "Box" property. My big problem was how to know or how to calculate the bounding box... I found a method in the "MeshBuffer" object named "recalculateBoundingBox()", which i called. Then i tried to use the buffert "Box3d" object in my "MeshSceneNode". But as i expected this didnt work. Maybe im totaly off here, but i really want this to work in my schoolproject! |
||||
|
NVM, i got it working when i did as i said in the prev post... The error that i thought was related to the boudning box had nothing to do with it... And when i fixed that error the click event works... :D thx for fast support. |
||||
|
Ah, nice to hear :) |
|