1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-01-17 21:09:00 +01:00

#23 cutscene actors interaction with water; fix refraction; #15 windows executable

This commit is contained in:
XProger 2017-11-30 06:45:57 +03:00
parent 588abaf42f
commit 493c1db0c7
5 changed files with 19 additions and 12 deletions

Binary file not shown.

View File

@ -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

View File

@ -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++) {

View File

@ -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;
}

View File

@ -1541,6 +1541,7 @@ struct Level : IGame {
renderEntities(transp);
}
Core::setBlending(bmNone);
if (water && waterCache && waterCache->visible) {
Core::Pass pass = Core::pass;
waterCache->renderMask();