public void StartPullingObject(ISceneObject o) { IMovementControl c = o.GetControlOfType <IMovementControl>(); if (c != null) { c.Enabled = false; } FollowingControl follow = new FollowingControl(me); follow.Speed = Speed * 2; o.AddControl(follow); }
private void CreateHighlighter() { if (highlighter == null) { if (me is Sphere) { highlighter = new HighlightingSphere(me.SceneMgr, IdMgr.GetNewId(me.SceneMgr.GetCurrentPlayer().GetId())); highlighter.Position = me.Position; (highlighter as Sphere).Radius = (me as Sphere).Radius + 10; (highlighter as Sphere).Color = (me as Sphere).Color; Color border = (me as Sphere).Color; Color center = (me as Sphere).Color; border.A = 0x0; center.A = 0xAA; if (IsCircle) { highlighter.SetGeometry(SceneGeometryFactory.CreateRadialGradientEllipseGeometry( me.SceneMgr, (highlighter as Sphere).Radius, Colors.Transparent, Colors.Transparent, (me as Sphere).Color, me.Position, 1)); } else { highlighter.SetGeometry(SceneGeometryFactory.CreateRadialGradientEllipseGeometry( me.SceneMgr, (highlighter as Sphere).Radius, border, center, Colors.Transparent, me.Position, 1)); } highlighter.AddControl(new CenterCloneControl(me)); highlighter.Visible = false; me.SceneMgr.DelayedAttachToScene(highlighter); } else { throw new NotSupportedException("Highlighting control supports only Sphere parent object yet"); } } }