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

Vector2 Class Reference

#include <Vector2.h>

List of all members.

Public Member Functions

Public Attributes


Detailed Description

A 2D vector.

Definition at line 11 of file Vector2.h.


Constructor & Destructor Documentation

Vector2::Vector2  )  [inline]
 

The default constructor, sets the vector to 0.

Definition at line 16 of file Vector2.h.

Vector2::Vector2 real  x,
real  y
[inline]
 

Constructor.

Definition at line 19 of file Vector2.h.

virtual Vector2::~Vector2  )  [inline, virtual]
 

Destructor; does nothing.

Definition at line 22 of file Vector2.h.


Member Function Documentation

void Vector2::cross real  w  )  [inline]
 

The vector r becomes w x r (cross product), w being a vector having just a z axis component.

Definition at line 78 of file Vector2.h.

References real.

Referenced by PhysicalObject::fillContactMatrix(), ArticulatedAgentBase::fillContactMatrix(), and ArticulatedAgentQuasistatic::forwardAccelerations().

real Vector2::getModule  )  [inline]
 

Gets the module of the vector: sqrt(x^2+y^2).

Definition at line 37 of file Vector2.h.

References real, and sqr().

Referenced by ElasticLink::applyForces(), CappedRectangle::detectContacts(), and CappedRectangle::detectMouseContact().

real Vector2::getSquaredModule  )  [inline]
 

Gets the squared module of the vector: x^2+y^2.

Definition at line 44 of file Vector2.h.

References real.

Referenced by ComposedPhysicalObject::computeMassProperties(), CappedRectangle::detectContacts(), and Circle::detectMouseContact().

void Vector2::normalize  )  [inline]
 

Normalizes the vector to have unit module

Definition at line 47 of file Vector2.h.

References real.

Referenced by Pac::controll(), Circle::detectContacts(), and CappedRectangle::detectContacts().

real Vector2::operator * Vector2  v  )  [inline]
 

The scalar product.

Definition at line 112 of file Vector2.h.

References real, x, and y.

Vector2 Vector2::operator * const real  r  )  const [inline]
 

Definition at line 101 of file Vector2.h.

Vector2& Vector2::operator *= const real  r  )  [inline]
 

Definition at line 109 of file Vector2.h.

Vector2 Vector2::operator+ const Vector2 v  )  const [inline]
 

Definition at line 93 of file Vector2.h.

References x, and y.

Vector2& Vector2::operator+= const real  r  )  [inline]
 

Definition at line 107 of file Vector2.h.

Vector2& Vector2::operator+= const Vector2 v  )  [inline]
 

Definition at line 105 of file Vector2.h.

References x, and y.

Vector2 Vector2::operator- const Vector2 v  )  const [inline]
 

Definition at line 97 of file Vector2.h.

References x, and y.

Vector2& Vector2::operator-= const real  r  )  [inline]
 

Definition at line 108 of file Vector2.h.

Vector2& Vector2::operator-= const Vector2 v  )  [inline]
 

Definition at line 106 of file Vector2.h.

References x, and y.

Vector2& Vector2::operator/= const real  r  )  [inline]
 

Definition at line 110 of file Vector2.h.

real Vector2::operator[] int  i  )  [inline]
 

Gets element i; i is numbered starting from 0 (i=0,1).

Definition at line 86 of file Vector2.h.

References real.

real Vector2::operator^ Vector2  v  )  [inline]
 

The vector product (having a component only on the z axis; returns this component).

Definition at line 114 of file Vector2.h.

References real, x, and y.

void Vector2::rotate real  alpha  )  [inline]
 

Rotates the vector with angle alpha. If the vector is initially expressed in a reference system rotated with alpha relative to the laboratory reference system, after rotation the vector will be expressed in the laboratory reference system.

Definition at line 69 of file Vector2.h.

References real.

Referenced by Simulator::applyMouseForce(), ArticulatedAgentQuasistatic::backwardDynamics(), ArticulatedAgentQuasistatic::computeBodyDerivatives(), ArticulatedAgentQuasistatic::computeBodyDerivativesWithoutContacts(), ArticulatedLink::computeForceQuasistatic(), ComposedPhysicalObject::computeMemberPositions(), Pac::controll(), ComposedPhysicalObject::detectMouseContact(), Circle::detectMouseContact(), CappedRectangle::detectMouseContact(), ArticulatedAgentBase::fillContactMatrix(), ArticulatedAgentQuasistatic::forwardAccelerations(), and ArticulatedAgentQuasistatic::forwardKinematics().

void Vector2::setElement int  i,
real  value
[inline]
 

Sets element i to value value; i is numbered starting from 1 (i=1,2).

Definition at line 34 of file Vector2.h.

void Vector2::setToZero  )  [inline]
 

Sets the vector to 0.

Definition at line 28 of file Vector2.h.

