コード例 #1
0
 protected override INode LoadNode(string name, XmlNode xmlNode, Parameters parameters, Vector3 position, Color colour, float scale, string user, UUID userID)
 {
     if (xmlNode.LocalName.Equals("EP"))
     {
         return(_control.AddEP(name, user, userID, position, colour));
     }
     return(_control.AddRouter(name, user, userID, position, colour));
 }
コード例 #2
0
        protected override void Touched(UUID entity, TouchEventArgs args)
        {
            if (!_control.State.GetToggleState(SandboxControl.Build, args.AvatarID))
            {
                return;
            }

            Vector3 pos = Vector3.Add(args.TouchPosition, new Vector3(0f, 0f, .2f));

            if (_control.State.GetToggleState(SandboxControl.EPMode, args.AvatarID))
            {
                _control.AddEP(args.AvatarName, args.AvatarID, pos);
            }
            else
            {
                _control.AddRouter(args.AvatarName, args.AvatarID, pos);
            }
        }
コード例 #3
0
        protected override void Touched(UUID entity, TouchEventArgs args)
        {
            if (!_control.State.GetToggleState(SandboxControl.Build, args.AvatarID))
            {
                return;
            }

            Vector3 inputPos = _factory[entity].Pos;
            Vector3 diff     = Vector3.Subtract(args.AvatarPosition, inputPos);
            float   distance = Vector3.Distance(args.AvatarPosition, inputPos);

            diff = Vector3.Multiply(diff, 1f / distance);
            Vector3 pos = Vector3.Subtract(args.AvatarPosition, diff);

            if (_control.State.GetToggleState(SandboxControl.EPMode, args.AvatarID))
            {
                _control.AddEP(args.AvatarName, args.AvatarID, pos);
            }
            else
            {
                _control.AddRouter(args.AvatarName, args.AvatarID, pos);
            }
        }