Hi,
If you hit the tree geometry you will get null as name
it returns a name only on meshes addChilded to the tree

if you get a null while its supposed to return the name of the plane,
for the sake of debug use "getIntersectPosition"
addChild to tree a tiny cube at the returned location. to see if the projection 
is correct.

if its on the expected location then the bspHit.getUVIntersectPosition might 
indeed have a bug

Actually looking at the mouseEvent3d not being fired, internally not having 
propper types for mouse...
Once restored, it should prevent the use of rays and use MouseEvents3D

for info, if you do need only mouse events, you could use the BSP-dev in 
branches,
Just tested it, and mouse events are fired in there. You would need just to 
change Vector3D by Number3D.

Fabrice



On Nov 27, 2010, at 12:34 PM, macgor wrote:

> Hi everyone,
> 
> Does anybody solved problem fireing MouseEvent3D of dynamically added
> objects to BSPTree?
> I'm adding Planes to tree and i need to get name property when clicked
> on it. BSPHitTest works in random way when I try ro get name by
> bspHit.lastHittedMeshName after doing bspHit.getUVIntersectPosition.
> Some times it returns name of collided plane, but in 90% null.
> 
> Please anybody help :)
> 
> This is part of my code that gave the proper result of hited point on
> wall, but not collided object added to tree:
> 
> var _endPos:Vector3D = new Vector3D();
> _endPos.x = 0;
> _endPos.y = 0;
> _endPos.z = 60000;
> _endPos =
> Utils3D.projectVector(_view.camera.sceneTransform,_endPos);
> bspHit.getUVIntersectPosition(_view.camera.position,_endPos);
> trace("name" + bspHit.lastHittedMeshName);

Reply via email to