Merge remote-tracking branch 'remotes/origin/master' into new_level_refactor

This commit is contained in:
Christoph Oelckers 2019-02-09 08:47:07 +01:00
commit 8a28134254
3 changed files with 27 additions and 15 deletions

View file

@ -33,7 +33,7 @@ build_script:
- md build - md build
- cd build - cd build
- cmake -G "%GENERATOR%" -T "%TOOLSET%" -DPK3_QUIET_ZIPDIR=YES .. - cmake -G "%GENERATOR%" -T "%TOOLSET%" -DPK3_QUIET_ZIPDIR=YES ..
- cmake --build . --config "%CONFIGURATION%" -- /verbosity:minimal - cmake --build . --config "%CONFIGURATION%" -- -maxcpucount -verbosity:minimal
after_build: after_build:
- set OUTPUT_DIR=%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\ - set OUTPUT_DIR=%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\

View file

@ -108,11 +108,11 @@ matrix:
- os: windows - os: windows
env: env:
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -A Win32" - CMAKE_OPTIONS="-A Win32"
- os: windows - os: windows
env: env:
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -A x64" - CMAKE_OPTIONS="-A x64"
before_install: before_install:
- if [ -n "$GCC_VERSION" ]; then export CC="gcc-${GCC_VERSION}" CXX="g++-${GCC_VERSION}"; fi - if [ -n "$GCC_VERSION" ]; then export CC="gcc-${GCC_VERSION}" CXX="g++-${GCC_VERSION}"; fi
@ -132,8 +132,8 @@ script:
-DFORCE_INTERNAL_GME=YES \ -DFORCE_INTERNAL_GME=YES \
-DPK3_QUIET_ZIPDIR=YES \ -DPK3_QUIET_ZIPDIR=YES \
.. ..
- if [[ $TRAVIS_OS_NAME == 'windows' ]]; then cmake --build . -- -m; fi - if [[ $TRAVIS_OS_NAME == 'windows' ]]; then cmake --build . --config Release -- -maxcpucount -verbosity:minimal; fi
- if [[ $TRAVIS_OS_NAME != 'windows' ]]; then cmake --build . -- -j2 -k; fi - if [[ $TRAVIS_OS_NAME != 'windows' ]]; then cmake --build . -- --jobs=2 --keep-going; fi
notifications: notifications:
email: false email: false

View file

@ -858,29 +858,41 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor
if (DEarthquake::StaticGetQuakeIntensities(viewpoint.TicFrac, viewpoint.camera, jiggers) > 0) if (DEarthquake::StaticGetQuakeIntensities(viewpoint.TicFrac, viewpoint.camera, jiggers) > 0)
{ {
double quakefactor = r_quakeintensity; double quakefactor = r_quakeintensity;
DAngle an; DVector3 pos; pos.Zero();
if (jiggers.RollIntensity != 0 || jiggers.RollWave != 0) if (jiggers.RollIntensity != 0 || jiggers.RollWave != 0)
{ {
viewpoint.Angles.Roll += QuakePower(quakefactor, jiggers.RollIntensity, jiggers.RollWave); viewpoint.Angles.Roll += QuakePower(quakefactor, jiggers.RollIntensity, jiggers.RollWave);
} }
if (jiggers.RelIntensity.X != 0 || jiggers.RelOffset.X != 0) if (jiggers.RelIntensity.X != 0 || jiggers.RelOffset.X != 0)
{ {
an = viewpoint.camera->Angles.Yaw; pos.X += QuakePower(quakefactor, jiggers.RelIntensity.X, jiggers.RelOffset.X);
double power = QuakePower(quakefactor, jiggers.RelIntensity.X, jiggers.RelOffset.X);
viewpoint.Pos += an.ToVector(power);
} }
if (jiggers.RelIntensity.Y != 0 || jiggers.RelOffset.Y != 0) if (jiggers.RelIntensity.Y != 0 || jiggers.RelOffset.Y != 0)
{ {
an = viewpoint.camera->Angles.Yaw + 90; pos.Y += QuakePower(quakefactor, jiggers.RelIntensity.Y, jiggers.RelOffset.Y);
double power = QuakePower(quakefactor, jiggers.RelIntensity.Y, jiggers.RelOffset.Y);
viewpoint.Pos += an.ToVector(power);
} }
// FIXME: Relative Z is not relative
if (jiggers.RelIntensity.Z != 0 || jiggers.RelOffset.Z != 0) if (jiggers.RelIntensity.Z != 0 || jiggers.RelOffset.Z != 0)
{ {
viewpoint.Pos.Z += QuakePower(quakefactor, jiggers.RelIntensity.Z, jiggers.RelOffset.Z); pos.Z += QuakePower(quakefactor, jiggers.RelIntensity.Z, jiggers.RelOffset.Z);
} }
// [MC] Tremendous thanks to Marisa Kirisame for helping me with this.
// Use a rotation matrix to make the view relative.
if (!pos.isZero())
{
DAngle yaw = viewpoint.camera->Angles.Yaw;
DAngle pitch = viewpoint.camera->Angles.Pitch;
DAngle roll = viewpoint.camera->Angles.Roll;
DVector3 relx, rely, relz;
DMatrix3x3 rot =
DMatrix3x3(DVector3(0., 0., 1.), yaw.Cos(), yaw.Sin()) *
DMatrix3x3(DVector3(0., 1., 0.), pitch.Cos(), pitch.Sin()) *
DMatrix3x3(DVector3(1., 0., 0.), roll.Cos(), roll.Sin());
relx = DVector3(1., 0., 0.)*rot;
rely = DVector3(0., 1., 0.)*rot;
relz = DVector3(0., 0., 1.)*rot;
viewpoint.Pos += relx * pos.X + rely * pos.Y + relz * pos.Z;
}
if (jiggers.Intensity.X != 0 || jiggers.Offset.X != 0) if (jiggers.Intensity.X != 0 || jiggers.Offset.X != 0)
{ {
viewpoint.Pos.X += QuakePower(quakefactor, jiggers.Intensity.X, jiggers.Offset.X); viewpoint.Pos.X += QuakePower(quakefactor, jiggers.Intensity.X, jiggers.Offset.X);