src/PhysicsObject.hh
changeset 228 dbc1bb7a98b5
parent 225 22ecb9cb9245
child 235 0a0c729365ee
equal deleted inserted replaced
227:39cd6861e43e 228:dbc1bb7a98b5
    32     bool facingRight; // Player facing
    32     bool facingRight; // Player facing
    33 
    33 
    34     bool alive;
    34     bool alive;
    35     bool shouldDelete;
    35     bool shouldDelete;
    36 
    36 
       
    37     PhysicsObject *pivot;
       
    38 
    37     PhysicsObject(PhysicsWorld &world, float mass, Vector position, 
    39     PhysicsObject(PhysicsWorld &world, float mass, Vector position, 
    38                   Vector velocity, bool enabled = true);
    40                   Vector velocity, bool enabled = true);
    39     virtual ~PhysicsObject (void);
    41     virtual ~PhysicsObject (void);
    40 
    42 
    41 
    43 
   215     
   217     
   216     /**
   218     /**
   217      * Delete ourselves if we've been destroyed and return true, else return false
   219      * Delete ourselves if we've been destroyed and return true, else return false
   218      */
   220      */
   219     bool removeIfDestroyed (void);
   221     bool removeIfDestroyed (void);
       
   222 
       
   223     /**
       
   224      * Sets this object's pivot to the given value, which will then exert a force on this object
       
   225      */
       
   226     void setPivot (PhysicsObject *pivot);
       
   227 
       
   228     /**
       
   229      * Compute the force that this object (as a pivot) exerts on the given object
       
   230      */
       
   231     virtual float getPivotForce (PhysicsObject *bob);
   220 
   232 
   221     /**
   233     /**
   222      * Update object in physics simulation.
   234      * Update object in physics simulation.
   223      */
   235      */
   224     virtual void tick (TimeMS tick_length);
   236     virtual void tick (TimeMS tick_length);