270 |
|
|
271 |
BasicBall::BasicBall(const char *kind, double radius, double mass) |
BasicBall::BasicBall(const char *kind, double radius, double mass) |
272 |
: Actor(kind, V2()), state(NO_STATE), |
: Actor(kind, V2()), state(NO_STATE), |
273 |
sinkDepth (0) |
sinkDepth (0), sinkModel(-1) |
274 |
{ |
{ |
275 |
world::ActorInfo *ai = get_actorinfo(); |
world::ActorInfo *ai = get_actorinfo(); |
276 |
ai->radius = radius; |
ai->radius = radius; |
301 |
} |
} |
302 |
} |
} |
303 |
|
|
304 |
void BasicBall::think(double dtime) |
void BasicBall::think(double dtime) |
305 |
{ |
{ |
306 |
ActorInfo *ai = get_actorinfo(); |
ActorInfo *ai = get_actorinfo(); |
307 |
|
|
308 |
if (state == NORMAL) { |
if (state == NORMAL) { |
309 |
int xpos = static_cast<int>(ai->pos[0] * 32.0); |
int xpos = static_cast<int>(ai->pos[0] * 32.0); |
310 |
int ypos = static_cast<int>(ai->pos[1] * 32.0); |
int ypos = static_cast<int>(ai->pos[1] * 32.0); |
334 |
} |
} |
335 |
} |
} |
336 |
|
|
337 |
void BasicBall::set_sink_model(const string &m) |
void BasicBall::set_sink_model(const string &m) |
338 |
{ |
{ |
339 |
int modelnum = static_cast<int>(sinkDepth); |
int modelnum = static_cast<int>(sinkDepth); |
340 |
|
|