root/src/BRAINSFramework/Locomotion/LocomotionController.cs

113
1
//****************************************************************//
1
using System;
2
//********************copyright Rik Dodsworth 2009****************//
3
//****************************************************************//
4
//***************************free to use**************************//
5
//****************************************************************//
6
//*******************please just leave this header****************//
7
//*************************for recognition************************//
8
//****************************************************************//
9
//****************************************************************//
10
using System;
11
using System.Collections.Generic;
2
using System.Collections.Generic;
12
using System.Linq;
3
using System.Linq;
13
using System.Text;
4
using System.Text;
...
...
26
        /// <summary>
17
        /// <summary>
27
        /// Gets or sets the maximum speed the agent can travel at
18
        /// Gets or sets the maximum speed the agent can travel at
28
        /// </summary>
19
        /// </summary>
29
        public float MaxSpeed { get; set; }
20
        public float MaxSpeed 
30
        
21
        { 
22
            get; set; 
23
        }
24
       
31
        /// <summary>
25
        /// <summary>
32
        /// Gets or sets the maximum amount an Agent can rotate per second
26
        /// Gets or sets the maximum amount an Agent can rotate per second
33
        /// </summary>
27
        /// </summary>
34
        /// <remarks>Value is in radians</remarks>
28
        /// <remarks>Value is in radians</remarks>
35
        public float MaxRotation { get; set; }
29
        public float MaxRotation 
36
        
30
        { 
31
            get; set; 
32
        }
33
       
37
        /// <summary>
34
        /// <summary>
38
        /// Gets or sets the owning Agent
35
        /// Gets or sets the owning Agent
39
        /// </summary>
36
        /// </summary>
40
        public Agent Owner { get; set; }
37
        public Agent Owner 
41
        
38
        { 
39
            get; set;
40
        }
41
       
42
        /// <summary>
42
        /// <summary>
43
        /// Gets the current speed of the Agent
43
        /// Gets the current speed of the Agent
44
        /// </summary>
44
        /// </summary>
45
        public float Speed { get { return _speed; } }
45
        public float Speed 
46
        
46
        {
47
            get { return _speed; } 
48
        }
49
       
47
        /// <summary>
50
        /// <summary>
48
        /// Gets the velocity as a Vector2 of the Agent
51
        /// Gets the velocity as a Vector2 of the Agent
49
        /// </summary>
52
        /// </summary>
50
        public Vector2 Velocity { get { return _velocity; } }
53
        public Vector2 Velocity 
51
        
54
        { 
55
            get { return _velocity; } 
56
        }
57
       
52
        /// <summary>
58
        /// <summary>
53
        /// Gets or sets wether the Agent can move at all
59
        /// Gets or sets the value of wether the Agent will move
54
        /// </summary>
60
        /// </summary>
55
        public bool Stationary { get; set; }
61
        public bool Stationary 
56
        
62
        { 
63
            get; set;
64
        }
65
66
        /// <summary>
67
        /// Initializes a new instance of LocomotionController
68
        /// </summary>
57
        public LocomotionController()
69
        public LocomotionController()
58
        {
70
        {
59
            
71