public GoriyaRed(IRoom room, Vector2 position)
 {
     Room                 = room;
     Scale                = 3f;
     controller           = new GoriyaController(this);
     Velocity             = new VelocityVector(0, Orientation.South);
     State                = new GoriyaRedWestWalkingState(this);
     DestinationRectangle = new Rectangle((int)position.X, (int)position.Y, (int)(Scale * Sprite.SourceRectangle.Width), (int)(Scale * Sprite.SourceRectangle.Height));
 }
Esempio n. 2
0
 public Aquamentus(IRoom room, Vector2 position)
 {
     Room  = room;
     Scale = 3f;
     DestinationRectangle = new Rectangle((int)position.X, (int)position.Y, (int)(Scale * WIDTH), (int)(Scale * HEIGHT));
     Velocity             = new VelocityVector(0, Orientation.West);
     State      = new AquamentusWestIdleState(this);
     controller = new AquamentusController(this);
 }
Esempio n. 3
0
 public GelDarkBlue(IRoom room, Vector2 position)
 {
     Room                 = room;
     Scale                = 3f;
     Sprite               = EnemySpriteFactory.Instance.CreateGelDarkBlueSprite();
     Velocity             = new VelocityVector(0, Orientation.South);
     State                = new GelDarkBlueIdleState(this);
     controller           = new JellyController(this);
     DestinationRectangle = new Rectangle((int)position.X, (int)position.Y, (int)(Scale * Sprite.SourceRectangle.Width), (int)(Scale * Sprite.SourceRectangle.Height));
 }
Esempio n. 4
0
        public Link(Vector2 position)
        {
            Scale                = 3f;
            Velocity             = new VelocityVector(0, Orientation.South);
            State                = new LinkNonMovingSouthState(this);
            DestinationRectangle = new Rectangle((int)position.X, (int)position.Y, (int)(Scale * LINK_WIDTH), (int)(Scale * LINK_HEIGHT));

            CurrentHitPoints = 6;
            MaxHitPoints     = 6;
        }
Esempio n. 5
0
 public WallMaster(IRoom room, Vector2 position)
 {
     Room                 = room;
     Scale                = 3f;
     Velocity             = new VelocityVector(0, Orientation.South);
     State                = new WallMasterIdleState(this);
     controller           = new WallMasterController(this);
     Sprite               = ItemSpriteFactory.Instance.CreateEmptyItem();
     DestinationRectangle = new Rectangle((int)position.X, (int)position.Y, WIDTH, HEIGHT);
 }
 public KeeseBlue(IRoom room, Vector2 position)
 {
     Room   = room;
     Scale  = 3f;
     Sprite = EnemySpriteFactory.Instance.CreateKeeseBlueSprite();
     DestinationRectangle = new Rectangle((int)position.X, (int)position.Y, (int)(Scale * width), (int)(Scale * height));
     Velocity             = new VelocityVector(0, Orientation.South);
     State      = new KeeseBlueIdleState(this);
     controller = new KeeseController(this);
 }
 public ProjectileMotionData(ProjectileMotionData other)
 {
     xPos                = other.xPos;
     yPos                = other.yPos;
     zPos                = other.zPos;
     velocityVector      = new VelocityVector(other.velocityVector);
     gravityAcceleration = other.gravityAcceleration;
     time                = other.time;
     deltaTime           = other.deltaTime;
     maxY                = other.maxY;
     maxYTime            = other.maxYTime;
     isAirDrag           = other.isAirDrag;
     mass                = other.mass;
     airDensity          = other.airDensity;
     dragCoefficient     = other.dragCoefficient;
     crossSectionalArea  = other.crossSectionalArea;
 }
        /// <summary>
        /// Resets this EnemyData instance.
        /// </summary>
        public void Clear()
        {
            Time           = 0;
            Name           = null;
            BearingRadians = 0.0;
            Distance       = 0.0;
            Energy         = 0.0;
            Position.Zero();
            Velocity        = 0.0;
            Acceleration    = 0.0;
            HeadingRadians  = 0.0;
            TurnRateRadians = 0.0;

            //Added by Clement
            VelocityVector.Zero();
            HeadingVector.Zero();
        }
    public ProjectileMotionData()
    {
        xPos                = 0.0f;
        yPos                = 0.0f;
        zPos                = 0.0f;
        velocityVector      = new VelocityVector();
        gravityAcceleration = 9.81f;
        time                = 0.0f;
        deltaTime           = Time.fixedDeltaTime;
        maxY                = 0.0f;
        maxYTime            = 0.0f;
        isAirDrag           = false;
        mass                = 1.0f;
        airDensity          = 1.225f;
        dragCoefficient     = 0.5f;
        crossSectionalArea  = 0.0314f;

        velocityVector.SomethingHasChanged += NotifyAboutVelocityVectorChange;
    }
