//---------------------------------------------------------------------------

#ifndef objetoDinamicoH
#define objetoDinamicoH
//---------------------------------------------------------------------------

#include <cMesh.h>
#include <cWorld.h>

#define DISSIPATION 0.015

class objetoDinamico : public cMesh {
public:
        objetoDinamico(cWorld *world, double imassa, bool igrav);

        void inicializa();

        void integra(double dt);

        void integraVelocidade(double dt);

        void integraPosicao(double dt);

        void calcAceleracao(double dt, cVector3d forca);

        void aplicaForca(cVector3d forca, cVector3d posiforca);

        void integraOrientacao(double dt);

        void integraVeloAngular(double dt);

        void calcAceleAngular(double dt, cVector3d torque);

        void reposiciona(cVector3d novaposi);


        cVector3d forca,torque,translacao,velocidade,aceleracao,centroMassa,centroMassa0;

        cVector3d giro,veloAngular,aceleAngular;

        cMatrix3d matrizInercia;
        
        double massa;

        bool gravidade;
};

#endif
