• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ViewerEffectPacket类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ViewerEffectPacket的典型用法代码示例。如果您正苦于以下问题:C# ViewerEffectPacket类的具体用法?C# ViewerEffectPacket怎么用?C# ViewerEffectPacket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ViewerEffectPacket类属于命名空间,在下文中一共展示了ViewerEffectPacket类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LookAtEffect

        /// <summary>
        /// Start a particle stream between an agent and an object
        /// </summary>
        /// <param name="sourceAvatar"><seealso cref="UUID"/> Key of the source agent</param>
        /// <param name="targetObject"><seealso cref="UUID"/> Key of the target object</param>
        /// <param name="globalOffset">A <seealso cref="Vector3d"/> representing the beams offset from the source</param>
        /// <param name="type">A <seealso cref="T:PointAtType"/> which sets the avatars lookat animation</param>
        /// <param name="effectID"><seealso cref="UUID"/> of the Effect</param>
        public void LookAtEffect(UUID sourceAvatar, UUID targetObject, Vector3d globalOffset, LookAtType type,
            UUID effectID)
        {
            ViewerEffectPacket effect = new ViewerEffectPacket();

            effect.AgentData.AgentID = Client.Self.AgentID;
            effect.AgentData.SessionID = Client.Self.SessionID;

            float duration;

            switch (type)
            {
                case LookAtType.Clear:
                    duration = 2.0f;
                    break;
                case LookAtType.Hover:
                    duration = 1.0f;
                    break;
                case LookAtType.FreeLook:
                    duration = 2.0f;
                    break;
                case LookAtType.Idle:
                    duration = 3.0f;
                    break;
                case LookAtType.AutoListen:
                case LookAtType.Respond:
                    duration = 4.0f;
                    break;
                case LookAtType.None:
                case LookAtType.Select:
                case LookAtType.Focus:
                case LookAtType.Mouselook:
                    duration = Single.MaxValue / 2.0f;
                    break;
                default:
                    duration = 0.0f;
                    break;
            }

            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
            effect.Effect[0].AgentID = Client.Self.AgentID;
            effect.Effect[0].Color = new byte[4];
            effect.Effect[0].Duration = duration;
            effect.Effect[0].ID = effectID;
            effect.Effect[0].Type = (byte)EffectType.LookAt;

            byte[] typeData = new byte[57];
            Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16);
            Buffer.BlockCopy(targetObject.GetBytes(), 0, typeData, 16, 16);
            Buffer.BlockCopy(globalOffset.GetBytes(), 0, typeData, 32, 24);
            typeData[56] = (byte)type;

            effect.Effect[0].TypeData = typeData;

            Client.Network.SendPacket(effect);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:65,代码来源:AgentManager.cs


