Пример #1
0
        internal static Animation[] ToAnimations(PackedAnimation[] packedAnimation)
        {
            Animation[] anims = new Animation[packedAnimation.Length];

            for (int i = 0; i < packedAnimation.Length; i++)
            {
                PackedAnimation packed = packedAnimation[i];
                anims[i] = new Animation { AnimID = new UUID(packed.AnimID), ObjectID = new UUID(packed.ObjectID), SequenceNum = packed.SequenceNum };
            }

            return anims;
        }
Пример #2
0
        internal static PackedAnimation[] FromAnimations(Animation[] animations)
        {
            PackedAnimation[] anims = new PackedAnimation[animations.Length];

            for (int i = 0; i < animations.Length; i++)
            {
                Animation anim = animations[i];
                anims[i] = new PackedAnimation { AnimID = anim.AnimID.Guid, ObjectID = anim.ObjectID.Guid, SequenceNum = anim.SequenceNum };
            }

            return anims;
        }
Пример #3
0
        public AgentData ToAgentData()
        {
            UUID agentId = new UUID(this.AgentId);

            AgentData agentData = new AgentData
            {
                ActiveGroupID = new UUID(this.ActiveGroupID),
                AgentAccess = this.AgentAccess,
                AgentID = agentId,
                AgentPrefs = (this.AgentPrefs != null) ? this.AgentPrefs.ToAgentPrefs(agentId) : new AgentPreferencesData(),
                AlwaysRun = this.AlwaysRun,
                Anims = PackedAnimation.ToAnimations(this.Anims),
                Appearance = this.Appearance.ToAppearance(agentId),
                Aspect = this.Aspect,
                AtAxis = this.AtAxis,
                BodyRotation = this.BodyRotation,
                CallbackURI = this.CallbackURI,
                Center = this.Center,
                ChangedGrid = false,
                CircuitCode = this.CircuitCode,
                ControlFlags = this.ControlFlags,
                EnergyLevel = this.EnergyLevel,
                Far = this.Far,
                GodLevel = this.GodLevel,
                Groups = PackedGroupMembership.ToGroups(this.Groups),
                HeadRotation = this.HeadRotation,
                LeftAxis = this.LeftAxis,
                LocomotionState = this.LocomotionState,
                LocomotionFlags = (AgentLocomotionFlags)this.LocomotionFlags,
                Position = this.Position,
                PreyAgent = new UUID(this.PreyAgent),
                RegionHandle = this.RegionHandle,
                SatOnGroup = new UUID(this.SatOnGroup),
                SatOnPrim = new UUID(this.SatOnPrim),
                SatOnPrimOffset = this.SatOnPrimOffset,
                SerializedAttachments = this.SerializedAttachments,
                SessionID = new UUID(this.SessionId),
                Size = this.Size,
                Throttles = this.Throttles,
                UpAxis = this.UpAxis,
                Velocity = this.Velocity,
                RemoteAgents = this.RemoteAgents,
                ConstantForces = this.ConstantForces,
                ConstantForcesAreLocal = this.ConstantForcesAreLocal,
                PresenceFlags = this.PresenceFlags,
                AvatarAsAPrim = this.AvatarAsAPrim
            };

            return agentData;
        }
Пример #4
0
        internal static Animation[] ToAnimations(PackedAnimation[] packedAnimation)
        {
            Animation[] anims = new Animation[packedAnimation.Length];

            for (int i = 0; i < packedAnimation.Length; i++)
            {
                PackedAnimation packed = packedAnimation[i];
                anims[i] = new Animation {
                    AnimID = new UUID(packed.AnimID), ObjectID = new UUID(packed.ObjectID), SequenceNum = packed.SequenceNum
                };
            }

            return(anims);
        }
Пример #5
0
        internal static PackedAnimation[] FromAnimations(Animation[] animations)
        {
            PackedAnimation[] anims = new PackedAnimation[animations.Length];

            for (int i = 0; i < animations.Length; i++)
            {
                Animation anim = animations[i];
                anims[i] = new PackedAnimation {
                    AnimID = anim.AnimID.Guid, ObjectID = anim.ObjectID.Guid, SequenceNum = anim.SequenceNum
                };
            }

            return(anims);
        }
Пример #6
0
        internal static AgentPutMessage FromAgentData(AgentData data)
        {
            AgentPutMessage message = new AgentPutMessage
            {
                ActiveGroupID = data.ActiveGroupID.Guid,
                AgentAccess = data.AgentAccess,
                AgentId = data.AgentID.Guid,
                AgentPrefs = PackedAgentPrefs.FromAgentPrefs(data.AgentPrefs),
                AlwaysRun = data.AlwaysRun,
                Anims = PackedAnimation.FromAnimations(data.Anims),
                Appearance = PackedAppearance.FromAppearance(data.Appearance),
                Aspect = data.Aspect,
                AtAxis = data.AtAxis,
                BodyRotation = data.BodyRotation,
                CallbackURI = data.CallbackURI,
                Center = data.Center,
                CircuitCode = data.CircuitCode,
                ControlFlags = data.ControlFlags,
                EnergyLevel = data.EnergyLevel,
                Far = data.Far,
                GodLevel = data.GodLevel,
                Groups = PackedGroupMembership.FromGroups(data.Groups),
                HeadRotation = data.HeadRotation,
                LeftAxis = data.LeftAxis,
                LocomotionState = data.LocomotionState,
                LocomotionFlags = (int)data.LocomotionFlags,
                Position = data.Position,
                PreyAgent = data.PreyAgent.Guid,
                RegionHandle = data.RegionHandle,
                SatOnGroup = data.SatOnGroup.Guid,
                SatOnPrim = data.SatOnPrim.Guid,
                SatOnPrimOffset = data.SatOnPrimOffset,
                SerializedAttachments = data.SerializedAttachments,
                SessionId = data.SessionID.Guid,
                Size = data.Size,
                Throttles = data.Throttles,
                UpAxis = data.UpAxis,
                Velocity = data.Velocity,
                RemoteAgents = data.RemoteAgents,
                ConstantForces = data.ConstantForces,
                ConstantForcesAreLocal = data.ConstantForcesAreLocal,
                PresenceFlags = data.PresenceFlags,
                AvatarAsAPrim = data.AvatarAsAPrim
            };

            return message;
        }