Ejemplo n.º 1
0
        public override void OnMouseDown(Troll3D.MouseEvent e)
        {
            if (e.mouse_.rightbutton)
            {
                RaycastResult result = TRaycast.FireRayFromMouse();

                if (result.GetEntity() != null)
                {
                    MeshRenderer mr = ( MeshRenderer )result.GetEntity().GetComponent(ComponentType.MeshRenderer);
                    mr.material_.SetMainColor(1.0f, 1.0f, 0.0f, 1.0F);
                }
            }
        }
Ejemplo n.º 2
0
        public override void OnMouseDown(MouseEvent e)
        {
            base.OnMouseDown(e);

            if (e.mouse_.rightbutton)
            {
                RaycastResult result = TRaycast.FireRayFromMouse();

                if (result.GetEntity() == Entity)
                {
                    IsBeingDragged    = true;
                    IntersectionPoint = result.GetIntersectionPoint();
                    DraggedOffset     = Entity.transform_.WorldPosition() - IntersectionPoint;
                }
            }
        }