Example #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;
		}
Example #2
0
		public Sensor (Agent owner, float range)
		{
			this.owner = owner;
			this.range = range;
		}
Example #3
0
		public AdjacentAgentSensor(Agent owner, float range) : base (owner, range){
			AgentsInRange = new Dictionary<Agent, Tuple<float, float>>();
		}
Example #4
0
		public Rangefinder (Agent owner, int range, float headingOffset) : base(owner, range)
		{
			this.headingOffset = headingOffset;
		}
Example #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> ();
		}
Example #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);
			}
		}