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

ComposedPhysicalObject Class Reference

#include <ComposedPhysicalObject.h>

Inheritance diagram for ComposedPhysicalObject:

PhysicalObject GraphicalObject ArticulatedComponent ArticulatedAgentBase ArticulatedLink ArticulatedAgentQuasistatic Iunctus List of all members.

Public Member Functions

Public Attributes


Detailed Description

A composed object can consist of several physical objects (e.g., several spheres along a line segment) that are rigidly bind together.

A composed object has a reference point that is not necessarily its center of mass. The r, v parameters refer to the position of the reference point relative to the laboratory reference system (LRS). m is the total mass of the composed object. alpha, omega, I are properties of the rotation around the reference point.

The composed object owns the member objects (will destroy them on destruction).

Definition at line 23 of file ComposedPhysicalObject.h.


Constructor & Destructor Documentation

ComposedPhysicalObject::ComposedPhysicalObject std::string  label = ""  ) 
 

Definition at line 6 of file ComposedPhysicalObject.cpp.

ComposedPhysicalObject::ComposedPhysicalObject real  x,
real  y,
real  alpha = 0,
std::string  label = ""
 

Definition at line 10 of file ComposedPhysicalObject.cpp.

References Vector2::setXY().

ComposedPhysicalObject::~ComposedPhysicalObject  )  [virtual]
 

Deletes member objects.

Definition at line 16 of file ComposedPhysicalObject.cpp.

References deleteObjects().


Member Function Documentation

void ComposedPhysicalObject::addObject PhysicalObject object,
real  x,
real  y,
real  alpha
 

Adds a previously created object to the objects composing the link / composed object, also computes (updates) the mass properties.

Parameters:
object is a previously created object
x and
y specifies the position of the center of mass of the added object relative to the composed object reference system (ORS)
alpha specifies the (fixed) rotation angle of the added object relative to the ORS

Definition at line 22 of file ComposedPhysicalObject.cpp.

References computeMassProperties(), PhysicalObject::label, objects, PhysicalObject::parent, PhysicalObject::relativeAlpha, PhysicalObject::relativeR, and Vector2::setXY().

Referenced by ArticulatedLimb::addOneObjectLink(), Iunctus::build(), and IunctusSimulator::IunctusSimulator().

void ComposedPhysicalObject::computeMassProperties  ) 
 

Computes s, the position of the center of mass of the composed object; the total mass of the composed object; and the moment of inertia around its reference point.

Definition at line 36 of file ComposedPhysicalObject.cpp.

References Vector2::getSquaredModule(), PhysicalObject::I, PhysicalObject::m, objects, PhysicalObject::relativeR, s, and Vector2::setToZero().

Referenced by addObject().

void ComposedPhysicalObject::computeMemberPositions  ) 
 

Computes the absolute positions and angles of the member objects (positions relative to the LRS) based on the position of the ORS relative to LRS and the positions of the member objects relative to the ORS. Also computes the bounding box.

Definition at line 55 of file ComposedPhysicalObject.cpp.

References PhysicalObject::alpha, PhysicalObject::alphaOld, PhysicalObject::boxMax, PhysicalObject::boxMin, PhysicalObject::computeBox(), objects, PhysicalObject::r, PhysicalObject::relativeAlpha, PhysicalObject::relativeR, PhysicalObject::rOld, Vector2::rotate(), Vector2::setXY(), Vector2::updateMax(), and Vector2::updateMin().

Referenced by Iunctus::build(), ArticulatedAgentQuasistatic::forwardKinematics(), integrate(), and rollback().

void ComposedPhysicalObject::deleteObjects  ) 
 

Deletes member objects and empties the corresponding list.

Definition at line 31 of file ComposedPhysicalObject.cpp.

References objects, and purgeContainer().

Referenced by ~ComposedPhysicalObject().

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

Contact handling.

Implements PhysicalObject.

Reimplemented in ArticulatedAgentBase.

Definition at line 83 of file ComposedPhysicalObject.cpp.

References Simulator::detectContacts(), and objects.

Referenced by ArticulatedAgentBase::detectContacts(), and ArticulatedAgentBase::detectInternalContacts().

bool ComposedPhysicalObject::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 PhysicalObject.