Esempio n. 10
0
        public override string ToString()
        {
            var builder = new System.Text.StringBuilder();

            builder.AppendFormat("{0} {{", nameof(Driver)).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(CarId), CarId.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(CarModel), CarModel.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(CarSkin), CarSkin.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(Name), Name.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(Team), Team.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(GUID), GUID.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(IsConnected), IsConnected.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(Position), Position.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(VelocityVector), VelocityVector.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(Speed), Speed.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(SplinePosition), SplinePosition.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(Gear), Gear.ToString()).AppendLine();
            builder.AppendFormat("    {0} = {1}", nameof(EngineRPM), EngineRPM.ToString()).AppendLine();
            builder.AppendFormat("}}").AppendLine();
            return(builder.ToString());
        }
Esempio n. 11
0
            /// <summary>
            /// Create an struct to hold bin vectors for the amplitude data.
            /// Average the amplitude value for each bin and store as the magnitude value.
            /// </summary>
            /// <param name="ensemble">Ensemble to generate vector values.</param>
            /// <returns>Vectors for each bin in ensemble.</returns>
            public static DataSet.EnsembleVelocityVectors GenerateAmplitudeVectors(DataSet.Ensemble ensemble)
            {
                RTI.DataSet.VelocityVector[] vv = null;

                if (ensemble.IsAmplitudeAvail)
                {
                    // Create Velocity Vector with averaged amplitude data
                    vv = new RTI.DataSet.VelocityVector[ensemble.AmplitudeData.NumElements];

                    // Create a vector for each bin
                    // Take the average of the amplitude for the bin value
                    for (int bin = 0; bin < ensemble.EarthVelocityData.NumElements; bin++)
                    {
                        // Get the average for each bin
                        float avg   = 0;
                        int   count = 0;
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_0_INDEX] != DataSet.Ensemble.BAD_VELOCITY)
                        {
                            avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_0_INDEX]; count++;
                        }
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_1_INDEX] != DataSet.Ensemble.BAD_VELOCITY)
                        {
                            avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_1_INDEX]; count++;
                        }
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_2_INDEX] != DataSet.Ensemble.BAD_VELOCITY)
                        {
                            avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_2_INDEX]; count++;
                        }
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_3_INDEX] != DataSet.Ensemble.BAD_VELOCITY)
                        {
                            avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_3_INDEX]; count++;
                        }

                        // Ensure values were found
                        if (count > 0)
                        {
                            avg /= count;
                        }

                        vv[bin]                 = new VelocityVector();
                        vv[bin].Magnitude       = avg;
                        vv[bin].DirectionXNorth = 0;
                        vv[bin].DirectionYNorth = 0;
                    }
                }


                // Create struct to hold the data
                DataSet.EnsembleVelocityVectors ensVec = new DataSet.EnsembleVelocityVectors();
                ensVec.Id = ensemble.EnsembleData.UniqueId;

                if (vv != null)
                {
                    ensVec.Vectors = vv;
                }
                else
                {
                    // Put an BAD velocity entry
                    vv = new DataSet.VelocityVector[1];
                    vv[0].Magnitude       = DataSet.Ensemble.BAD_VELOCITY;
                    vv[0].DirectionXNorth = DataSet.Ensemble.BAD_VELOCITY;
                    vv[0].DirectionYNorth = DataSet.Ensemble.BAD_VELOCITY;

                    ensVec.Vectors = vv;
                }

                return(ensVec);
            }
