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

Circle.h

Go to the documentation of this file.
00001 // Circle.h: interface for the Circle class.
00002 //
00004 
00005 #ifndef CIRCLE_H
00006 #define CIRCLE_H
00007 
00008 #include "PhysicalObject.h"
00009 #include "Border.h"
00010 
00011 class Simulator;
00012 
00015 class Circle : public PhysicalObject {
00016 
00017 public:
00021    Circle(real R, real x = 0, real y = 0, std::string label="", 
00022       int nSensors=0, real sensorsStartAngle=0, real saturationForce=0.5,
00023       Color outlineColor = GUI::colorBlack, Color fillColor = GUI::colorTransparent);
00024 
00026    virtual ~Circle();
00027    
00029    real R;
00030 
00032    void setRadius (real R);
00033    
00035    virtual void computeMass(real density = ThyrixParameters::defaultDensity);
00036    
00039    virtual void computeInertia();
00040 
00042    virtual int isCircle()                          { return 1; }
00043    
00045   virtual bool detectContacts(PhysicalObject* object, GlobalContactInfoVector* contacts) { 
00046       return object->detectContacts(this, contacts);
00047   }
00048 
00050    virtual bool detectContacts(Border* border, GlobalContactInfoVector* contacts);
00051 
00053    virtual bool detectContacts(Circle* circle,  GlobalContactInfoVector* contacts);
00054 
00059    virtual bool detectMouseContact(const Vector2& rMouse, Vector2& p, PhysicalObject*& object);
00060 
00062    virtual void computeBox(){;
00063       real RE=R+ThyrixParameters::halfEpsilonContact;
00064       boxMin=r; boxMin-=RE;
00065       boxMax=r; boxMax+=RE;
00066    }
00067 
00069    real sensorsStartAngle;
00070 
00073    int getISensor(Vector2& p);
00074 
00075    virtual void setSensor(ContactInfo* contact);
00076 
00078    virtual void draw(GUI *gui);
00079 
00081    void drawSensors(GUI *gui);
00082 };
00083 
00084 #endif //CIRCLE_H

Thyrix homepageUsers' guide

(C) Arxia 2004-2005