/// <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); }
/// <summary> /// Start a particle stream between an agent and an object /// </summary> /// <param name="sourceAvatar"><seealso cref="LLUUID"/> Key of the source agent</param> /// <param name="targetObject"><seealso cref="LLUUID"/> Key of the target object</param> /// <param name="globalOffset"></param> /// <param name="type"><seealso cref="T:PointAtType"/></param> /// <param name="effectID"></param> public void PointAtEffect(LLUUID sourceAvatar, LLUUID targetObject, LLVector3d globalOffset, PointAtType type, 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 = 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 != LLUUID.Zero) Buffer.BlockCopy(sourceAvatar.GetBytes(), 0, typeData, 0, 16); if (targetObject != LLUUID.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); }