Reimplemented in ArticulatedAgentBase.

Definition at line 91 of file ComposedPhysicalObject.cpp.

References objects, and Vector2::rotate().

Referenced by ArticulatedAgentBase::detectMouseContact().

void ComposedPhysicalObject::draw GUI gui  )  [virtual]
 

Calls the draw method for the member objects.

Implements GraphicalObject.

Reimplemented in Iunctus, ArticulatedAgentBase, and ArticulatedLink.

Definition at line 123 of file ComposedPhysicalObject.cpp.

References GraphicalObject::draw(), and objects.

Referenced by ArticulatedLink::draw(), and ArticulatedAgentBase::draw().

virtual void ComposedPhysicalObject::integrate const Integrator integrator  )  [inline, virtual]
 

Advances the time to the next timestep.

Reimplemented from PhysicalObject.

Reimplemented in ArticulatedAgentQuasistatic, and ArticulatedLink.

Definition at line 63 of file ComposedPhysicalObject.h.

References computeMemberPositions(), and PhysicalObject::integrate().

Referenced by ArticulatedAgentQuasistatic::integrate().

void ComposedPhysicalObject::registerPrimitives Simulator simulator  )  [virtual]
 

Registers all composing primitives of the object with the simulator.

Reimplemented from PhysicalObject.

Reimplemented in ArticulatedAgentBase.

Definition at line 76 of file ComposedPhysicalObject.cpp.

References objects, and Simulator::registerPrimitive().

Referenced by ArticulatedAgentBase::registerPrimitives().

void ComposedPhysicalObject::resetSensors  )  [virtual]
 

Resets tactile sensors to zero.

Reimplemented from PhysicalObject.

Definition at line 116 of file ComposedPhysicalObject.cpp.

References objects, and PhysicalObject::resetSensors().

virtual void ComposedPhysicalObject::rollback  )  [inline, virtual]
 

Rolls back the time to the previous timestep.

Reimplemented from PhysicalObject.

Reimplemented in ArticulatedAgentQuasistatic, and ArticulatedLink.

Definition at line 69 of file ComposedPhysicalObject.h.

References computeMemberPositions(), and PhysicalObject::rollback().

Referenced by ArticulatedLink::rollback(), and ArticulatedAgentQuasistatic::rollback().

void ComposedPhysicalObject::setFillColor Color  color  )  [virtual]
 

Sets fill color.

Reimplemented from GraphicalObject.

Reimplemented in ArticulatedAgentBase.

Definition at line 139 of file ComposedPhysicalObject.cpp.

References objects.

Referenced by ArticulatedLimb::setFillColor(), and ArticulatedAgentBase::setFillColor().

void ComposedPhysicalObject::setOutlineColor Color  color  )  [virtual]
 

Sets outline color.

Reimplemented from GraphicalObject.

Reimplemented in ArticulatedAgentBase.

Definition at line 131 of file ComposedPhysicalObject.cpp.

References objects.

Referenced by ArticulatedLimb::setOutlineColor(), and ArticulatedAgentBase::setOutlineColor().

void ComposedPhysicalObject::setSensors  )  [virtual]
 

Sets the activations of the tactile sensors, on the basis of the contact forces related to the contacts of the object with other objects.

Reimplemented from PhysicalObject.

Definition at line 105 of file ComposedPhysicalObject.cpp.

References ContactInfo::iSensor, ContactInfo::object, and PhysicalObject::setSensor().

Referenced by ArticulatedAgentQuasistatic::computeDerivatives().


Member Data Documentation

PhysicalObjectPVector ComposedPhysicalObject::objects
 

The list of member objects. The list owns the member objects.

Definition at line 96 of file ComposedPhysicalObject.h.

Referenced by addObject(), computeMassProperties(), computeMemberPositions(), deleteObjects(), detectContacts(), detectMouseContact(), draw(), registerPrimitives(), resetSensors(), setFillColor(), and setOutlineColor().

Vector2 ComposedPhysicalObject::s
 

Position of the center of mass relative to the reference point (in the object reference system, ORS).

Definition at line 34 of file ComposedPhysicalObject.h.

Referenced by computeMassProperties().


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

Thyrix homepageUsers' guide

(C) Arxia 2004-2005