Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
This commit is contained in:
parent
719dfbe5a9
commit
dca5f0e908
8 changed files with 128 additions and 49 deletions
|
|
@ -770,9 +770,19 @@ bool R_GetViewInterpolationStatus()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static fixed_t QuakePower(fixed_t factor, fixed_t intensity)
|
||||
{
|
||||
return FixedMul(factor, pr_torchflicker(intensity * 2) - intensity);
|
||||
static fixed_t QuakePower(fixed_t factor, fixed_t intensity, fixed_t offset)
|
||||
{
|
||||
fixed_t randumb;
|
||||
|
||||
if (intensity == 0)
|
||||
{
|
||||
randumb = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
randumb = pr_torchflicker(intensity * 2) - intensity;
|
||||
}
|
||||
return FixedMul(factor, randumb + offset);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
@ -885,40 +895,43 @@ void R_SetupFrame (AActor *actor)
|
|||
|
||||
if (!paused)
|
||||
{
|
||||
fixed_t intensityX, intensityY, intensityZ, relIntensityX, relIntensityY, relIntensityZ;
|
||||
if (DEarthquake::StaticGetQuakeIntensities(camera,
|
||||
intensityX, intensityY, intensityZ,
|
||||
relIntensityX, relIntensityY, relIntensityZ) > 0)
|
||||
FQuakeJiggers jiggers = { 0, };
|
||||
|
||||
if (DEarthquake::StaticGetQuakeIntensities(camera, jiggers) > 0)
|
||||
{
|
||||
fixed_t quakefactor = FLOAT2FIXED(r_quakeintensity);
|
||||
|
||||
if (relIntensityX != 0)
|
||||
if ((jiggers.RelIntensityX | jiggers.RelOffsetX) != 0)
|
||||
{
|
||||
int ang = (camera->angle) >> ANGLETOFINESHIFT;
|
||||
fixed_t power = QuakePower(quakefactor, relIntensityX);
|
||||
fixed_t power = QuakePower(quakefactor, jiggers.RelIntensityX, jiggers.RelOffsetX);
|
||||
viewx += FixedMul(finecosine[ang], power);
|
||||
viewy += FixedMul(finesine[ang], power);
|
||||
}
|
||||
if (relIntensityY != 0)
|
||||
if ((jiggers.RelIntensityY | jiggers.RelOffsetY) != 0)
|
||||
{
|
||||
int ang = (camera->angle + ANG90) >> ANGLETOFINESHIFT;
|
||||
fixed_t power = QuakePower(quakefactor, relIntensityY);
|
||||
fixed_t power = QuakePower(quakefactor, jiggers.RelIntensityY, jiggers.RelOffsetY);
|
||||
viewx += FixedMul(finecosine[ang], power);
|
||||
viewy += FixedMul(finesine[ang], power);
|
||||
}
|
||||
if (intensityX != 0)
|
||||
{
|
||||
viewx += QuakePower(quakefactor, intensityX);
|
||||
}
|
||||
if (intensityY != 0)
|
||||
{
|
||||
viewy += QuakePower(quakefactor, intensityY);
|
||||
}
|
||||
// FIXME: Relative Z is not relative
|
||||
intensityZ = MAX(intensityZ, relIntensityZ);
|
||||
if (intensityZ != 0)
|
||||
// [MC]On it! Will be introducing pitch after QF_WAVE.
|
||||
if ((jiggers.RelIntensityZ | jiggers.RelOffsetZ) != 0)
|
||||
{
|
||||
viewz += QuakePower(quakefactor, intensityZ);
|
||||
viewz += QuakePower(quakefactor, jiggers.RelIntensityZ, jiggers.RelOffsetZ);
|
||||
}
|
||||
if ((jiggers.IntensityX | jiggers.OffsetX) != 0)
|
||||
{
|
||||
viewx += QuakePower(quakefactor, jiggers.IntensityX, jiggers.OffsetX);
|
||||
}
|
||||
if ((jiggers.IntensityY | jiggers.OffsetY) != 0)
|
||||
{
|
||||
viewy += QuakePower(quakefactor, jiggers.IntensityY, jiggers.OffsetY);
|
||||
}
|
||||
if ((jiggers.IntensityZ | jiggers.OffsetZ) != 0)
|
||||
{
|
||||
viewz += QuakePower(quakefactor, jiggers.IntensityZ, jiggers.OffsetZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue