示例#1
0
		/*	very simple collision detection method
			all bounding boxes used are rectangular
			to allow use of the Intersects() method
		*/	
		public bool DetectCollision(Agent target){
			if (this.BoundingBox.Intersects (target.BoundingBox)) {
				return true;
			}
			return false;
		}
示例#2
0
		public Sensor (Agent owner, float range)
		{
			this.owner = owner;
			this.range = range;
		}
示例#3
0
		public AdjacentAgentSensor(Agent owner, float range) : base (owner, range){
			AgentsInRange = new Dictionary<Agent, Tuple<float, float>>();
		}
示例#4
0
		public Rangefinder (Agent owner, int range, float headingOffset) : base(owner, range)
		{
			this.headingOffset = headingOffset;
		}
示例#5
0
		public PieSliceSensor (Agent owner, float range, float headingOffset, String marker) : base(owner, range)
		{
			this.headingOffset = headingOffset;
			this.marker = marker;
			DetectedAgents = new List<Agent> ();
		}
示例#6
0
		private void CheckConstraints(Agent a, float relativeHeading, float lowConstraint, float highConstraint)
		{
			if ((Orientation + relativeHeading) % MathHelper.ToRadians (360) < highConstraint && (Orientation + relativeHeading) % MathHelper.ToRadians (360) > lowConstraint)
			{
				ActivationLevel++;
				DetectedAgents.Add (a);
			}
		}