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