22 #ifndef NANCY_ACTION_PHYSICALOBJECT_H 23 #define NANCY_ACTION_PHYSICALOBJECT_H 25 #include "common/array.h" 26 #include "common/rect.h" 38 static const uint32 kTickLength = 20;
56 void setSize(
int width,
int height) { _width = width; _height = height; }
58 void setBounds(
const Common::Rect &bounds) { _bounds = bounds; }
59 void setBoundsMode(BoundsMode mode) { _boundsMode = mode; }
64 void moveTo(
double x,
double y);
66 double getX()
const {
return _x; }
67 double getY()
const {
return _y; }
71 void setSpeed(
double speed);
72 double getSpeed()
const {
return _speed; }
73 void setMaxSpeed(
double maxSpeed) { _hasMaxSpeed =
true; _maxSpeed = maxSpeed; setSpeed(_speed); }
74 void setHeading(
double heading);
75 double getHeading()
const {
return _heading; }
76 void setFriction(
double friction) { _friction = friction; }
77 void setForce(
double x,
double y) { _forceX = x; _forceY = y; }
80 bool hasHitBounds()
const {
return _hasHitBounds; }
81 void clearHitBounds() { _hasHitBounds =
false; }
83 void update(uint32 numTicks);
86 static double getAngle(
double x,
double y);
96 double getObstacleNormal(
const Common::Rect &rect)
const;
98 void accelerate(
double numTicks);
99 void applyFriction(
double numTicks);
100 void move(
double numTicks);
101 void stopAtBounds(
double x,
double y);
102 void bounceOffBounds(
double x,
double y);
108 BoundsMode _boundsMode = kStopAtBounds;
114 double _friction = 0;
118 bool _hasMaxSpeed =
false;
119 double _maxSpeed = 0;
120 bool _hasHitBounds =
false;
126 #endif // NANCY_ACTION_PHYSICALOBJECT_H
Definition: physicalobject.h:46
Definition: physicalobject.h:36
Definition: actionmanager.h:32