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

Spherus.h

Go to the documentation of this file.
00001 // Spherus.h: interface for the Spherus class.
00002 //
00004 
00005 #ifndef SPHERUS_H
00006 #define SPHERUS_H
00007 
00008 
00009 #include "PhysicalObject.h"
00010 #include "VisualSensor.h"
00011 
00012 
00013 class Controller;
00014 class Circle;
00015 
00022 class Spherus : public PhysicalObject  {
00023 public:
00024    Spherus(real x, real y, real alpha=0.0, real extension=0.6, real R=0.1, Controller* controller=NULL);
00025    virtual ~Spherus();
00026 
00027    
00029    real R;
00030    
00032    real extension;   
00033 
00035    Circle* circles[2];
00036 
00037    VisualSensor* eyes[2];
00038 
00039    real rocketActivations[2];
00040    real rocketForceValues[2];
00041    Vector2 rocketForces[2];
00042    real extensionActivation;
00043 
00045    real targetExtension;
00046 
00049    void computeState();
00050 
00051    real sinAlpha, cosAlpha;
00052 
00053    void computeSinCos();
00054 
00055    void computeMemberPositions();
00056 
00057    void computeCircleProprioception(Circle* circle, float& forward, float& backward);
00058 
00059    virtual void computeDerivativesWithoutContacts(ContactSolver* contactSolver);
00060    virtual void computeDerivatives(GlobalContactInfoVector* globalContacts);
00061    virtual void integrate(const Integrator &integrator);
00062    virtual void controll();
00063 
00064    virtual bool detectContacts(PhysicalObject* object, GlobalContactInfoVector* contacts);
00065    virtual void detectInternalContacts(GlobalContactInfoVector* contacts);
00066    virtual void deleteContacts();
00067    virtual bool detectMouseContact(const Vector2& rMouse, Vector2& p, PhysicalObject*& object);
00068 
00069 
00070    void draw(GUI *gui);
00071 
00072    static const unsigned int nSensors;
00073    static const unsigned int nEffectors;
00074 
00075    Controller* controller;
00076 
00077 };
00078 
00079 #endif //SPHERUS_H

Thyrix homepageUsers' guide

(C) Arxia 2004-2005