예제 #1
0
        public void Move(PGB_Vector3 NextPosition)
        {
            _goalPosition = Library.ToVector3(NextPosition);

            while (true)
            {
                var leader = SelectLeader();
            }
        }
예제 #2
0
        // step by interval
        public override void MoveStep(PGB_Vector3 nextPosition)
        {
            var curr = _currentPosition;
            var next = Library.ToVector3(nextPosition);

            curr -= next;

            var ceta = MathF.Atan2(curr.Y, curr.X);

            var dx = MathF.Cos(ceta) * _speed;
            var dy = MathF.Sin(ceta) * _speed;

            while (curr.Equals(next))
            {
                curr.X += dx;
                curr.Y += dy;
            }

            _currentPosition = curr;
        }
예제 #3
0
 public PGB_Agent(PGB_Vector3 initialPosition, Single speed) : base(initialPosition, speed)
 {
 }
예제 #4
0
 public abstract void MoveStep(PGB_Vector3 nextPosition);
예제 #5
0
 protected Agent(PGB_Vector3 initialPosition, Single speed)
 {
     _currentPosition = Library.ToVector3(initialPosition);
     _speed           = speed;
 }
예제 #6
0
파일: Library.cs 프로젝트: catingame/PGB
 public static Vector3 ToVector3(PGB_Vector3 v)
 {
     return(new Vector3(v.X, v.Y, v.Z));
 }