protected override void OnTarget( Mobile from, object targeted ) { IPoint3D p = targeted as IPoint3D; if ( p == null ) return; else if ( p is Item ) p = ((Item)p).GetWorldTop(); if ( m_First ) { from.SendMessage( "Target another location to complete the bounding box." ); PickTarget target = new PickTarget( new Point3D( p ), false, from.Map, m_Callback, m_State ); target.OnCancelled += new BoundingBoxExCancelled(OnTargetCancelled); from.Target = target; } else if ( from.Map != m_Map ) { from.SendMessage( "Both locations must reside on the same map." ); } else if ( m_Map != null && m_Map != Map.Internal && m_Callback != null ) { Point3D start = m_Store; Point3D end = new Point3D( p ); Utility.FixPoints( ref start, ref end ); m_Callback( from, m_Map, start, end, m_State ); } }
protected override void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; if (p == null) { return; } if (p is Item) { p = ((Item)p).GetWorldTop(); } if (m_First) { from.SendMessage("Target another location to complete the bounding box."); PickTarget target = new PickTarget(new Point3D(p), false, from.Map, m_Callback, m_State); target.OnCancelled += OnTargetCancelled; from.Target = target; } else if (from.Map != m_Map) { from.SendMessage("Both locations must reside on the same map."); } else if (m_Map != null && m_Map != Map.Internal && m_Callback != null) { Point3D start = m_Store; Point3D end = new Point3D(p); Utility.FixPoints(ref start, ref end); m_Callback(from, m_Map, start, end, m_State); } }
public void Begin( Mobile from, BoundingBoxCallback callback, object state ) { from.SendMessage( "Target the first location of the bounding box." ); PickTarget target = new PickTarget(callback, state); target.OnCancelled += new BoundingBoxExCancelled(OnTargetCancelled); from.Target = target; }
public void Begin(Mobile from, BoundingBoxCallback callback, object state) { from.SendMessage("Target the first location of the bounding box."); PickTarget target = new PickTarget(callback, state); target.OnCancelled += OnTargetCancelled; from.Target = target; }
internal override bool ParseNodeBodyElement(string id, VRMLParser parser) { int line = parser.Line; if (id == "enabled") { Enabled = parser.ParseBoolValue(); } else if (id == "objectType") { if (wasObjectType) { ObjectType.AddRange(parser.ParseSFStringOrMFStringValue()); } else { ObjectType = parser.ParseSFStringOrMFStringValue(); } wasObjectType = true; } else if (id == "pickingGeometry") { X3DNode node = parser.ParseSFNodeValue(); if (node != null) { PickingGeometry = node as IX3DPointPickSensorPickingGeometry; if (PickingGeometry == null) { parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line); } } } else if (id == "pickTarget") { List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue(); foreach (X3DNode node in nodes) { IX3DPickSensorNodePickTarget pt = node as IX3DPickSensorNodePickTarget; if (pt == null) { parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line); } else { PickTarget.Add(pt); } } } else if (id == "intersectionType") { IntersectionType = parser.ParseStringValue(); } else if (id == "sortOrder") { SortOrder = parser.ParseStringValue(); } else { return(false); } return(true); }
internal void PickUnBlocked() { mbPicking = true; mPickTarget = PickTarget.UnBlocked; }
internal void PickB() { mbPicking = true; mPickTarget = PickTarget.B; }
internal void PickA() { mbPicking = true; mPickTarget = PickTarget.A; }