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

ArticulatedAgentBase Class Reference

#include <ArticulatedAgentBase.h>

Inheritance diagram for ArticulatedAgentBase:

ArticulatedComponent ComposedPhysicalObject PhysicalObject GraphicalObject ArticulatedAgentQuasistatic Iunctus List of all members.

Public Member Functions

Protected Member Functions

Static Protected Member Functions

Protected Attributes


Detailed Description

Base class for articulated agents. Should be specialized for either classical mechanics or quasistatic mechanics, for different types of bodies.

Definition at line 19 of file ArticulatedAgentBase.h.


Constructor & Destructor Documentation

ArticulatedAgentBase::ArticulatedAgentBase std::string  label = ""  ) 
 

sets the body to NULL.

Definition at line 38 of file ArticulatedAgentBase.cpp.

ArticulatedAgentBase::~ArticulatedAgentBase  )  [virtual]
 

Destructor; deletes the limbs.

Definition at line 45 of file ArticulatedAgentBase.cpp.

References deleteLimbs().


Member Function Documentation

ArticulatedLimb * ArticulatedAgentBase::addLimb real  l,
real  theta
 

Adds a limb to the agent, sets the properties of the limb and returns a reference to it. The limb is articulated at a point situated at l from the point of reference of the body, under and angle theta.

Definition at line 62 of file ArticulatedAgentBase.cpp.

References addLimb(), and ArticulatedLimb::setProperties().

ArticulatedLimb * ArticulatedAgentBase::addLimb  ) 
 

Adds a limb to the agent and returns a reference to it.

Definition at line 50 of file ArticulatedAgentBase.cpp.

References ArticulatedLimb::label, and limbs.

Referenced by addLimb(), and Iunctus::build().

void ArticulatedAgentBase::deleteContacts  )  [virtual]
 

Delete the contacts of the object.

Reimplemented from PhysicalObject.

Reimplemented in Iunctus.

Definition at line 173 of file ArticulatedAgentBase.cpp.

References PhysicalObject::deleteContacts(), limbs, and ArticulatedLimb::links.

Referenced by Iunctus::deleteContacts().

void ArticulatedAgentBase::deleteLimbs  )  [protected]
 

Definition at line 208 of file ArticulatedAgentBase.cpp.

References limbs, and purgeContainer().

Referenced by ~ArticulatedAgentBase().

bool ArticulatedAgentBase::detectContacts PhysicalObject object,
GlobalContactInfoVector contacts
[virtual]
 

Contact handling.

Reimplemented from ComposedPhysicalObject.

Definition at line 105 of file ArticulatedAgentBase.cpp.

References ComposedPhysicalObject::detectContacts(), limbs, and ArticulatedLimb::links.

void ArticulatedAgentBase::detectInternalContacts GlobalContactInfoVector contacts  )  [virtual]
 

Detects internal contacts. Does nothing for primitive objects or composed objects. To be overriden by complex objects that have parts that move relative to each other, such as articulated objects.

Reimplemented from PhysicalObject.

Definition at line 119 of file ArticulatedAgentBase.cpp.

References ComposedPhysicalObject::detectContacts(), limbs, and ArticulatedLimb::links.

bool ArticulatedAgentBase::detectMouseContact const Vector2 rMouse,
Vector2 p,
PhysicalObject *&  object
[virtual]
 

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 composed object and the contact point; p is expressed in the composed object reference frame because it rotates with the object while the object is dragged.

Reimplemented from ComposedPhysicalObject.

Definition at line 159 of file ArticulatedAgentBase.cpp.

References ComposedPhysicalObject::detectMouseContact(), limbs, and ArticulatedLimb::links.

void ArticulatedAgentBase::draw GUI gui  )  [virtual]
 

Calls the draw methods for the body and the limbs.

Reimplemented from ComposedPhysicalObject.

Reimplemented in Iunctus.

Definition at line 212 of file ArticulatedAgentBase.cpp.

References ComposedPhysicalObject::draw(), and limbs.

Referenced by Iunctus::draw().

void ArticulatedAgentBase::fillContactMatrix ContactSolver contactSolver,
ContactInfo contactInfo
[virtual]
 

Computes the contribution of the current object to the matrix of interactions between all objects that are in contact.

Reimplemented from PhysicalObject.

Definition at line 186 of file ArticulatedAgentBase.cpp.

References ContactInfo::alpha, ContactSolver::contactMatrix, ContactSolver::contactVector, Vector2::cross(), ContactInfo::n, ContactInfo::p, Vector2::rotate(), Vector2::setXY(), and ContactInfo::sigma.

void ArticulatedAgentBase::registerPrimitives Simulator simulator  )  [virtual]
 

Registers all composing primitives of the object with the simulator.

Reimplemented from ComposedPhysicalObject.

Definition at line 69 of file ArticulatedAgentBase.cpp.

References limbs, ArticulatedLimb::links, and ComposedPhysicalObject::registerPrimitives().

void ArticulatedAgentBase::setFillColor Color  color  )  [virtual]
 

Sets fill color.

Reimplemented from ComposedPhysicalObject.

Definition at line 228 of file ArticulatedAgentBase.cpp.

References limbs, and ComposedPhysicalObject::setFillColor().

Referenced by Iunctus::build().

void ArticulatedAgentBase::setOutlineColor Color  color  )  [virtual]
 

Sets outline color.

Reimplemented from ComposedPhysicalObject.

Definition at line 220 of file ArticulatedAgentBase.cpp.

References limbs, and ComposedPhysicalObject::setOutlineColor().

Referenced by Iunctus::build().

void ArticulatedAgentBase::solveSystem const SymmetricMatrix3 m,
const real  determinant,
const Vector3 c,
Vector3 x
[static, protected]
 

Solves the system of equations m x=c, given the precomputed determinant of m; x is updated with the solution.

Definition at line 90 of file ArticulatedAgentBase.cpp.

References Matrix3::getDeterminant(), Matrix3::setColumn(), and Vector3::setElement().

void ArticulatedAgentBase::solveSystem SymmetricMatrix3 m,
const Vector3 c,
Vector3 x
[static, protected]
 

Solves the system of equations m x=c; x is updated with the solution.

Definition at line 83 of file ArticulatedAgentBase.cpp.

References SymmetricMatrix3::getDeterminant(), SymmetricMatrix3::mirror(), and real.

Referenced by ArticulatedAgentQuasistatic::backwardDynamics(), and ArticulatedAgentQuasistatic::computeBodyDerivativesWithoutContacts().


Member Data Documentation

ArticulatedLimbPVector ArticulatedAgentBase::limbs [protected]
 

A list containing the limbs. The list owns the limbs.

Definition at line 61 of file ArticulatedAgentBase.h.

Referenced by addLimb(), deleteContacts(), deleteLimbs(), detectContacts(), detectInternalContacts(), detectMouseContact(), draw(), registerPrimitives(), setFillColor(), and setOutlineColor().


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

Thyrix homepageUsers' guide

(C) Arxia 2004-2005