Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

VisualSensor Class Reference

#include <VisualSensor.h>

Inheritance diagram for VisualSensor:

PhysicalObject GraphicalObject List of all members.

Public Member Functions

Private Member Functions

Private Attributes


Detailed Description

A visual sensor, composed of unit sensors (pixels) arranged on a circular segment. It currently has infinite range. The sensor is attached to an object, at relative position relativeR and relative angle relativeAlpha. The view angle is centered around the orientation of the sensor.

Definition at line 12 of file VisualSensor.h.


Constructor & Destructor Documentation

VisualSensor::VisualSensor PhysicalObject parent,
real  relativeX,
real  relativeY,
real  relativeAlpha,
real  R,
real  viewAngle,
unsigned int  nSensors,
std::string  label = ""
 

Constructor.

Parameters:
parent is the object is is attached to, at relative coordinates
relativeX and
relativeY and relative angle . The view angle should be between 0..2Pi.

Definition at line 7 of file VisualSensor.cpp.

References delta, epsilon, M_PI, and Vector2::setXY().

VisualSensor::~VisualSensor  )  [virtual]
 

Definition at line 24 of file VisualSensor.cpp.


Member Function Documentation

void VisualSensor::activate real  gammaM,
real  gammaP
[private]
 

Activates all sensors between gammaM and gammaP. The interval [gammaM, gammaP] is considered to be fully ocluded by an object.

Definition at line 107 of file VisualSensor.cpp.

References epsilon, and real.

Referenced by detectContacts().

real VisualSensor::computeGamma real  dx,
real  dy
[inline, private]
 

Computes the angle gamma corresponding to a point at dx, dy relative to the sensor center. The value is normalized between (-Pi,Pi].

Definition at line 62 of file VisualSensor.h.

References PhysicalObject::alpha, and real.

Referenced by detectContacts().

bool VisualSensor::detectContacts CappedRectangle capsule,
GlobalContactInfoVector contacts
[virtual]
 

Tests for contacts between this object and a capsule.

Reimplemented from PhysicalObject.

Definition at line 48 of file VisualSensor.cpp.

References activate(), computeGamma(), CappedRectangle::cosAlpha, CappedRectangle::l, MathTools::modulus(), CappedRectangle::R, PhysicalObject::r, real, CappedRectangle::sinAlpha, Vector2::x, and Vector2::y.

bool VisualSensor::detectContacts Circle circle,
GlobalContactInfoVector contacts
[virtual]
 

Tests for contacts between this object and a circle.

Reimplemented from PhysicalObject.

Definition at line 27 of file VisualSensor.cpp.

References activate(), computeGamma(), MathTools::modulus(), Circle::R, PhysicalObject::r, real, Vector2::x, and Vector2::y.

bool VisualSensor::detectContacts Border border,
GlobalContactInfoVector contacts
[inline, virtual]
 

Tests for contacts between this object and a border.

Reimplemented from PhysicalObject.

Definition at line 29 of file VisualSensor.h.

virtual bool VisualSensor::detectContacts PhysicalObject object,
GlobalContactInfoVector contacts
[inline, virtual]
 

Redirects contact detection.

Implements PhysicalObject.

Definition at line 24 of file VisualSensor.h.

References PhysicalObject::detectContacts().

Referenced by Spherus::detectContacts(), and IunctusSimulator::detectContacts().

void VisualSensor::draw GUI gui  )  [virtual]
 

Draw the object to the graphical user interface.

Implements GraphicalObject.

Definition at line 178 of file VisualSensor.cpp.

References PhysicalObject::alpha, delta, GUI::drawLine(), PhysicalObject::r, real, GUI::setPenColor(), Vector2::x, and Vector2::y.

Referenced by Spherus::draw().


Member Data Documentation

real VisualSensor::delta [private]
 

Half the view angle.

Definition at line 51 of file VisualSensor.h.

Referenced by draw(), and VisualSensor().

real VisualSensor::epsilon [private]
 

The view angle of an unit sensor (pixel).

Definition at line 54 of file VisualSensor.h.

Referenced by activate(), and VisualSensor().

real VisualSensor::R [private]
 

The radius of the sensor.

Definition at line 45 of file VisualSensor.h.

real VisualSensor::viewAngle [private]
 

The view angle of the sensor.

Definition at line 48 of file VisualSensor.h.


The documentation for this class was generated from the following files:

Thyrix homepageUsers' guide

(C) Arxia 2004-2005