Esempio n. 12
0
 private EarthVelocityDataSet(int ValueType, int NumElements, int ElementsMultiplier, int Imag, int NameLength, string Name, float[,] EarthVelocityData, bool IsVelocityVectorAvail, VelocityVector[] VelocityVectors)
     : base(ValueType, NumElements, ElementsMultiplier, Imag, NameLength, Name)
 {
     // Initialize data
     this.EarthVelocityData = EarthVelocityData;
     this.IsVelocityVectorAvail = IsVelocityVectorAvail;
     this.VelocityVectors = VelocityVectors;
 }
Esempio n. 13
0
 protected override void ProcessRecord()
 {
     m_velvec = new VelocityVector();
     WriteObject(m_velvec);
 }
Esempio n. 14
0
 public VelocityVector(VelocityVector other)
 {
     SetVector(other.magnitude, other.angle);
 }
Esempio n. 15
0
            /// <summary>
            /// Create an struct to hold bin vectors for the amplitude data.
            /// Average the amplitude value for each bin and store as the magnitude value.
            /// </summary>
            /// <param name="ensemble">Ensemble to generate vector values.</param>
            /// <returns>Vectors for each bin in ensemble.</returns>
            public static DataSet.EnsembleVelocityVectors GenerateAmplitudeVectors(DataSet.Ensemble ensemble)
            {
                RTI.DataSet.VelocityVector[] vv = null;

                if (ensemble.IsAmplitudeAvail)
                {
                    // Create Velocity Vector with averaged amplitude data
                    vv = new RTI.DataSet.VelocityVector[ensemble.AmplitudeData.NumElements];

                    // Create a vector for each bin
                    // Take the average of the amplitude for the bin value
                    for (int bin = 0; bin < ensemble.EarthVelocityData.NumElements; bin++)
                    {
                        // Get the average for each bin
                        float avg = 0;
                        int count = 0;
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_0_INDEX] != DataSet.Ensemble.BAD_VELOCITY) { avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_0_INDEX]; count++; }
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_1_INDEX] != DataSet.Ensemble.BAD_VELOCITY) { avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_1_INDEX]; count++; }
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_2_INDEX] != DataSet.Ensemble.BAD_VELOCITY) { avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_2_INDEX]; count++; }
                        if (ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_3_INDEX] != DataSet.Ensemble.BAD_VELOCITY) { avg += ensemble.AmplitudeData.AmplitudeData[bin, DataSet.Ensemble.BEAM_3_INDEX]; count++; }

                        // Ensure values were found
                        if (count > 0)
                        {
                            avg /= count;
                        }

                        vv[bin] = new VelocityVector();
                        vv[bin].Magnitude = avg;
                        vv[bin].DirectionXNorth = 0;
                        vv[bin].DirectionYNorth = 0;
                    }

                }

                // Create struct to hold the data
                DataSet.EnsembleVelocityVectors ensVec = new DataSet.EnsembleVelocityVectors();
                ensVec.Id = ensemble.EnsembleData.UniqueId;

                if (vv != null)
                {
                    ensVec.Vectors = vv;
                }
                else
                {
                    // Put an BAD velocity entry
                    vv = new DataSet.VelocityVector[1];
                    vv[0].Magnitude = DataSet.Ensemble.BAD_VELOCITY;
                    vv[0].DirectionXNorth = DataSet.Ensemble.BAD_VELOCITY;
                    vv[0].DirectionYNorth = DataSet.Ensemble.BAD_VELOCITY;

                    ensVec.Vectors = vv;
                }

                return ensVec;
            }