Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
get sceneNode from Collision detection

jjoe64
Registered User
Quote
2012-10-19 15:31:04

Hi

I want to know, which SceneNode was shot.

With the Collision detected (Tutorial 6) I only get a collisionPoint.


var collisionPoint = scene.getCollisionGeometry().getCollisionPointWithLine(startLine, endLine, true, null);



How can I get the SceneNode from the point ..? Or how to check only the collision for a given SceneNode (cube).


niko
Moderator
Quote
2012-10-21 07:47:57

Go through all scene nodes you are interested in, get the transformedBoundingBox of it (getTransformedBoundingBox()), and check for collision with it: (intersectsWithLine(lineStart, lineEnd). Depending on if you want the closest scene node only to be collided, you want to check all and get the closest hit scene node. Additionally, you can compare the distance between you and the collision point, and the collision point you get with scene.getCollisionGeometry().getCollisionPointWithLine, to see if you hit a wall before the scene node.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Int?rnational" (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