Esempio n. 1
0
        public VisualDynamicEntity(ICharacterEntity dynEntity, VoxelModelManager manager)
            : base(dynEntity, manager)
        {
            DynamicEntity = dynEntity;

            //Will be used to update the bounding box with world coordinate when the entity is moving
            LocalBBox.Minimum = new Vector3(-(DynamicEntity.DefaultSize.X / 2.0f), 0, -(DynamicEntity.DefaultSize.Z / 2.0f));
            LocalBBox.Maximum = new Vector3(+(DynamicEntity.DefaultSize.X / 2.0f), DynamicEntity.DefaultSize.Y, +(DynamicEntity.DefaultSize.Z / 2.0f));

            //Set Position
            //Set the entity world position following the position received from server
            WorldPosition.Value     = DynamicEntity.Position;
            WorldPosition.ValuePrev = DynamicEntity.Position;

            //Compute the initial Player world bounding box
            RefreshWorldBoundingBox(ref WorldPosition.Value);

            //Set LookAt
            LookAtDirection.Value     = DynamicEntity.HeadRotation;
            LookAtDirection.ValuePrev = LookAtDirection.Value;

            //Set Move direction = to LookAtDirection
            MoveDirection.Value = LookAtDirection.Value;

            //Change the default value when Player => The player message arrive much more faster !
            if (DynamicEntity is PlayerCharacter)
            {
                _interpolationRate = 0.1;
            }

            _netLocation = new NetworkValue <Vector3D> {
                Value = WorldPosition.Value, Interpolated = WorldPosition.Value
            };

            WithNetworkInterpolation = true;
        }
        void ReleaseDesignerOutlets()
        {
            if (NetworkUpdateButton != null)
            {
                NetworkUpdateButton.Dispose();
                NetworkUpdateButton = null;
            }

            if (Authentication != null)
            {
                Authentication.Dispose();
                Authentication = null;
            }

            if (BootFileLabel != null)
            {
                BootFileLabel.Dispose();
                BootFileLabel = null;
            }

            if (ConfigFileLabel != null)
            {
                ConfigFileLabel.Dispose();
                ConfigFileLabel = null;
            }

            if (DefaultGateway != null)
            {
                DefaultGateway.Dispose();
                DefaultGateway = null;
            }

            if (DeployButton != null)
            {
                DeployButton.Dispose();
                DeployButton = null;
            }

            if (DeviceType != null)
            {
                DeviceType.Dispose();
                DeviceType = null;
            }

            if (EnableDHCP != null)
            {
                EnableDHCP.Dispose();
                EnableDHCP = null;
            }

            if (EncryptConfig != null)
            {
                EncryptConfig.Dispose();
                EncryptConfig = null;
            }

            if (Encryption != null)
            {
                Encryption.Dispose();
                Encryption = null;
            }

            if (FirmwareStatus != null)
            {
                FirmwareStatus.Dispose();
                FirmwareStatus = null;
            }

            if (FlashFileLabel != null)
            {
                FlashFileLabel.Dispose();
                FlashFileLabel = null;
            }

            if (FreeSlots != null)
            {
                FreeSlots.Dispose();
                FreeSlots = null;
            }

            if (MacAddress != null)
            {
                MacAddress.Dispose();
                MacAddress = null;
            }

            if (NetworkKey != null)
            {
                NetworkKey.Dispose();
                NetworkKey = null;
            }

            if (NetworkMacAddress != null)
            {
                NetworkMacAddress.Dispose();
                NetworkMacAddress = null;
            }

            if (NetworkValue != null)
            {
                NetworkValue.Dispose();
                NetworkValue = null;
            }

            if (Output != null)
            {
                Output.Dispose();
                Output = null;
            }

            if (Passphrase != null)
            {
                Passphrase.Dispose();
                Passphrase = null;
            }

            if (PrimaryDNS != null)
            {
                PrimaryDNS.Dispose();
                PrimaryDNS = null;
            }

            if (RadioA != null)
            {
                RadioA.Dispose();
                RadioA = null;
            }

            if (RadioB != null)
            {
                RadioB.Dispose();
                RadioB = null;
            }

            if (RadioG != null)
            {
                RadioG.Dispose();
                RadioG = null;
            }

            if (RadioN != null)
            {
                RadioN.Dispose();
                RadioN = null;
            }

            if (ReKeyInternal != null)
            {
                ReKeyInternal.Dispose();
                ReKeyInternal = null;
            }

            if (SaveConfigurationButton != null)
            {
                SaveConfigurationButton.Dispose();
                SaveConfigurationButton = null;
            }

            if (SecondaryDNS != null)
            {
                SecondaryDNS.Dispose();
                SecondaryDNS = null;
            }

            if (SSID != null)
            {
                SSID.Dispose();
                SSID = null;
            }

            if (StaticIPAddress != null)
            {
                StaticIPAddress.Dispose();
                StaticIPAddress = null;
            }

            if (SubnetMask != null)
            {
                SubnetMask.Dispose();
                SubnetMask = null;
            }

            if (UpdateFirmwareButton != null)
            {
                UpdateFirmwareButton.Dispose();
                UpdateFirmwareButton = null;
            }
        }
