Collision problem with Billboard

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Nezumi
Posts: 15
Joined: Fri Sep 30, 2005 9:42 pm

Collision problem with Billboard

Post by Nezumi »

My problem is the collision in order to detect if mouse it's over a billboard run strangly...

Look:
Image

Code: Select all

if(e.Type == EventType.MouseInput)
			{
				bool wantTake = false;
				if(e.MouseInputType == MouseInputEvent.MouseMoved) //Cursor Change on over
				{
					if(m_camera == null)
						return false;
					if(m_camera.getCamera() == null)
						return false;
					Line3D ray = m_manager.SceneCollisionManager.GetRayFromScreenCoordinates(m_device.CursorControl.Position,m_camera.getCamera());
					ISceneNode nodeSelected = m_manager.SceneCollisionManager.GetSceneNodeFromRayBB(ray,0);
					if(nodeSelected == null)
						return false;
					if(nodeSelected.ID >= 400) //ID Item
					{
						wantTake=true;
					}
					
				}
				else if(e.MouseInputType == MouseInputEvent.PressedDownLeft) //Selection of the billboard/item
				{
					Line3D ray = m_manager.SceneCollisionManager.GetRayFromScreenCoordinates(m_device.CursorControl.Position,m_camera.getCamera());
					ISceneNode nodeSelected = m_manager.SceneCollisionManager.GetSceneNodeFromRayBB(ray,0);
					if(nodeSelected == null)
						return false;
					if(nodeSelected.ID >= 400) //ID Item
					{
						Console.WriteLine("Click sur item !!");
						foreach(Item item in m_itemsInMap)
						{
							if(item.id_Compare == nodeSelected.ID)
							{
								Console.WriteLine("Item ID: "+item.id.ToString());
								m_clientNetwork.clickItemEvent(item.id);
							}
						}
					}
				}
				if(wantTake)
					cursorstate = CursorState.WantTake;
Petit français
Locked