示例2: SphereEffect

        /// <summary>
        /// Create a particle swirl around a target position using a <seealso cref="ViewerEffectPacket"/> packet
        /// </summary>
        /// <param name="globalOffset">global offset</param>
        /// <param name="color">A <see cref="Color4"/> object containing the combined red, green, blue and alpha 
        /// color values of particle beam</param>
        /// <param name="duration">a float representing the duration the parcicle beam will last</param>
        /// <param name="effectID">A Unique ID for the beam</param>
        public void SphereEffect(Vector3d globalOffset, Color4 color, float duration, UUID effectID)
        {
            ViewerEffectPacket effect = new ViewerEffectPacket();

            effect.AgentData.AgentID = Client.Self.AgentID;
            effect.AgentData.SessionID = Client.Self.SessionID;

            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
            effect.Effect[0].AgentID = Client.Self.AgentID;
            effect.Effect[0].Color = color.GetBytes();
            effect.Effect[0].Duration = duration;
            effect.Effect[0].ID = effectID;
            effect.Effect[0].Type = (byte)EffectType.Sphere;

            byte[] typeData = new byte[56];
            Buffer.BlockCopy(UUID.Zero.GetBytes(), 0, typeData, 0, 16);
            Buffer.BlockCopy(UUID.Zero.GetBytes(), 0, typeData, 16, 16);
            Buffer.BlockCopy(globalOffset.GetBytes(), 0, typeData, 32, 24);

            effect.Effect[0].TypeData = typeData;

            Client.Network.SendPacket(effect);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:32,代码来源:AgentManager.cs


示例3: SendViewerEffect

 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
 {
 }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:3,代码来源:MyNpcCharacter.cs


示例4: PointAtEffect

        /// <summary>
        /// Start a particle stream between an agent and an object
        /// </summary>
        /// <param name="sourceAvatar"><seealso cref="UUID"/> Key of the source agent</param>
        /// <param name="targetObject"><seealso cref="UUID"/> Key of the target object</param>
        /// <param name="globalOffset"></param>
        /// <param name="type">The type from the <seealso cref="T:PointAtType"/> enum</param>
        /// <param name="effectID">A unique <seealso cref="UUID"/> for this effect</param>
        public void PointAtEffect(UUID sourceAvatar, UUID targetObject, Vector3d globalOffset, PointAtType type,
            UUID effectID)
        {
            ViewerEffectPacket effect = new ViewerEffectPacket();

            effect.AgentData.AgentID = Client.Self.AgentID;
            effect.AgentData.SessionID = Client.Self.SessionID;

            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
            effect.Effect[0].AgentID = Client.Self.AgentID;
            effect.Effect[0].Color = new byte[4];
            effect.Effect[0].Duration = (type == PointAtType.Clear) ? 0.0f : Single.MaxValue / 4.0f;
            effect.Effect[0].ID = effectID;
            effect.Effect[0].Type = (byte)EffectType.PointAt;

            byte[] typeData = new byte[57];
            if (sourceAvatar != UUID.Zero)
                Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16);
            if (targetObject != UUID.Zero)
                Buffer.BlockCopy(targetObject.GetBytes(), 0, typeData, 16, 16);
            Buffer.BlockCopy(globalOffset.GetBytes(), 0, typeData, 32, 24);
            typeData[56] = (byte)type;

            effect.Effect[0].TypeData = typeData;

            Client.Network.SendPacket(effect);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:36,代码来源:AgentManager.cs


示例5: SendViewerEffect

 public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
 {
     throw new System.NotImplementedException();
 }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:4,代码来源:VWHClientView.cs


示例6: BeamEffect

        /// <summary>
        /// Create a particle beam between an avatar and an primitive
        /// </summary>
        /// <param name="sourceAvatar"><seealso cref="T:libsecondlife.LLUUID"/> of sources avatar</param>
        /// <param name="targetObject"><seealso cref="T:libsecondlife.LLUUID"/> of the target</param>
        /// <param name="globalOffset"><seealso cref="T:libsecondlife.LLVector3d"/>global offset</param>
        /// <param name="color"><seealso cref="T:libsecondlife.LLColor"/>Color values of beam</param>
        /// <param name="duration">a float representing the duration the beam will last</param>
        /// <param name="effectID"><seealso cref="T:libsecondlife.LLUUID"/> of the Effect</param>
        public void BeamEffect(LLUUID sourceAvatar, LLUUID targetObject, LLVector3d globalOffset, LLColor color, 
            float duration, LLUUID effectID)
        {
            ViewerEffectPacket effect = new ViewerEffectPacket();

            effect.AgentData.AgentID = Client.Self.AgentID;
            effect.AgentData.SessionID = Client.Self.SessionID;

            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
            effect.Effect[0].AgentID = Client.Self.AgentID;
            effect.Effect[0].Color = color.GetFloatBytes();
            effect.Effect[0].Duration = duration;
            effect.Effect[0].ID = effectID;
            effect.Effect[0].Type = (byte)EffectType.Beam;

            byte[] typeData = new byte[56];
            Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16);
            Buffer.BlockCopy(targetObject.GetBytes(), 0, typeData, 16, 16);
            Buffer.BlockCopy(globalOffset.GetBytes(), 0, typeData, 32, 24);

            effect.Effect[0].TypeData = typeData;

            Client.Network.SendPacket(effect);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:34,代码来源:AgentManager.cs


示例7: VoiceEffect

        public void VoiceEffect(float volumeLevel)
        {
            ViewerEffectPacket effect = new ViewerEffectPacket();

            effect.AgentData.AgentID = Client.Self.AgentID;
            effect.AgentData.SessionID = Client.Self.SessionID;

            effect.Effect = new ViewerEffectPacket.EffectBlock[1];
            effect.Effect[0] = new ViewerEffectPacket.EffectBlock();
            effect.Effect[0].AgentID = Client.Self.AgentID;
            effect.Effect[0].Color = new byte[4];
            effect.Effect[0].Duration = 0.0f;
            effect.Effect[0].ID = new UUID("F6EB8CE4-1E08-4441-8AE7-762C8E6529AE");
            effect.Effect[0].Type = (byte)EffectType.VolumeLevel;

            byte[] typeData = new byte[24];
            Buffer.BlockCopy(Client.Self.AgentID.GetBytes(), 0, typeData, 0, 16);
            Buffer.BlockCopy(BitConverter.GetBytes(volumeLevel), 0, typeData, 16, 4);
            Buffer.BlockCopy(BitConverter.GetBytes(Client.Self.LocalID), 0, typeData, 20, 4);

            effect.Effect[0].TypeData = typeData;

            Client.Network.SendPacket(effect);
        }
开发者ID:3di,项目名称:3di-viewer-rei-libs,代码行数:24,代码来源:AgentManager.cs


示例8: SendViewerEffectPackets

        private void SendViewerEffectPackets(QueuedInterestListEvent[] eventDatas, IScenePresence presence)
        {
            if (!(presence is LLAgent) || presence.InterestList == null)
                return;
            LLAgent agent = (LLAgent)presence;

            ViewerEffectPacket packet = new ViewerEffectPacket();
            packet.Header.Reliable = false;
            packet.AgentData.AgentID = presence.ID;
            packet.Effect = new ViewerEffectPacket.EffectBlock[eventDatas.Length];

            for (int i = 0; i < eventDatas.Length; i++)
                packet.Effect[i] = (ViewerEffectPacket.EffectBlock)eventDatas[i].Event.State;

            m_udp.SendPacket(agent, packet, ThrottleCategory.Task, true);
        }
开发者ID:thoys,项目名称:simian,代码行数:16,代码来源:Animations.cs


示例9: sendParticleCircle

        public void sendParticleCircle(UUID who, float dur)
        {
            ViewerEffectPacket p = new ViewerEffectPacket();
            p.AgentData = new ViewerEffectPacket.AgentDataBlock();
            p.AgentData.AgentID = rc.plugin.frame.AgentID;
            p.AgentData.SessionID = rc.plugin.frame.SessionID;
            p.Effect = new ViewerEffectPacket.EffectBlock[1];
            p.Effect[0] = new ViewerEffectPacket.EffectBlock();
            p.Effect[0].AgentID = rc.plugin.frame.AgentID;
            p.Effect[0].Duration = dur;
            p.Effect[0].ID = UUID.Random();
            p.Effect[0].Type = (byte)7;
            p.Effect[0].TypeData= new byte[56];
            Buffer.BlockCopy(who.GetBytes(),0,p.Effect[0].TypeData,0,16);
            Buffer.BlockCopy(UUID.Zero.GetBytes(),0,p.Effect[0].TypeData,16,16);
            Buffer.BlockCopy(Vector3d.Zero.GetBytes(), 0, p.Effect[0].TypeData, 32, 24);
            p.Header.Reliable = true;
            p.Effect[0].Color = new byte[4];

            Buffer.BlockCopy(
                rc.plugin.SharedInfo.rainbow[colorIndex], 0, p.Effect[0].Color, 0, 4);

            rc.plugin.proxy.InjectPacket(p, Direction.Outgoing);
            rc.plugin.proxy.InjectPacket(p, Direction.Outgoing);
        }
开发者ID:zadark,项目名称:par,代码行数:25,代码来源:RadarChatForm1.cs


示例10: sendMassSwirl

        public void sendMassSwirl(List<UUID> u,float dur)
        {
            ViewerEffectPacket p = new ViewerEffectPacket();
            p.AgentData = new ViewerEffectPacket.AgentDataBlock();
            p.AgentData.AgentID = rc.plugin.frame.AgentID;
            p.AgentData.SessionID = rc.plugin.frame.SessionID;
            p.Effect = new ViewerEffectPacket.EffectBlock[u.Count];
            for(int i = 0;i<u.Count;i++)
            {
                p.Effect[i] = new ViewerEffectPacket.EffectBlock();
                p.Effect[i].AgentID = rc.plugin.frame.AgentID;
                p.Effect[i].Duration = dur;
                p.Effect[i].ID = UUID.Random();
                p.Effect[i].Type = (byte)7;
                p.Effect[i].TypeData= new byte[56];
                Buffer.BlockCopy(u[i].GetBytes(),0,p.Effect[i].TypeData,0,16);
                Buffer.BlockCopy(UUID.Zero.GetBytes(),0,p.Effect[i].TypeData,16,16);
                Buffer.BlockCopy(Vector3d.Zero.GetBytes(), 0, p.Effect[i].TypeData, 32, 24);
                //rc.plugin.proxy.writethis("sent in " + u[i].ToString(), ConsoleColor.Black, ConsoleColor.Cyan);
                p.Effect[i].Color = new byte[4];
                 Buffer.BlockCopy(
                rc.plugin.SharedInfo.rainbow[colorIndex], 0, p.Effect[i].Color, 0, 4);
            }
            p.Header.Reliable = true;

            rc.plugin.proxy.InjectPacket(p, Direction.Outgoing);

            rc.plugin.proxy.InjectPacket(p, Direction.Outgoing);
        }
开发者ID:zadark,项目名称:par,代码行数:29,代码来源:RadarChatForm1.cs


示例11: OutViewerEffectHandler

        private Packet OutViewerEffectHandler(Packet packet, IPEndPoint sim)
        {
            if (form.Mode != xtrafxMode.Disabled)
            {
                ViewerEffectPacket ViewerEffect = (ViewerEffectPacket)packet;
                bool inject = false;
                foreach (ViewerEffectPacket.EffectBlock effect in ViewerEffect.Effect)
                {
                    if (effect.Type == (byte)EffectType.Beam)
                    {

                        if (form.Mode == xtrafxMode.Speak)
                        {
                            oldTime = System.Environment.TickCount;
                            Vector3d newVec = new Vector3d(effect.TypeData, 32);

                            if (curentOn == false)
                            {
                                shoutOut(9000, "start");
                                curentOn = true;
                            }
                            if ((lastVec.Equals(newVec) == false))
                            {

                                lastVec = newVec;
                                shoutOut(9000, this.lastVec.ToString());
                            }
                            return null;

                        }

                        inject = true;
                        Buffer.BlockCopy(
                            plugin.SharedInfo.rainbow[form.xtrafx_Index], 0, effect.Color, 0, 4);
                        form.xtrafx_Index++;

                        if (form.xtrafx_Index >= plugin.SharedInfo.rainbow.Length)
                        {
                            form.xtrafx_Index = 0;
                        }

                        if (form.Mode == xtrafxMode.Quad)
                        {
                            // trial: multi-beam
                            Vector3d position = new Vector3d(effect.TypeData, 32);
                            Logger.Log("Sending a effect to " + Utils.BytesToHexString(effect.TypeData,"effect"), Helpers.LogLevel.Info);
                            ViewerEffectPacket[][][] ve = new ViewerEffectPacket[2][][];
                            for (int x = 0; x < 2; x++)
                            {
                                ve[x] = new ViewerEffectPacket[2][];
                                for (int y = 0; y < 2; y++)
                                {
                                    ve[x][y] = new ViewerEffectPacket[2];
                                    for (int z = 0; z < 2; z++)
                                    {
                                        ve[x][y][z] = new ViewerEffectPacket();
                                        ve[x][y][z].HasVariableBlocks = true;
                                        ve[x][y][z].Type = PacketType.ViewerEffect;
                                        ve[x][y][z].AgentData = new ViewerEffectPacket.AgentDataBlock();
                                        ve[x][y][z].AgentData.AgentID = frame.AgentID;
                                        ve[x][y][z].AgentData.SessionID = frame.SessionID;
                                        ve[x][y][z].Effect = new ViewerEffectPacket.EffectBlock[1];
                                        ve[x][y][z].Effect[0] = new ViewerEffectPacket.EffectBlock();
                                        ve[x][y][z].Effect[0].ID = UUID.Random();
                                        ve[x][y][z].Effect[0].AgentID = effect.AgentID;
                                        ve[x][y][z].Effect[0].Type = effect.Type;
                                        ve[x][y][z].Effect[0].Duration = effect.Duration;
                                        ve[x][y][z].Effect[0].Color = effect.Color;
                                        ve[x][y][z].Effect[0].TypeData = effect.TypeData;
                                        double ox = ((double)x - 0.5f);
                                        double oy = ((double)y - 0.5f);
                                        double oz = ((double)z - 0.5f);
                                        Vector3d pos = new Vector3d(ox + position.X, oy + position.Y, oz + position.Z);
                                        Buffer.BlockCopy(pos.GetBytes(), 0, ve[x][y][z].Effect[0].TypeData, 32, 24);
                                        ve[x][y][z].Header.Reliable = false;
                                        proxy.InjectPacket(ve[x][y][z], Direction.Outgoing);
                                    }
                                }
                            }
                        }
                        if (form.Mode == xtrafxMode.Circles)
                        {
                            Vector3d TargetPosition = new Vector3d(effect.TypeData, 32);
                            int MapX = ((int)(plugin.SharedInfo.RegionHandle >> 32) );
                            int MapY = ((int)(plugin.SharedInfo.RegionHandle & 0x00000000FFFFFFFF) );
                            Vector3d myPos = new Vector3d(
                                MapX + plugin.SharedInfo.AvPosition.X,
                                MapY + plugin.SharedInfo.AvPosition.Y,
                                 plugin.SharedInfo.AvPosition.Z);
                            Vector3d myLine = TargetPosition - myPos;
                            float duration = effect.Duration * (float)(((double)38 - (myLine.Length()*(2/3))) / 20);
                            if (duration > effect.Duration) duration = effect.Duration;

                            //proxy.writethis("my pos is " + myPos.ToString() + " and target is " + TargetPosition.ToString() + " and myline is " + myLine.ToString(),ConsoleColor.Cyan,ConsoleColor.Black);
                            for (float i = 0; i < (float)Math.Round(myLine.Length()); i+=1.0F)
                            {
                                Vector3d circlePos = myPos + (Vector3d.Normalize(myLine)*i);
                               sendSwirlPoint(circlePos,effect.Color,duration);
                            }
                            sendSwirlPoint(TargetPosition,effect.Color, duration);
//.........这里部分代码省略.........
开发者ID:zadark,项目名称:par,代码行数:101,代码来源:RainbowParticles.cs


示例12: sendSwirlPoint

        public void sendSwirlPoint(Vector3d vec,byte[] color, float dur)
        {
            ViewerEffectPacket v = new ViewerEffectPacket();
            v.Type = PacketType.ViewerEffect;
            v.HasVariableBlocks = true;
            v.AgentData = new ViewerEffectPacket.AgentDataBlock();
            v.AgentData.AgentID = frame.AgentID;
            v.AgentData.SessionID = frame.SessionID;
            v.Effect = new ViewerEffectPacket.EffectBlock[1];
            v.Effect[0] = new ViewerEffectPacket.EffectBlock();
            v.Effect[0].ID = UUID.Random();
            v.Effect[0].AgentID = frame.AgentID;
            v.Effect[0].Type = (byte)EffectType.Beam;
            v.Effect[0].Duration = dur;
            v.Effect[0].Color = color;
            v.Effect[0].TypeData = new byte[56];
                Buffer.BlockCopy(UUID.Zero.GetBytes(),0,v.Effect[0].TypeData,0,16);
                Buffer.BlockCopy(UUID.Zero.GetBytes(),0,v.Effect[0].TypeData,16,16);
                Buffer.BlockCopy(vec.GetBytes(), 0, v.Effect[0].TypeData, 32, 24);

            v.Header.Reliable = false;
            v.Header.Resent = false;
            proxy.InjectPacket(v, Direction.Outgoing);
        }
开发者ID:zadark,项目名称:par,代码行数:24,代码来源:RainbowParticles.cs


示例13: TriggerEffects

        public void TriggerEffects(object sender, ViewerEffect[] effects)
        {
            if (OnTriggerEffects != null)
            {
                OnTriggerEffects(sender, effects);
            }

            ViewerEffectPacket effect = new ViewerEffectPacket();
            effect.AgentData.AgentID = UUID.Zero;
            effect.AgentData.SessionID = UUID.Zero;

            effect.Effect = new ViewerEffectPacket.EffectBlock[effects.Length];

            for (int i = 0; i < effects.Length; i++)
            {
                ViewerEffect currentEffect = effects[i];
                ViewerEffectPacket.EffectBlock block = new ViewerEffectPacket.EffectBlock();

                block.AgentID = currentEffect.AgentID;
                block.Color = currentEffect.Color.GetBytes(true);
                block.Duration = currentEffect.Duration;
                block.ID = currentEffect.EffectID;
                block.Type = (byte)currentEffect.Type;
                block.TypeData = currentEffect.TypeData;

                effect.Effect[i] = block;
            }

            udp.BroadcastPacket(effect, PacketCategory.State);
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:30,代码来源:SceneManager.cs



注:本文中的ViewerEffectPacket类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Viewport类代码示例发布时间:2022-05-24
下一篇:
C# ViewType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap