MouseEvent3D and Awayphysics?

Software: Away3D 4.x

m valentin, Newbie
Posted: 17 October 2011 09:56 PM   Total Posts: 10

Does it work? Can’t seem to find out how to add MouseEvents to a AWPRigidBody, can anybody help?

   

Somokon, Member
Posted: 17 October 2011 10:20 PM   Total Posts: 75   [ # 1 ]

Rigid bodies do not support mouse events, you can only add them to the 3D (Mesh) object. 

I assume you want to apply some sort of logic to the rigid body inside of the MouseEvent3D handler?

   

m valentin, Newbie
Posted: 18 October 2011 10:49 AM   Total Posts: 10   [ # 2 ]

I want to be able to detect when a user clickes on lets say a cube I created.
If I try and add an eventlistener to the mesh, it doesn’t seem to fire an event when the cube/mesh is added to a rigid body?

My question simply is how to interact (mouse) with elements added to the physics?

   

Somokon, Member
Posted: 18 October 2011 05:45 PM   Total Posts: 75   [ # 3 ]

Mouse events on the mesh will still work even if there is also a rigid body referring to that mesh.  Can you post the code that doesn’t work for you?

   

m valentin, Newbie
Posted: 18 October 2011 07:42 PM   Total Posts: 10   [ # 4 ]

Nooo, it can’t be…  doh!!! Just found out I was missing the “mesh.mouseEnabled = true;”
Of course mouseEnabled is false as default; don’t know how I could miss that.
Thanks for your help anyways, think I owe you a beer smile 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X