mirror of
https://github.com/XProger/OpenLara.git
synced 2025-04-22 03:51:58 +02:00
#23 fix first person view for cutscenes, fix gold reflections; #3 fix in-game cutscene head and chest animation overrides
This commit is contained in:
parent
72cc69e756
commit
695678c86e
@ -162,6 +162,7 @@ struct Camera : ICamera {
|
||||
level->cutMatrix.identity();
|
||||
level->cutMatrix.rotateY(rotation);
|
||||
level->cutMatrix.setPos(pos);
|
||||
owner->animation.overrideMask = 0;
|
||||
timer = 0.0f;
|
||||
}
|
||||
|
||||
@ -485,11 +486,11 @@ struct Camera : ICamera {
|
||||
|
||||
eye.pos = level->cutMatrix * eye.pos;
|
||||
target.pos = level->cutMatrix * target.pos;
|
||||
|
||||
mViewInv = mat4(eye.pos, target.pos, vec3(0, -1, 0));
|
||||
} else
|
||||
updateFirstPerson();
|
||||
|
||||
mViewInv = mat4(eye.pos, target.pos, vec3(0, -1, 0));
|
||||
|
||||
checkRoom();
|
||||
} else {
|
||||
Controller *lookAt = NULL;
|
||||
@ -549,7 +550,7 @@ struct Camera : ICamera {
|
||||
}
|
||||
|
||||
targetAngle = owner->angle + advAngle;
|
||||
if (mode == MODE_FOLLOW || mode == MODE_COMBAT)
|
||||
if (!firstPerson && (mode == MODE_FOLLOW || mode == MODE_COMBAT))
|
||||
targetAngle += angle;
|
||||
|
||||
targetAngle.x = clamp(targetAngle.x, -85 * DEG2RAD, +85 * DEG2RAD);
|
||||
|
@ -673,8 +673,6 @@ struct Lion : Enemy {
|
||||
float angle;
|
||||
getTargetInfo(0, NULL, NULL, &angle, NULL);
|
||||
|
||||
bool inZone = target ? target->zone == zone : false;
|
||||
|
||||
if (nextState == state)
|
||||
nextState = STATE_NONE;
|
||||
|
||||
|
20
src/lara.h
20
src/lara.h
@ -2654,14 +2654,6 @@ struct Lara : Character {
|
||||
// analog control
|
||||
rotFactor = vec2(1.0f);
|
||||
|
||||
if ((input & LOOK) && (input & ACTION)) {
|
||||
if (!camChanged) {
|
||||
camera->changeView(!camera->firstPerson);
|
||||
camChanged = true;
|
||||
}
|
||||
} else
|
||||
camChanged = false;
|
||||
|
||||
if (input & LOOK)
|
||||
return input;
|
||||
|
||||
@ -2715,6 +2707,10 @@ struct Lara : Character {
|
||||
|| state == STATE_HANDSTAND
|
||||
|| state == STATE_ROLL_1
|
||||
|| state == STATE_ROLL_2
|
||||
// make me sick!
|
||||
// || state == STATE_BACK_JUMP
|
||||
// || state == STATE_LEFT_JUMP
|
||||
// || state == STATE_RIGHT_JUMP
|
||||
|| animation.index == ANIM_CLIMB_2
|
||||
|| animation.index == ANIM_CLIMB_3
|
||||
|| animation.index == ANIM_CLIMB_JUMP;
|
||||
@ -2748,6 +2744,14 @@ struct Lara : Character {
|
||||
}
|
||||
|
||||
virtual void update() {
|
||||
if ((Input::state[camera->cameraIndex][cLook]) && (Input::state[camera->cameraIndex][cAction])) {
|
||||
if (!camChanged) {
|
||||
camera->changeView(!camera->firstPerson);
|
||||
camChanged = true;
|
||||
}
|
||||
} else
|
||||
camChanged = false;
|
||||
|
||||
if (level->isCutsceneLevel()) {
|
||||
updateAnimation(true);
|
||||
|
||||
|
@ -1346,9 +1346,11 @@ struct Level : IGame {
|
||||
int roomIndex = controller->getRoomIndex();
|
||||
TR::Room &room = level.rooms[roomIndex];
|
||||
|
||||
if (!entity.isLara() && !entity.isActor())
|
||||
if (!room.flags.visible || controller->flags.invisible)// || controller->flags.rendered)
|
||||
return;
|
||||
if (controller->flags.invisible)
|
||||
return;
|
||||
|
||||
if (!entity.isLara() && !entity.isActor() && !room.flags.visible)
|
||||
return;
|
||||
|
||||
float intensity = controller->intensity < 0.0f ? intensityf(room.ambient) : controller->intensity;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user