00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PHYOBJECT_H
00021 #define PHYOBJECT_H
00022
00023 #include "worldsimconfig.h"
00024 #include "wvector.h"
00025 #include "wmatrix.h"
00026 #include "wquaternion.h"
00027 #include "world.h"
00028
00029 namespace farsa {
00030
00031 class PhyJoint;
00032 class PhyObjectPrivate;
00033 class WorldPrivate;
00034 class PhyCompoundObject;
00035
00046 class FARSA_WSIM_API PhyObject : public WObject {
00047 Q_OBJECT
00048 public:
00054 PhyObject( World* world, QString name="unamed", const wMatrix& tm = wMatrix::identity(), bool cp = true );
00056 virtual ~PhyObject();
00057
00067 void setKinematic(bool b, bool c = false);
00068
00072 bool getKinematic() const
00073 {
00074 return isKinematic;
00075 }
00076
00082 void setStatic(bool b);
00083
00087 bool getStatic() const
00088 {
00089 return isStatic;
00090 }
00091
00098 void reset();
00099
00100 void addForce( const wVector& force );
00101 void setForce( const wVector& force);
00102 wVector force();
00103
00104 void addTorque( const wVector& torque );
00105 void setTorque( const wVector& torque );
00106 wVector torque();
00107
00109 void setMassInertiaVec( const wVector& );
00111 wVector massInertiaVec() const;
00112 wVector inertiaVec() const;
00113 wVector invMassInertiaVec() const;
00115 wVector invInertiaVec() const;
00117 void setMass( real );
00119 real mass();
00120
00121 void setOmega( const wVector& omega );
00122 wVector omega();
00123 void setVelocity( const wVector& velocity );
00124 wVector velocity();
00125 void addImpulse( const wVector& pointDeltaVeloc, const wVector& pointPosit );
00126 void setMaterial( QString material );
00127 QString material() const;
00128 private:
00130 QString materialv;
00132 wVector forceAcc;
00134 wVector torqueAcc;
00136 bool isKinematic;
00138 bool isStatic;
00140 wVector objInertiaVec;
00142 wVector objInvInertiaVec;
00143 protected:
00145 virtual void changedMatrix();
00147 PhyObjectPrivate* priv;
00148 WorldPrivate* worldpriv;
00149 friend class PhyObjectPrivate;
00150 friend class WorldPrivate;
00151 friend class PhyJoint;
00152 friend class World;
00153 friend class PhyCompoundObject;
00154 void createPrivateObject();
00155 };
00156
00157 }
00158
00159 #endif