Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Using JS to detect a collision between two nodes.

ishmaru
Registered User
Quote
2018-02-23 05:45:13

Im trying to write a behavior that on animate checks if the current node is overlapping another node. I believe this method is what i need, but I'm afraid i do not understand how to properly use it

ccbDoesLineCollideWithBoundingBoxOfSceneNode()

In the docs the only example uses the mouse coordinates, but i need to check if two 3d nodes are colliding. Anyone give me a quick example?


niko
Moderator
Quote
2018-02-23 08:11:39

There is currently no scripting function for getting the bounding box of a node, that's a missing feature. Will add this in the next update. If you are using WebGL, this is possible using the extended API.

You can, however do this using the built-in action "On proximity do something"


ishmaru
Registered User
Quote
2018-02-23 13:26:43

That doesn't work for me as I have to specify a node in particular, and i wanted to script this to catch all nodes that overlap and run a loop to see if the node name matches from an array of node names.

Thanks

On that note it would also be great to have "On proximity do something" extended to have an option for any node to be in proximity


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact