mirror of
https://github.com/XProger/OpenLara.git
synced 2025-01-17 21:09:00 +01:00
This commit is contained in:
parent
588abaf42f
commit
493c1db0c7
BIN
bin/OpenLara.exe
BIN
bin/OpenLara.exe
Binary file not shown.
@ -114,9 +114,10 @@ struct Controller {
|
||||
int roomIndex;
|
||||
} *explodeParts;
|
||||
|
||||
vec3 lastPos;
|
||||
bool invertAim;
|
||||
|
||||
Controller(IGame *game, int entity) : next(NULL), game(game), level(game->getLevel()), entity(entity), animation(level, getModel()), state(animation.state), layers(0), explodeMask(0), explodeParts(0), invertAim(false) {
|
||||
Controller(IGame *game, int entity) : next(NULL), game(game), level(game->getLevel()), entity(entity), animation(level, getModel()), state(animation.state), layers(0), explodeMask(0), explodeParts(0), lastPos(0), invertAim(false) {
|
||||
const TR::Entity &e = getEntity();
|
||||
pos = vec3(float(e.x), float(e.y), float(e.z));
|
||||
angle = vec3(0.0f, e.rotation, 0.0f);
|
||||
@ -193,8 +194,8 @@ struct Controller {
|
||||
info.trigger = TR::Level::Trigger::ACTIVATE;
|
||||
info.trigCmdCount = 0;
|
||||
|
||||
if (s.floor == TR::NO_FLOOR)
|
||||
return;
|
||||
//if (s.floor == TR::NO_FLOOR)
|
||||
// return;
|
||||
|
||||
TR::Room::Sector *sBelow = &s;
|
||||
while (sBelow->roomBelow != TR::NO_ROOM) sBelow = &level->getSector(sBelow->roomBelow, x, z, dx, dz);
|
||||
@ -613,8 +614,8 @@ struct Controller {
|
||||
return index;
|
||||
}
|
||||
|
||||
virtual vec3& getPos() {
|
||||
return pos;
|
||||
virtual vec3 getPos() {
|
||||
return getEntity().isActor() ? animation.getJoints(getMatrix(), 0).pos : pos;
|
||||
}
|
||||
|
||||
vec3 getDir() const {
|
||||
@ -826,7 +827,15 @@ struct Controller {
|
||||
|
||||
virtual void updateAnimation(bool commands) {
|
||||
animation.update();
|
||||
|
||||
|
||||
if (level->isCutsceneLevel() && getEntity().isActor()) {
|
||||
vec3 p = getPos();
|
||||
if ((p - lastPos).length2() > 256 * 256) {
|
||||
game->waterDrop(p, 96.0, 0.1f);
|
||||
lastPos = p;
|
||||
}
|
||||
}
|
||||
|
||||
TR::Animation *anim = animation;
|
||||
|
||||
// apply animation commands
|
||||
|
@ -467,7 +467,7 @@ namespace Debug {
|
||||
if (!controller || controller->flags.invisible) return;
|
||||
|
||||
sprintf(buf, "%s (%d)", getEntityName(level, e), i);
|
||||
Debug::Draw::text(controller->pos + randf() * 64, controller->flags.active ? vec4(0, 0, 0.8f, 1) : vec4(0.8f, 0, 0, 1), buf);
|
||||
Debug::Draw::text(controller->getPos() + randf() * 64, controller->flags.active ? vec4(0, 0, 0.8f, 1) : vec4(0.8f, 0, 0, 1), buf);
|
||||
}
|
||||
|
||||
for (int i = 0; i < level.camerasCount; i++) {
|
||||
|
@ -2595,11 +2595,8 @@ struct Lara : Character {
|
||||
if (level->isCutsceneLevel()) {
|
||||
updateAnimation(true);
|
||||
|
||||
vec3 p = pos;
|
||||
pos = getPos();
|
||||
//checkRoom();
|
||||
updateLights();
|
||||
pos = p;
|
||||
|
||||
if (fixRoomIndex() && braid)
|
||||
braid->update();
|
||||
} else {
|
||||
@ -2801,7 +2798,7 @@ struct Lara : Character {
|
||||
move();
|
||||
}
|
||||
|
||||
virtual vec3& getPos() {
|
||||
virtual vec3 getPos() {
|
||||
return level->isCutsceneLevel() ? chestOffset : pos;
|
||||
}
|
||||
|
||||
|
@ -1541,6 +1541,7 @@ struct Level : IGame {
|
||||
renderEntities(transp);
|
||||
}
|
||||
|
||||
Core::setBlending(bmNone);
|
||||
if (water && waterCache && waterCache->visible) {
|
||||
Core::Pass pass = Core::pass;
|
||||
waterCache->renderMask();
|
||||
|
Loading…
x
Reference in New Issue
Block a user