ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperLicht
get sceneNode from Collision detection
Author Text

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


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).

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: "Internationa?" (you are not logged in)




Forum Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Software: Ambiera Light Forum. © 2008-2019 Nikolaus Gebhardt, Ambiera e.U.