mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 09:34:18 +02:00
#14 enemies use flipmap info for pathfinding
This commit is contained in:
@@ -29,6 +29,8 @@ struct Character : Controller {
|
|||||||
vec3 velocity;
|
vec3 velocity;
|
||||||
float angleExt;
|
float angleExt;
|
||||||
float speed;
|
float speed;
|
||||||
|
int stepHeight;
|
||||||
|
int dropHeight;
|
||||||
|
|
||||||
int zone;
|
int zone;
|
||||||
int box;
|
int box;
|
||||||
@@ -38,6 +40,9 @@ struct Character : Controller {
|
|||||||
Collision collision;
|
Collision collision;
|
||||||
|
|
||||||
Character(IGame *game, int entity, float health) : Controller(game, entity), health(health), tilt(0.0f), stand(STAND_GROUND), lastInput(0), velocity(0.0f), angleExt(0.0f) {
|
Character(IGame *game, int entity, float health) : Controller(game, entity), health(health), tilt(0.0f), stand(STAND_GROUND), lastInput(0), velocity(0.0f), angleExt(0.0f) {
|
||||||
|
stepHeight = 256;
|
||||||
|
dropHeight = -256;
|
||||||
|
|
||||||
animation.initOverrides();
|
animation.initOverrides();
|
||||||
rotHead = rotChest = quat(0, 0, 0, 1);
|
rotHead = rotChest = quat(0, 0, 0, 1);
|
||||||
|
|
||||||
@@ -56,7 +61,7 @@ struct Character : Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16* getZones() {
|
uint16* getZones() {
|
||||||
return flying ? level->zones[0].fly : level->zones[0].ground1;
|
return flying ? level->zones[level->isFlipped].fly : (stepHeight == 256 ? level->zones[level->isFlipped].ground1 : level->zones[level->isFlipped].ground2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rotateY(float delta) {
|
void rotateY(float delta) {
|
||||||
|
@@ -57,8 +57,6 @@ struct Enemy : Character {
|
|||||||
float length; // dist from center to head (jaws)
|
float length; // dist from center to head (jaws)
|
||||||
float aggression;
|
float aggression;
|
||||||
int radius;
|
int radius;
|
||||||
int stepHeight;
|
|
||||||
int dropHeight;
|
|
||||||
|
|
||||||
Character *target;
|
Character *target;
|
||||||
Path *path;
|
Path *path;
|
||||||
@@ -73,9 +71,6 @@ struct Enemy : Character {
|
|||||||
bool targetCanAttack;
|
bool targetCanAttack;
|
||||||
|
|
||||||
Enemy(IGame *game, int entity, float health, int radius, float length, float aggression) : Character(game, entity, health), ai(AI_RANDOM), mood(MOOD_SLEEP), wound(false), nextState(0), targetBox(-1), thinkTime(1.0f / 30.0f), length(length), aggression(aggression), radius(radius), target(NULL), path(NULL) {
|
Enemy(IGame *game, int entity, float health, int radius, float length, float aggression) : Character(game, entity, health), ai(AI_RANDOM), mood(MOOD_SLEEP), wound(false), nextState(0), targetBox(-1), thinkTime(1.0f / 30.0f), length(length), aggression(aggression), radius(radius), target(NULL), path(NULL) {
|
||||||
stepHeight = 256;
|
|
||||||
dropHeight = -256;
|
|
||||||
|
|
||||||
jointChest = jointHead = -1;
|
jointChest = jointHead = -1;
|
||||||
|
|
||||||
targetDist = +INF;
|
targetDist = +INF;
|
||||||
|
Reference in New Issue
Block a user