예제 #1
0
        public void Add(Pax4WayPointPath p_wayPointPathList = null)
        {
            if (p_wayPointPathList == null)
            {
                return;
            }

            _wayPointPath.Add(p_wayPointPathList);
        }
예제 #2
0
        public Pax4ConstraintWayPoint(Pax4ObjectPhysicsPart p_physicsPart, float p_velocityFactor, Pax4WayPointPath p_wayPointPath = null, int p_wayPointIndex = 0)
            : base()
        {
            _velocityFactor = p_velocityFactor;
            _wayPointPath   = p_wayPointPath;
            _wayPointIndex  = p_wayPointIndex;

            SetPhysicsPart(p_physicsPart, p_wayPointIndex);
        }
예제 #3
0
        public void RemoveWayPointPath(Pax4WayPointPath p_wayPointPath = null)
        {
            if (p_wayPointPath == null)
            {
                return;
            }

            _wayPointPath.Remove(p_wayPointPath);
        }
예제 #4
0
        public void AddWayPointPath(Pax4WayPointPath p_wayPointPath = null)
        {
            if (p_wayPointPath == null)
            {
                return;
            }

            _wayPointPath.Add(p_wayPointPath);
        }
예제 #5
0
        public void SetTransform(Pax4WayPointPath p_wayPointPath = null)
        {
            if (p_wayPointPath == null)
            {
                return;
            }

            _matScale       = p_wayPointPath._matScale;
            _matRotation    = p_wayPointPath._matRotation;
            _matTranslation = p_wayPointPath._matTranslation;
        }
예제 #6
0
        public void AddPath(Pax4WayPointPath p_wayPointPath)
        {
            if (p_wayPointPath == null)
            {
                return;
            }

            if (_wayPointPath == null)
            {
                _wayPointPath = new List <Pax4WayPointPath>();
            }

            _wayPointPath.Add(p_wayPointPath);
        }
예제 #7
0
        public void FromWayPointPath(Pax4WayPointPath p_wayPointPath = null, bool p_useWayPointPath0 = false, int p_modValue = 1)
        {
            if (p_wayPointPath == null)
            {
                return;
            }

            Vector3[] wayPoint = null;

            if (p_useWayPointPath0)
            {
                wayPoint = p_wayPointPath._wayPoint0;
            }
            else
            {
                wayPoint = p_wayPointPath._wayPoint;
            }

            if (wayPoint.Length <= 0)
            {
                return;
            }

            Pax4WayPointPath wayPointPath = null;

            for (int i = 0; i < wayPoint.Length; i++)
            {
                if (i % p_modValue != 0)
                {
                    continue;
                }

                wayPointPath = new Pax4WayPointPath();
                wayPointPath.GenerateWayPoint(wayPoint[i]);
                //wayPointPath.SetTransform(p_wayPointPath._matScale, Matrix.Identity, p_wayPointPath._matTranslation);
                wayPointPath.SetTransform(p_wayPointPath);
                _wayPointPath.Add(wayPointPath);
            }
        }
예제 #8
0
 public Pax4ConstraintWayPointAirplane(Pax4ObjectPhysicsPart p_physicsPart, float p_velocityFactor, Vector3 p_angularVelocityFactor, Pax4WayPointPath p_wayPointPath = null, int p_wayPointIndex = 0)
     : base(p_physicsPart, p_velocityFactor, p_wayPointPath, p_wayPointIndex)
 {
     _worldAngularVelocityFactor = p_angularVelocityFactor;
 }
 public Pax4WayPointControllerActor(Pax4ObjectPhysicsPart p_physicsPart, float p_velocityFactor, Pax4WayPointPath p_wayPointPath = null, int p_wayPointIndex = 0)
     : base(p_physicsPart, p_velocityFactor, p_wayPointPath, p_wayPointIndex)
 {
 }
예제 #10
0
 public Pax4ModifierWayPointPathScale(String p_name, PaxState p_parent0, Pax4WayPointPath p_wayPointPath = null)
     : base(p_name, p_parent0, p_wayPointPath)
 {
 }
예제 #11
0
 public Pax4ModifierWayPointPath(String p_name, PaxState p_parent0, Pax4WayPointPath p_wayPointPath = null)
     : base(p_name, p_parent0)
 {
     AddPath(p_wayPointPath);
 }
