#include <CappedRectangle.h>
Inheritance diagram for CappedRectangle:
Definition at line 13 of file CappedRectangle.h.
|
Definition at line 6 of file CappedRectangle.cpp. References computeBox(), computeInertia(), computeMass(), Vector2::x, and Vector2::y. |
|
Destructor, does nothing. Definition at line 26 of file CappedRectangle.cpp. |
|
Computes the coordinates of the bounding box. It is called after each call to integrate() or rollback(). Reimplemented from PhysicalObject. Definition at line 50 of file CappedRectangle.h. References cosAlpha, and sinAlpha. Referenced by CappedRectangle(). |
|
Computes the moment of inertia around the z axis that passes through the center Reimplemented from PhysicalObject. Definition at line 34 of file CappedRectangle.cpp. Referenced by CappedRectangle(). |
|
Sets the mass based on the dimensions and the density Reimplemented from PhysicalObject. Definition at line 29 of file CappedRectangle.cpp. Referenced by CappedRectangle(). |
|
Tests for contacts between this object and another capped rectangle Reimplemented from PhysicalObject. Definition at line 299 of file CappedRectangle.cpp. References cosAlpha, getISensorLateral(), getISensorSemicircle(), Vector2::getModule(), Vector2::getSquaredModule(), l, M_PI, Vector2::normalize(), PhysicalObject::r, R, real, setISensorLateral(), Vector2::setXY(), sinAlpha, sqr(), Vector2::x, and Vector2::y. |
|
Tests for contacts between this object and a circle. Reimplemented from PhysicalObject. Definition at line 189 of file CappedRectangle.cpp. References cosAlpha, Circle::getISensor(), getISensorLateral(), getISensorSemicircle(), Vector2::getModule(), l, M_PI, Vector2::normalize(), Circle::R, R, PhysicalObject::r, real, Vector2::setXY(), sinAlpha, sqr(), Vector2::x, and Vector2::y. |
|
Tests for contacts between this object and a border. Reimplemented from PhysicalObject. Definition at line 92 of file CappedRectangle.cpp. References cosAlpha, getISensorSemicircle(), l, Border::normal, PhysicalObject::r, real, setISensorLateral(), Vector2::setToZero(), sinAlpha, sqr(), Vector2::x, and Vector2::y. |
|
Contact handling. Implements PhysicalObject. Definition at line 31 of file CappedRectangle.h. References PhysicalObject::detectContacts(). |
|
Detects whether a click of the mouse at rMouse has touched the object. In case of contact, returns true and sets p to the relative vector between the center of the object and the contact point; p is expressed in the object reference frame because it rotates with the object while the object is dragged. Reimplemented from PhysicalObject. Definition at line 618 of file CappedRectangle.cpp. References cosAlpha, Vector2::getModule(), l, real, Vector2::rotate(), Vector2::setXY(), sinAlpha, Vector2::x, and Vector2::y. |
|
Draws the object on the user interface. Implements GraphicalObject. Definition at line 683 of file CappedRectangle.cpp. References GUI::drawCappedRectangle(), l, R, GUI::setBrushColor(), GUI::setPenColor(), Vector2::x, and Vector2::y. |
|
Draws the object's tactile sensors. Definition at line 693 of file CappedRectangle.cpp. References GUI::drawLine(), l, M_PI, nSensorsLateral, R, real, Vector2::x, and Vector2::y. |
|
Returns the index of the lateral sensor corresponding to a contact given by e and the side of the capsule (a positive value corresponds to the top side of the capsule, a negative value to the bottom side). The projection of the contact point on the capsule axis is at a distance e from the capsule center (e can be positive or negative). Definition at line 72 of file CappedRectangle.cpp. References l, and nSensorsLateral. |
|
Returns the index of the lateral sensor corresponding to a contact given by e and the vector p relative to the center of the capsule. The projection of the contact point on the capsule axis is at a distance e from the capsule center (e can be positive or negative). Definition at line 67 of file CappedRectangle.cpp. References getLateralSide(), and real. Referenced by detectContacts(), and setISensorLateral(). |
|
Gets the index of a tactile sensor on a semicircle, given the relative vector p from the end of the capsule's axis to the contact point, and the sign (+ or -) that determins one of the 2 ends of the capsule's axis. Definition at line 38 of file CappedRectangle.cpp. References M_PI, nSensorsLateral, nSensorsSemicircle, real, Vector2::x, and Vector2::y. Referenced by detectContacts(). |
|
Returns the side on which exists a contact given by the vector p relative to the center of the capsule. A positive returned value corresponds to the top side of the capsule, a negative value to the bottom side. Definition at line 109 of file CappedRectangle.h. References real, sinAlpha, Vector2::x, and Vector2::y. Referenced by getISensorLateral(), and setISensorLateral(). |
|
Gets the index of a tactile sensor on a lateral of the capsule, given the side of the capsule determined by the normal component (relative to the capsule's axis) of the vector p, and the linear coordinates of the ends of the lateral contact on the capsule's axis. sinAlpha and cosAlpha are passed as they are already computed. Definition at line 61 of file CappedRectangle.cpp. References getISensorLateral(), getLateralSide(), and real. Referenced by detectContacts(). |
|
Sets the activation of a tactile sensor, corresponding to the given contact. To be overridden. Reimplemented from PhysicalObject. Definition at line 647 of file CappedRectangle.cpp. References ContactInfo::force, ContactInfo::iSensor, ContactInfo::iSensor2, real, and ContactInfo::type. |
|
Cosinus of alpha. Always updated. Definition at line 74 of file CappedRectangle.h. Referenced by computeBox(), VisualSensor::detectContacts(), detectContacts(), and detectMouseContact(). |
|
Dimensions; l is the half length of the rectangle, R its half width. The end half circles will have radius R. Definition at line 70 of file CappedRectangle.h. Referenced by computeInertia(), computeMass(), VisualSensor::detectContacts(), detectContacts(), detectMouseContact(), draw(), drawSensors(), and getISensorLateral(). |
|
The number of tactile sensors per lateral of the rectangle. Definition at line 79 of file CappedRectangle.h. Referenced by drawSensors(), getISensorLateral(), and getISensorSemicircle(). |
|
The number of tactile sensors per end semicircle. Definition at line 82 of file CappedRectangle.h. Referenced by getISensorSemicircle(). |
|
Definition at line 71 of file CappedRectangle.h. Referenced by computeInertia(), computeMass(), VisualSensor::detectContacts(), detectContacts(), draw(), and drawSensors(). |
|
Sinus of alpha. Always updated. Definition at line 76 of file CappedRectangle.h. Referenced by computeBox(), VisualSensor::detectContacts(), detectContacts(), detectMouseContact(), and getLateralSide(). |
Thyrix homepage Users' guide
(C) Arxia 2004-2005