5 |
* modify it under the terms of the GNU General Public License |
* modify it under the terms of the GNU General Public License |
6 |
* as published by the Free Software Foundation; either version 2 |
* as published by the Free Software Foundation; either version 2 |
7 |
* of the License, or (at your option) any later version. |
* of the License, or (at your option) any later version. |
8 |
* |
* |
9 |
* This program is distributed in the hope that it will be useful, |
* This program is distributed in the hope that it will be useful, |
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
47 |
class ActorInfo { |
class ActorInfo { |
48 |
public: |
public: |
49 |
ActorInfo(V2 p, V2 v) |
ActorInfo(V2 p, V2 v) |
50 |
: pos(p), oldpos(p), vel(v), oldvel(v), |
: pos(p), oldpos(p), vel(v), oldvel(v), |
51 |
forceacc(), |
forceacc(), |
52 |
charge(0), mass(1), radius(1), |
charge(0), mass(1), radius(1), |
53 |
grabbed(false) |
grabbed(false) |
75 |
* All the information that is necessary to handle collisions |
* All the information that is necessary to handle collisions |
76 |
* between stones and actors. |
* between stones and actors. |
77 |
*/ |
*/ |
78 |
struct StoneContact |
struct StoneContact |
79 |
{ |
{ |
80 |
// Constructor. |
// Constructor. |
81 |
StoneContact(Actor *a, GridPos p, |
StoneContact(Actor *a, GridPos p, |
82 |
const V2 &cp, const V2 &n); |
const V2 &cp, const V2 &n); |
83 |
StoneContact(); |
StoneContact(); |
84 |
|
|
85 |
// Variables. |
// Variables. |
86 |
Actor *actor; |
Actor *actor; |
87 |
//Stone *stone; |
//Stone *stone; |
208 |
|
|
209 |
/* Find all actors at most RANGE units away from CENTER. Returns |
/* Find all actors at most RANGE units away from CENTER. Returns |
210 |
false if none were found. */ |
false if none were found. */ |
211 |
bool GetActorsInRange (px::V2 center, double range, |
bool GetActorsInRange (px::V2 center, double range, |
212 |
vector<Actor*> actors); |
std::vector<Actor*> actors); |
213 |
|
|
214 |
//---------------------------------------- |
//---------------------------------------- |
215 |
// Stones |
// Stones |