Esempio n. 3
0
File: Bytes.cs Progetto: nunun/Xnet
 public void WriteUInt32BE(uint v)
 {
     int nextpos = this.tailpos + 4;
     if (nextpos < this.maxLength || this.Extend()) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONUI(v)), 0, accessor, this.tailpos, 4);
         this.tailpos = nextpos;
         this.length += 4;
     }
 }
Esempio n. 4
0
File: Bytes.cs Progetto: nunun/Xnet
 /**
  * 情報を書き込みます (Int16/UInt16)
  * Big Endian (Network Byte Order) を使用します。
  */
 public void WriteInt16BE(short v)
 {
     int nextpos = this.tailpos + 2;
     if (nextpos < this.maxLength || this.Extend()) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONS(v)), 0, accessor, this.tailpos, 2);
         this.tailpos = nextpos;
         this.length += 2;
     }
 }
Esempio n. 5
0
File: Bytes.cs Progetto: nunun/Xnet
 /**
  * 情報を書き込みます (Double)
  * Big Endian (Network Byte Order) を使用します。
  */
 public void WriteDoubleBE(double v)
 {
     int nextpos = this.tailpos + 8;
     if (nextpos < this.maxLength || this.Extend()) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTOND(v)), 0, accessor, this.tailpos, 8);
         this.tailpos = nextpos;
         this.length += 8;
     }
 }
Esempio n. 6
0
File: Bytes.cs Progetto: nunun/Xnet
 public uint ReadUInt32BE()
 {
     NetworkValue nv = new NetworkValue();
     nv.NTOHUI(BitConverter.ToUInt32(accessor, this.tailpos));
     this.tailpos += 4;
     return nv.ui;
 }
Esempio n. 7
0
File: Bytes.cs Progetto: nunun/Xnet
 public ushort ReadUInt16BE()
 {
     NetworkValue nv = new NetworkValue();
     nv.NTOHUS(BitConverter.ToUInt16(accessor, this.tailpos));
     this.tailpos += 2;
     return nv.us;
 }
Esempio n. 8
0
File: Bytes.cs Progetto: nunun/Xnet
 /**
  * 情報を読み込みます (Float)
  * Big Endian (Network Byte Order) を使用します。
  */
 public float ReadFloatBE()
 {
     NetworkValue nv = new NetworkValue();
     nv.NTOHF(BitConverter.ToSingle(accessor, this.tailpos));
     this.tailpos += 4;
     return nv.f;
 }
Esempio n. 9
0
File: Bytes.cs Progetto: nunun/Xnet
 /**
  * 情報を読み込みます (Double)
  * Big Endian (Network Byte Order) を使用します。
  */
 public double ReadDoubleBE()
 {
     NetworkValue nv = new NetworkValue();
     nv.NTOHD(BitConverter.ToDouble(accessor, this.tailpos));
     this.tailpos += 8;
     return nv.d;
 }
Esempio n. 10
0
File: Bytes.cs Progetto: nunun/Xnet
 public void PrependUInt32BE(uint v)
 {
     int nextpos = this.headpos - 4;
     if (nextpos >= 0) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONUI(v)), 0, accessor, nextpos, 4);
         this.headpos = nextpos;
         this.length += 4;
     }
 }
Esempio n. 11
0
File: Bytes.cs Progetto: nunun/Xnet
 public void PrependUInt16BE(ushort v)
 {
     int nextpos = this.headpos - 2;
     if (nextpos >= 0) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONUS(v)), 0, accessor, nextpos, 2);
         this.headpos = nextpos;
         this.length += 2;
     }
 }
Esempio n. 12
0
 public NetworkEntry(Symbol symbol, NetworkValue value)
 {
     this.symbol = symbol;
     this.value  = value;
 }