Referenced by ArticulatedAgentQuasistatic::backwardDynamics(), PhysicalObject::computeDerivativesWithoutContacts(), ArticulatedLink::computeForceQuasistatic(), ComposedPhysicalObject::computeMassProperties(), ArticulatedLink::deleteContacts(), Circle::detectContacts(), and CappedRectangle::detectContacts().

void Vector2::setXY real  x,
real  y
[inline]
 

Sets x and y components.

Definition at line 31 of file Vector2.h.

Referenced by ComposedPhysicalObject::addObject(), Iunctus::build(), ComposedPhysicalObject::ComposedPhysicalObject(), ArticulatedAgentQuasistatic::computeBodyDerivatives(), ArticulatedAgentQuasistatic::computeBodyDerivativesWithoutContacts(), Spherus::computeDerivativesWithoutContacts(), Spherus::computeMemberPositions(), ComposedPhysicalObject::computeMemberPositions(), CappedRectangle::detectContacts(), CappedRectangle::detectMouseContact(), ArticulatedAgentBase::fillContactMatrix(), ArticulatedAgentQuasistatic::forwardAccelerations(), ArticulatedAgentQuasistatic::forwardKinematics(), Elastoid::integrate(), PhysicalObject::PhysicalObject(), Spherus::Spherus(), and VisualSensor::VisualSensor().

void Vector2::updateMax const Vector2 r  )  [inline]
 

Set vector components to the maximum of either current components or r components.

Definition at line 60 of file Vector2.h.

References x, and y.

Referenced by ComposedPhysicalObject::computeMemberPositions(), Elastoid::integrate(), ArticulatedAgentQuasistatic::integrate(), and ArticulatedAgentQuasistatic::rollback().

void Vector2::updateMin const Vector2 r  )  [inline]
 

Set vector components to the minimum of either current components or r components.

Definition at line 54 of file Vector2.h.

References x, and y.

Referenced by ComposedPhysicalObject::computeMemberPositions(), Elastoid::integrate(), ArticulatedAgentQuasistatic::integrate(), and ArticulatedAgentQuasistatic::rollback().


Member Data Documentation

real Vector2::x
 

Definition at line 24 of file Vector2.h.

Referenced by Simulator::applyMouseForce(), ArticulatedAgentQuasistatic::backwardDynamics(), Border::Border(), CappedRectangle::CappedRectangle(), Circle::Circle(), ArticulatedAgentQuasistatic::computeBodyDerivatives(), Spherus::computeCircleProprioception(), ArticulatedLink::computeForceQuasistatic(), ArticulatedComponent::computeIStar0(), Spherus::computeMemberPositions(), Spherus::computeState(), ArticulatedAgentQuasistatic::computeTotalForces(), VisualSensor::detectContacts(), Circle::detectContacts(), CappedRectangle::detectContacts(), CappedRectangle::detectMouseContact(), VisualSensor::draw(), Spherus::draw(), Iunctus::draw(), Circle::draw(), CappedRectangle::draw(), ArticulatedLink::draw(), GUI::drawCircle(), GUIWx::drawForce(), GUI::drawLine(), Circle::drawSensors(), CappedRectangle::drawSensors(), GUIWx::drawTorque(), ArticulatedAgentQuasistatic::forwardAccelerations(), Circle::getISensor(), CappedRectangle::getISensorSemicircle(), CappedRectangle::getLateralSide(), Integrator::integrate(), operator *(), operator+(), operator+=(), operator-(), operator-=(), operator^(), PhysicalObject::setPosition(), PhysicalObject::setVelocity(), updateMax(), and updateMin().

real Vector2::y
 

Definition at line 25 of file Vector2.h.

Referenced by Simulator::applyMouseForce(), ArticulatedAgentQuasistatic::backwardDynamics(), Border::Border(), CappedRectangle::CappedRectangle(), Circle::Circle(), Spherus::computeCircleProprioception(), ArticulatedLink::computeForceQuasistatic(), ArticulatedComponent::computeIStar0(), Spherus::computeMemberPositions(), Spherus::computeState(), ArticulatedAgentQuasistatic::computeTotalForces(), VisualSensor::detectContacts(), Circle::detectContacts(), CappedRectangle::detectContacts(), CappedRectangle::detectMouseContact(), VisualSensor::draw(), Spherus::draw(), Iunctus::draw(), Circle::draw(), CappedRectangle::draw(), ArticulatedLink::draw(), GUI::drawCircle(), GUIWx::drawForce(), GUI::drawLine(), Circle::drawSensors(), CappedRectangle::drawSensors(), GUIWx::drawTorque(), ArticulatedAgentQuasistatic::forwardAccelerations(), Circle::getISensor(), CappedRectangle::getISensorSemicircle(), CappedRectangle::getLateralSide(), Integrator::integrate(), operator *(), operator+(), operator+=(), operator-(), operator-=(), operator^(), PhysicalObject::setPosition(), PhysicalObject::setVelocity(), updateMax(), and updateMin().


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

Thyrix homepageUsers' guide

(C) Arxia 2004-2005