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

ComposedPhysicalObject.h

Go to the documentation of this file.
00001 // ComposedPhysicalObject.h: interface for the ComposedPhysicalObject class.
00002 //
00004 
00005 #ifndef COMPOSEDPHYSICALOBJECT_H
00006 #define COMPOSEDPHYSICALOBJECT_H
00007 
00008 #include "PhysicalObject.h"
00009 
00023 class ComposedPhysicalObject : public PhysicalObject  {
00024 public:
00025    ComposedPhysicalObject(std::string label="");
00026    ComposedPhysicalObject(real x, real y, real alpha=0, std::string label="");
00027 
00029    virtual ~ComposedPhysicalObject();
00030 
00031 
00034    Vector2 s;
00035 
00046    void addObject(PhysicalObject* object, real x, real y, real alpha);  
00047 
00049    void deleteObjects();
00050 
00054    void computeMassProperties();
00055 
00060    void computeMemberPositions();
00061 
00063    virtual void integrate(const Integrator &integrator){
00064       PhysicalObject::integrate(integrator);
00065       computeMemberPositions();
00066    }
00067 
00069    virtual void rollback(){
00070       PhysicalObject::rollback();
00071       computeMemberPositions();
00072    }  
00073 
00074    virtual void registerPrimitives(Simulator* simulator);
00075 
00076    virtual bool detectContacts(PhysicalObject* object, GlobalContactInfoVector* contacts);
00077    
00082    virtual bool detectMouseContact(const Vector2& rMouse, Vector2& p, PhysicalObject*& object);
00083 
00084    virtual void setSensors();
00085    virtual void resetSensors();
00086 
00088    void draw(GUI *gui);
00089 
00090    void setOutlineColor(Color color);
00091    void setFillColor(Color color);
00092 
00093    
00096    PhysicalObjectPVector objects;
00097 
00098 
00099 };
00100 
00101 #endif //COMPOSEDPHYSICALOBJECT_H

Thyrix homepageUsers' guide

(C) Arxia 2004-2005