當前位置: 首頁>>代碼示例>>C#>>正文


C# libsecondlife.LLVector3類代碼示例

本文整理匯總了C#中libsecondlife.LLVector3的典型用法代碼示例。如果您正苦於以下問題:C# LLVector3類的具體用法?C# LLVector3怎麽用?C# LLVector3使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LLVector3類屬於libsecondlife命名空間,在下文中一共展示了LLVector3類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Execute

        public override string Execute(string[] args, LLUUID fromAgentID)
		{
		    if (args.Length == 1)
		    {
		        try
		        {
		            string treeName = args[0].Trim(new char[] { ' ' });
		            ObjectManager.Tree tree = (ObjectManager.Tree)Enum.Parse(typeof(ObjectManager.Tree), treeName);

		            LLVector3 treePosition = new LLVector3(Client.Self.Position.X, Client.Self.Position.Y,
		                Client.Self.Position.Z);
		            treePosition.Z += 3.0f;

		            Client.Objects.AddTree(Client.Network.CurrentSim, new LLVector3(0.5f, 0.5f, 0.5f),
		                LLQuaternion.Identity, treePosition, tree, Client.GroupID, false);

		            return "Attempted to rez a " + treeName + " tree";
		        }
		        catch (Exception)
		        {
		            return "Type !tree for usage";
		        }
		    }

		    string usage = "Usage: !tree [";
		    foreach (string value in Enum.GetNames(typeof(ObjectManager.Tree)))
		    {
		        usage += value + ",";
		    }
		    usage = usage.TrimEnd(new char[] { ',' });
		    usage += "]";
		    return usage;
		}
開發者ID:RavenB,項目名稱:gridsearch,代碼行數:33,代碼來源:TreeCommand.cs

示例2: Self_OnChat

		void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
		{
			if (message.Length > 0)
			{
				_speechSynthesizer.SpeakAsync(message);
			}
		}
開發者ID:chrbayer84,項目名稱:SLAgentCSServer,代碼行數:7,代碼來源:TtsCommand.cs

