Sprite3D.pickingCollider

Software: Away3D 4.x

Toast, Newbie
Posted: 21 February 2014 01:25 AM   Total Posts: 2

This seems like it’s a bug in Away3D 4.x, but I’m posting here to get some sort of confirmation before I submit it to github. I am trying to add mouseOver and mouseOut events to a sprite3d object using a PickingColliderType.AS3_BEST_HIT, or really any collider type besides the default bounding box one, and I get null object exception errors when the event triggers.

_spriteMaterial = new ColorMaterial(0xe01f1f);
_spriteSquare = new Sprite3D(_spriteMaterial205);
_spriteSquare.pickingCollider PickingColliderType.AS3_BEST_HIT;
_spriteSquare.showBounds true;
_spriteSquare.mouseEnabled true;
_spriteSquare.addEventListener(MouseEvent3D.MOUSE_OVERspriteSquare_mouseOver);
_spriteSquare.addEventListener(MouseEvent3D.MOUSE_OUTspriteSquare_mouseOut);
private function 
spriteSquare_mouseOver(e:MouseEvent3D):void 
{
 trace
("spriteSquare_mouseOver");
}
  
private function spriteSquare_mouseOut(e:MouseEvent3D):void 
{
 trace
("spriteSquare_mouseOut");

When I trigger the mouseOver event I get a null object exception:

TypeErrorError #1009: Cannot access a property or method of a null object reference.
 
at away3d.entities::Sprite3D/collidesBefore()[C:Workspace4872-EW-Intuitysrcaway3dentitiesSprite3D.as:251]
 at away3d
.core.pick::RaycastPicker/getPickingCollisionVO()[C:Workspace4872-EW-Intuitysrcaway3dcorepickRaycastPicker.as:207]
 at away3d
.core.pick::RaycastPicker/getViewCollision()[C:Workspace4872-EW-Intuitysrcaway3dcorepickRaycastPicker.as:103]
 at away3d
.core.managers::Mouse3DManager/updateCollider()[C:Workspace4872-EW-Intuitysrcaway3dcoremanagersMouse3DManager.as:88]
 at away3d
.containers::View3D/render()[C:Workspace4872-EW-Intuitysrcaway3dcontainersView3D.as:676]
 at App3DBase
/update()[C:Workspace4872-EW-IntuitysrcApp3DBase.as:169]
 at App3DBase
/enterframeHandler()[C:Workspace4872-EW-IntuitysrcApp3DBase.as:278]
 at flash
.events::EventDispatcher/dispatchEventFunction()
 
at flash.events::EventDispatcher/dispatchEvent()
 
at away3d.core.managers::Stage3DProxy/notifyEnterFrame()[C:Workspace4872-EW-Intuitysrcaway3dcoremanagersStage3DProxy.as:92]
 at away3d
.core.managers::Stage3DProxy/onEnterFrame()[C:Workspace4872-EW-Intuitysrcaway3dcoremanagersStage3DProxy.as:579] 

Am I doing something wrong with my implementation, or is this really a bug?

   

John Brookes, Moderator
Posted: 28 February 2014 12:59 PM   Total Posts: 732   [ # 1 ]

Yeah its a bug.
Add an issue to git
https://github.com/away3d/away3d-core-fp11/issues?state=open

   

Toast, Newbie
Posted: 28 February 2014 05:54 PM   Total Posts: 2   [ # 2 ]

Done, and thanks.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X