예제 #12
0
        public void PopulateWithActors(List <Pax4ObjectPhysicsPart> p_result            = null,
                                       EPopulateWithActorsType p_populateWithActorsType = EPopulateWithActorsType._HETEROGENEOUS,
                                       bool p_lava = true,
                                       Pax4WayPointPathList p_wayPointPaths = null,
                                       float p_velocityFactor = 1.0f)
        {
            List <Pax4WayPointPath> wayPointPathList = null;

            if (p_wayPointPaths != null)
            {
                wayPointPathList = p_wayPointPaths._wayPointPath;
            }
            else
            {
                wayPointPathList = _wayPointPath;
            }

            if (wayPointPathList.Count <= 0)
            {
                return;
            }

            if (p_result != null)
            {
                p_result.Clear();
            }

            Pax4WayPointPath wayPointPath = null;
            Pax4Actor        actor        = null;

            int half       = wayPointPathList.Count / 2;
            int halfLength = half;

            for (int wi = 0; wi < wayPointPathList.Count; wi++)
            {
                wayPointPath = wayPointPathList[wi];

                if (p_wayPointPaths == null)
                {
                    halfLength = wayPointPath._wayPoint.Length / 2;
                }

                if (wayPointPath._residentCount != 0) //this allows for multipe calls to PopulateWithActors for the glorious benefit of waves after wave after wave
                {
                    continue;
                }

                if (wayPointPath._locked)
                {
                    if (Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._LAVA ||
                        Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._LAVA_AND_ICE &&
                        Pax4ActorEnemyMonsterIce._current == null)
                    {
                        Pax4ActorEnemyMonsterIce monsterIce = new Pax4ActorEnemyMonsterIce(_iceIndex.ToString(), null, _iceIndex);
                        monsterIce.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);
                        new Pax4WayPointControllerActor(monsterIce, _difficulty, wayPointPath);
                        monsterIce.Enable();
                        continue;
                    }
                    else if (Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._ICE ||
                             Pax4WorldLavaAndIce._missionType == ELavaAndIceMissionType._LAVA_AND_ICE &&
                             Pax4ActorEnemyMonsterLava._current == null)
                    {
                        Pax4ActorEnemyMonsterLava monsterLava = new Pax4ActorEnemyMonsterLava(_lavaIndex.ToString(), null, _lavaIndex);
                        monsterLava.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);
                        new Pax4WayPointControllerActor(monsterLava, _difficulty, wayPointPath);
                        monsterLava.Enable();
                        continue;
                    }
                }
                else
                {
                    switch (p_populateWithActorsType)
                    {
                    case EPopulateWithActorsType._HOMOGENEOUS:

                        if (wayPointPath._wayPoint.Length == 1)
                        {
                            if (p_lava)
                            {
                                actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }
                            else
                            {
                                actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }

                            if (wi % _powerUpRatio == 0)
                            {
                                actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                            }

                            actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);

                            new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, 0);
                            actor.Enable();
                            if (p_result != null)
                            {
                                p_result.Add(actor);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < wayPointPath._wayPoint.Length; i++)
                            {
                                if (i % 3 != 0)
                                {
                                    continue;
                                }

                                if (p_lava)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }

                                actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[i]);

                                if (i % _powerUpRatio == 0)
                                {
                                    actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                                }

                                new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, i);
                                actor.Enable();
                                if (p_result != null)
                                {
                                    p_result.Add(actor);
                                }
                            }
                        }

                        break;

                    case EPopulateWithActorsType._HETEROGENEOUS:

                        if (wayPointPath._wayPoint.Length == 1)
                        {
                            if (wi % 2 == 0)
                            {
                                actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }
                            else
                            {
                                actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                actor.SetScale(Vector3.One * 1.8f);
                            }

                            if (wi % _powerUpRatio == 0)
                            {
                                actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                            }

                            actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);

                            new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, 0);
                            actor.Enable();
                            if (p_result != null)
                            {
                                p_result.Add(actor);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < wayPointPath._wayPoint.Length; i++)
                            {
                                if (i % 3 != 0)
                                {
                                    continue;
                                }

                                if (i % 2 == 0)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }

                                actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[i]);

                                if (i % _powerUpRatio == 0)
                                {
                                    actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                                }

                                new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, i);
                                actor.Enable();
                                if (p_result != null)
                                {
                                    p_result.Add(actor);
                                }
                            }
                        }

                        break;

                    case EPopulateWithActorsType._LAYERED:

                        if (wayPointPath._wayPoint.Length == 1)
                        {
                            if (wi < half)
                            {
                                if (p_lava)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                            }
                            else
                            {
                                if (p_lava)
                                {
                                    actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                                else
                                {
                                    actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                    actor.SetScale(Vector3.One * 1.8f);
                                }
                            }

                            if (wi % _powerUpRatio == 0)
                            {
                                actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                            }

                            actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[0]);

                            new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, 0);
                            actor.Enable();
                            if (p_result != null)
                            {
                                p_result.Add(actor);
                            }
                        }
                        else
                        {
                            for (int i = 0; i < wayPointPath._wayPoint.Length; i++)
                            {
                                if (i % 3 != 0)
                                {
                                    continue;
                                }

                                if (i < halfLength)
                                {
                                    if (p_lava)
                                    {
                                        actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                    else
                                    {
                                        actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                }
                                else
                                {
                                    if (p_lava)
                                    {
                                        actor = new Pax4ActorEnemyAmmoLava(_lavaIndex.ToString(), null, _lavaIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                    else
                                    {
                                        actor = new Pax4ActorEnemyAmmoIce(_iceIndex.ToString(), null, _iceIndex);
                                        actor.SetScale(Vector3.One * 1.8f);
                                    }
                                }

                                actor.MoveTo(Vector3.Zero, wayPointPath._wayPoint[i]);

                                if (i % _powerUpRatio == 0)
                                {
                                    actor.SetPowerUp(Pax4Actor.EActorPowerUp._DURABILITY);
                                }

                                new Pax4WayPointControllerActor(actor, Pax4WorldLavaAndIce._difficulty * 3.0f * p_velocityFactor, wayPointPath, i);
                                actor.Enable();
                                if (p_result != null)
                                {
                                    p_result.Add(actor);
                                }
                            }
                        }

                        break;
                    }
                }
            }
        }