Beispiel #1
0
 internal static Particle CastParticleObject(AW.Particle ret)
 {
     return(new Scene.Particle
     {
         AccelerationMaximum = new Vector3(ret.Acceleration.Maximum.XMagnitude, ret.Acceleration.Maximum.YMagnitude, ret.Acceleration.Maximum.ZMagnitude),
         AccelerationMinimum = new Vector3(ret.Acceleration.Minimum.XMagnitude, ret.Acceleration.Minimum.YMagnitude, ret.Acceleration.Minimum.ZMagnitude),
         AngleMaximum = new Vector3(ret.Angle.Maximum.XMagnitude, ret.Angle.Maximum.YMagnitude, ret.Angle.Maximum.ZMagnitude),
         AngleMinimum = new Vector3(ret.Angle.Minimum.XMagnitude, ret.Angle.Minimum.YMagnitude, ret.Angle.Minimum.ZMagnitude),
         AssetList = ret.AssetList,
         ColorEnd = AwConvert.CastColor(ret.ColorEnd),
         ColorStart = AwConvert.CastColor(ret.ColorStart),
         EmitterLifespan = ret.EmitterLifespan,
         FadeIn = ret.FadeIn,
         FadeOut = ret.FadeOut,
         Flags = new Scene.ParticleFlags()
         {
             CameraEmit = ret.Flags.CameraEmit,
             DrawInFront = ret.Flags.DrawInFront,
             Gravity = ret.Flags.Gravity,
             Interpolate = ret.Flags.Interpolate,
             LinkToMover = ret.Flags.LinkToMover,
             ZoneCollision = ret.Flags.ZoneCollision,
             ZoneExclusive = ret.Flags.ZoneExclusive
         },
         Lifespan = ret.Lifespan,
         Name = ret.Name,
         Opacity = ret.Opacity,
         ReleaseMaximum = ret.ReleaseMaximum,
         ReleaseMinimum = ret.ReleaseMinimum,
         ReleaseSize = ret.ReleaseSize,
         RenderStyle = (Scene.ParticleDrawStyle)ret.RenderStyle,
         SizeMaximum = new Vector3(ret.Size.Maximum.XMagnitude, ret.Size.Maximum.YMagnitude, ret.Size.Maximum.ZMagnitude),
         SizeMinimum = new Vector3(ret.Size.Minimum.XMagnitude, ret.Size.Minimum.YMagnitude, ret.Size.Minimum.ZMagnitude),
         SpeedMaximum = new Vector3(ret.Speed.Maximum.XMagnitude, ret.Speed.Maximum.YMagnitude, ret.Speed.Maximum.ZMagnitude),
         SpeedMinimum = new Vector3(ret.Speed.Minimum.XMagnitude, ret.Speed.Minimum.YMagnitude, ret.Speed.Minimum.ZMagnitude),
         SpinMaximum = new Vector3(ret.Spin.Maximum.XMagnitude, ret.Spin.Maximum.YMagnitude, ret.Spin.Maximum.ZMagnitude),
         SpinMinimum = new Vector3(ret.Spin.Minimum.XMagnitude, ret.Spin.Minimum.YMagnitude, ret.Spin.Minimum.ZMagnitude),
         Style = (Scene.ParticleType)ret.Style,
         VolumeMaximum = new Vector3(ret.Volume.Maximum.XMagnitude, ret.Volume.Maximum.YMagnitude, ret.Volume.Maximum.ZMagnitude),
         VolumeMinimum = new Vector3(ret.Volume.Minimum.XMagnitude, ret.Volume.Minimum.YMagnitude, ret.Volume.Minimum.ZMagnitude),
     });
 }
Beispiel #2
0
 /// <summary>
 /// Casts the zone object.
 /// </summary>
 /// <param name="awZone">The aw zone.</param>
 /// <returns></returns>
 internal static Zone CastZoneObject(AW.Zone awZone)
 {
     return(new Zone()
     {
         Ambient = awZone.Ambient,
         CameraName = awZone.Camera,
         Color = AwConvert.CastColor(awZone.Color),
         Flags = awZone.Flags,
         FogMaximum = awZone.FogMaximum,
         FogMinimum = awZone.FogMinimum,
         Footstep = awZone.Footstep,
         Friction = awZone.Friction,
         Gravity = awZone.Gravity,
         Name = awZone.Name,
         Priority = awZone.Priority,
         Shape = awZone.Shape,
         Size = new Vector3(awZone.Size.XMagnitude, awZone.Size.YMagnitude, awZone.Size.ZMagnitude),
         VoipRights = awZone.VoipRights
     });
 }
Beispiel #3
0
        /// <summary>
        /// Casts the model object.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <returns></returns>
        internal static Model CastModelObject(Instance sender)
        {
            lock (sender)
            {
                try
                {
                    var position = new Vector3
                    {
                        x = sender.GetInt(Attributes.ObjectX),
                        y = sender.GetInt(Attributes.ObjectY),
                        z = sender.GetInt(Attributes.ObjectZ)
                    };

                    var rotation = new Vector3
                    {
                        x = sender.GetInt(Attributes.ObjectTilt),
                        y = sender.GetInt(Attributes.ObjectYaw),
                        z = sender.GetInt(Attributes.ObjectRoll)
                    };

                    var o = new Model(sender.GetInt(Attributes.ObjectId),
                                      sender.GetInt(Attributes.ObjectOwner),
                                      AwConvert.ConvertFromUnixTimestamp(sender.GetInt(Attributes.ObjectBuildTimestamp)),
                                      (ObjectType)sender.GetInt(Attributes.ObjectType),
                                      sender.GetString(Attributes.ObjectModel),
                                      position, rotation, sender.GetString(Attributes.ObjectDescription),
                                      sender.GetString(Attributes.ObjectAction)/*sender.GetInt(Attributes.ObjectNumber),*/
                                      );

                    // o.Hash = sender.GetInt(Attributes.ObjectCallbackReference);

                    return(o);
                }
                catch (InstanceException ex)
                {
                    throw new AwException(ex.ErrorCode);
                }
            }
        }