public override MovementOutput GetMovement()
        {
            MovementOutput output;

            foreach (DynamicMovement.DynamicMovement movement in this.Movements)
            {
                movement.Character = this.Character;

                output = movement.GetMovement();

                if (output != null)
                {
                    if (output.SquareMagnitude() > 0)
                    {
                        this.LastMovementPerformed = movement;

                        return(output);
                    }
                }
            }

            //if we reach this point, no movement was performed, return empty output
            this.LastMovementPerformed = null;
            return(null);
        }
Example #2
0
        public RVOMovement(DynamicMovement.DynamicMovement goalMovement, List <KinematicData> movingCharacters, List <StaticData> obstacles)
        {
            this.DesiredMovement = goalMovement;
            this.Characters      = movingCharacters;
            this.Obstacles       = obstacles;
            base.Target          = new KinematicData();

            //initialize other properties if you think is relevant
        }
Example #3
0
 public RVOMovement(DynamicMovement.DynamicMovement goalMovement, List <KinematicData> movingCharacters, List <StaticData> obstacles)
 {
     this.DesiredMovement = goalMovement;
     this.Characters      = movingCharacters;
     this.Obstacles       = obstacles;
     base.Target          = new KinematicData();
     this.NumSamples      = 100;
     this.CharacterSize   = 1.0f;
     this.IgnoreDistance  = 4.0f;
 }
Example #4
0
        public RVOMovement(DynamicMovement.DynamicMovement goalMovement, List <KinematicData> movingCharacters, List <StaticData> obstacles)
        {
            this.DesiredMovement = goalMovement;
            this.Characters      = movingCharacters;
            this.Obstacles       = obstacles;
            base.Target          = new KinematicData();

            //initialize other properties if you think is relevant
            this.Weight            = 6.0f;
            this.ObstacleWeight    = 7.0f;
            this.CharacterSize     = 0.5f;
            this.ObstacleSize      = 1.6f;
            this.GoodEnoughPenalty = 0.0f;

            this.LastSample = Vector3.zero;
        }
 public RVOMovement(DynamicMovement.DynamicMovement goalMovement, List <KinematicData> movingCharacters, List <KinematicData> obstacles, KinematicData character)
 {
     this.DesiredMovement = goalMovement;
     this.CharacterSize   = 3f;
     this.NumberOfSamples = 5;
     this.Weight          = 2;
     this.IgnoreDistance  = 5f;
     this.Character       = character;
     this.Characters      = movingCharacters;
     this.Characters.Remove(this.Character);
     this.ObsStart = this.Characters.Count;
     this.Characters.AddRange(obstacles);
     base.Target  = new KinematicData();
     this.Output  = new MovementOutput();
     this.samples = new List <Vector3>();
     //initialize other properties if you think is relevant
 }
Example #6
0
        public override MovementOutput GetMovement()
        {
            MovementOutput output;

            foreach (DynamicMovement.DynamicMovement movement in this.Movements)
            {
                movement.Character = this.Character;

                output = movement.GetMovement();

                if (output.SquareMagnitude() > 0)
                {
                    this.LastMovementPerformed = movement;

                    return output;
                }
            }

            //if we reach this point, no movement was performed, return empty output
            this.LastMovementPerformed = null;
            return new MovementOutput();
        }
Example #7
0
        public override MovementOutput GetMovement()
        {
            MovementOutput output;

            foreach (DynamicMovement.DynamicMovement movement in this.Movements)
            {
                movement.Character = this.Character;

                output = movement.GetMovement();

                if (output.SquareMagnitude() > 0)
                {
                    this.LastMovementPerformed = movement;
                    Debug.DrawRay(this.Character.position, output.linear, movement.MovementDebugColor);


                    return(output);
                }
            }

            //if we reach this point, no movement was performed, return empty steering
            this.LastMovementPerformed = null;
            return(new MovementOutput());
        }
Example #8
0
 public MovementWithWeight(DynamicMovement.DynamicMovement movement, float weight)
 {
     this.Movement = movement;
     this.Weight   = weight;
 }
Example #9
0
 public MovementWithWeight(DynamicMovement.DynamicMovement movement)
 {
     this.Movement = movement;
     this.Weight   = 1.0f;
 }
Example #10
0
 public RVOMovement(DynamicMovement.DynamicMovement goalMovement, List <KinematicData> movingCharacters, List <GameObject> obs)
 {
     this.DesiredMovement = goalMovement;
     base.Target          = new KinematicData();
 }