示例3: Self_OnChat

 void Self_OnChat(string message, byte audible, byte type, byte sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
 {
     if (message.Length > 0 && TestClient.Master == fromName)
     {
         TestClient.Self.Chat(message, 0, MainAvatar.ChatType.Normal);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:7,代碼來源:EchoMasterCommand.cs

示例4: Shoot

 /// <summary>
 /// Aims at the specified position, enters mouselook, presses and
 /// releases the left mouse button, and leaves mouselook
 /// </summary>
 /// <param name="target">Target to shoot at</param>
 /// <returns></returns>
 public static bool Shoot(SecondLife client, LLVector3 target)
 {
     if (client.Self.Movement.TurnToward(target))
         return Shoot(client);
     else
         return false;
 }
開發者ID:chrbayer84,項目名稱:SLAgentCSServer,代碼行數:13,代碼來源:Utilities.cs

示例5: Self_OnChat

		void Self_OnChat(string message, MainAvatar.ChatAudibleLevel audible, MainAvatar.ChatType type, 
            MainAvatar.ChatSourceType sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
		{
			if (message.Length > 0 && Client.MasterKey == id)
			{
			    Client.Self.Chat(message, 0, MainAvatar.ChatType.Normal);
			}
		}
開發者ID:RavenB,項目名稱:gridsearch,代碼行數:8,代碼來源:EchoMasterCommand.cs

示例6: GridManager

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="client">Instance of type SecondLife to associate with this GridManager instance</param>
        public GridManager(SecondLife client)
        {
            Client = client;
            SunDirection = LLVector3.Zero;

            Client.Network.RegisterCallback(PacketType.MapBlockReply, new NetworkManager.PacketCallback(MapBlockReplyHandler));
            Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new NetworkManager.PacketCallback(TimeMessageHandler));
        }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:12,代碼來源:GridManager.cs

示例7: UserProfile

 public UserProfile()
 {
     Circuits = new Dictionary<LLUUID, uint>();
     Inventory = new AgentInventory();
     homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
     homepos = new LLVector3();
     homelookat = new LLVector3();
 }
開發者ID:BackupTheBerlios,項目名稱:ulife-svn,代碼行數:8,代碼來源:UserProfile.cs

示例8: GridManager

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="client">Instance of type SecondLife to associate with this GridManager instance</param>
        public GridManager(SecondLife client)
        {
            Client = client;
            Regions = new Dictionary<string, GridRegion>();
            SunDirection = new LLVector3();

            Client.Network.RegisterCallback(PacketType.MapBlockReply, new PacketCallback(MapBlockReplyHandler));
            Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new PacketCallback(TimeMessageHandler));
        }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:13,代碼來源:GridManager.cs

示例9: Entity

 /// <summary>
 /// Creates a new Entity (should not occur on it's own)
 /// </summary>
 public Entity()
 {
     uuid = new libsecondlife.LLUUID();
     localid = 0;
     m_pos = new LLVector3();
     velocity = new LLVector3();
     rotation = new Quaternion();
     m_name = "(basic entity)";
     children = new List<Entity>();
 }
開發者ID:BackupTheBerlios,項目名稱:ulife-svn,代碼行數:13,代碼來源:Entity.cs

示例10: ChatEventArgs

 public ChatEventArgs(string message, ChatAudibleLevel audible, ChatType type, ChatSourceType sourceType, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
 {
     this.message = message;
     this.audible = audible;
     this.type = type;
     this.sourceType = sourceType;
     this.fromName = fromName;
     this.id = id;
     this.ownerid = ownerid;
     this.position = position;
 }
開發者ID:SObS,項目名稱:SLeek,代碼行數:11,代碼來源:ChatEventArgs.cs

示例11: Self_OnChat

        public void Self_OnChat(string message, ChatAudibleLevel audible, ChatType type, 
            ChatSourceType sourcetype, string fromName, LLUUID id, LLUUID ownerid, LLVector3 position)
        {
            Console.WriteLine(fromName+":" + message);

            if (message.Length > 0 && message.ToLower().Contains(Client.Self.FirstName.ToLower()) && Client.Self.AgentID != id) {
                WebRequest request = WebRequest.Create("http://www.mr-technicl.com/slfutura.php?nick="+ fromName + "&message="+ message);
                WebResponse response = request.GetResponse();
                StreamReader input = new StreamReader(response.GetResponseStream());
                string say = input.ReadToEnd();
                input.Close();
                libsecondlife.Utilities.Realism.Chat(Client, say, ChatType.Normal, 25);
            }
        }
開發者ID:santyr,項目名稱:Futura-Testclient,代碼行數:14,代碼來源:Chat.cs

示例12: ChatEventArgs

 public ChatEventArgs(
     string message, SLChatType type, LLVector3 sourcePos, SLSourceType sourceType,
     LLUUID sourceId, LLUUID ownerId, string fromName,
     bool audible, byte command, LLUUID commandId)
 {
     _message = message;
     _type = type;
     _sourcePos = sourcePos;
     _sourceType = sourceType;
     _sourceId = sourceId;
     _ownerId = ownerId;
     _fromName = fromName;
     _audible = audible;
     _command = command;
     _commandId = commandId;
 }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:16,代碼來源:SLNetComEvents.cs

示例13: MyOnFrame

        private void MyOnFrame(IScriptContext context)
        {
            LLVector3 pos = context.Entity.Pos;

            IScriptReadonlyEntity avatar;

            if (context.TryGetRandomAvatar(out avatar))
            {
                LLVector3 avatarPos = avatar.Pos;

                float x = pos.X + ((float)avatarPos.X.CompareTo(pos.X)) / 2;
                float y = pos.Y + ((float)avatarPos.Y.CompareTo(pos.Y)) / 2;

                LLVector3 newPos = new LLVector3(x, y, pos.Z);

                context.Entity.Pos = newPos;
            }
        }
開發者ID:BackupTheBerlios,項目名稱:ulife-svn,代碼行數:18,代碼來源:FollowRandomAvatar.cs

示例14: PrimData

        public PrimData(byte[] data)
        {
            int i =0;

            this.OwnerID = new LLUUID(data, i); i += 16;
            this.PCode = data[i++];
            this.PathBegin = (ushort)(data[i++] + (data[i++] << 8));
            this.PathEnd = (ushort)(data[i++] + (data[i++] << 8));
            this.PathScaleX = data[i++];
            this.PathScaleY = data[i++];
            this.PathShearX = data[i++];
            this.PathShearY = data[i++];
            this.PathSkew = (sbyte)data[i++];
            this.ProfileBegin = (ushort)(data[i++] + (data[i++] << 8));
            this.ProfileEnd = (ushort)(data[i++] + (data[i++] << 8));
            this.Scale = new LLVector3(data, i); i += 12;
            this.PathCurve = data[i++];
            this.ProfileCurve = data[i++];
            this.ParentID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.ProfileHollow = (ushort)(data[i++] + (data[i++] << 8));
            this.PathRadiusOffset = (sbyte)data[i++];
            this.PathRevolutions = data[i++];
            this.PathTaperX = (sbyte)data[i++];
            this.PathTaperY =(sbyte) data[i++];
            this.PathTwist = (sbyte) data[i++];
            this.PathTwistBegin = (sbyte) data[i++];
            ushort length = (ushort)(data[i++] + (data[i++] << 8));
            this.Texture = new byte[length];
            Array.Copy(data, i, Texture, 0, length); i += length;
            this.CreationDate = (Int32)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.OwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.NextOwnerMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.GroupMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.Position = new LLVector3(data, i); i += 12;
            this.Rotation = new LLQuaternion(data,i, true); i += 12;
            this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
            this.FullID = new LLUUID(data, i); i += 16;
        }
開發者ID:BackupTheBerlios,項目名稱:ulife-svn,代碼行數:40,代碼來源:PrimData.cs

示例15: doStuff

        protected void doStuff(string sim, LLVector3 coords)
        {
            Client.Grid.OnRegionAdd += new GridRegionCallback(GridRegionHandler);

            Console.WriteLine("Caching estate sims...");
            Client.Grid.AddEstateSims();
            System.Threading.Thread.Sleep(3000);

            if (RegionHandle == 0)
            {
                Client.Grid.BeginGetGridRegion(sim, new GridRegionCallback(GridRegionHandler));

                int start = Environment.TickCount;

                while (RegionHandle == 0)
                {
                    Client.Tick();

                    if (Environment.TickCount - start > 10000)
                    {
                        Console.WriteLine("Region handle lookup failed");
                        Disconnect();
                        return;
                    }
                }
            }

            Client.Self.OnTeleport += new TeleportCallback(Avatar_OnTeleportMessage);

            DoneTeleporting = false;
            Client.Self.Teleport(RegionHandle, coords);

            while (!DoneTeleporting)
            {
                Client.Tick();
            }
        }
開發者ID:BackupTheBerlios,項目名稱:libsecondlife-svn,代碼行數:37,代碼來源:Teleport.cs


注:本文中的libsecondlife.LLVector3類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。