Game Development Community

CameraShake - What's the goal of this new class?

by elvince · in Torque 3D Professional · 08/28/2010 (4:40 pm) · 11 replies

Hi,

I find that CameraShake class was added to shapebase file. Do we have to change something to use it?

the use as per the comment: /// Camera shake caused by weapon fire.
Is it a king of recoil?

Thanks,

#1
08/28/2010 (6:15 pm)
I've seen the addition but not actually used it. My interpretation of it was that it is the same camera shake effect previously found in explosions but added to weapons. Iit could be used as a sort of fake recoil effect if you were so inclined... just keep in mind that it's more of a random full-screen shake and not an accurate physical recoil.

To use it I believe you just add the following fields to your shapeImage datablock:
  • shakeCamera
  • camShakeFreq
  • camShakeAmp
  • And though the field wasn't added I would think it should include a duration setting also
EDIT: I chose not to use/try it because of this comment in the code:
Quote:
// HACK: Only works properly if you are in control
// of the one and only shapeBase object in the scene
// which fires an image that uses camera shake.
#2
08/28/2010 (6:42 pm)
I saw the warning message also... this is why I asked to understand what's the use and see if I can find a sample :D

Maybe, we will have more details at a later stage like Beta3 ^^
#3
08/28/2010 (6:58 pm)
That doesn't seem to work too good - at least not on offset weapons - the camera just gets pushed around horribly.

I've been applying camera shake to my weapons by spawning an explosion datablock with the relevant info when they fire.
#4
08/28/2010 (8:06 pm)
Eww, just played around with the effect. Yeah, it's quite horrible if the intent is fake recoil.
#5
08/28/2010 (8:32 pm)
I'd like to hope that this would eventually be expanded to work like Source's "viewPunch" effect, which can be used to sort of give the camera... well... a punch in a specific direction (say, when the player gets hit in the head), but I'm not sure what the intent really was. I guess some random shaking might apply to, say, firing a machinegun.
#6
08/28/2010 (9:10 pm)
We added it for Pacific and it got sucked into the core. It could use some improvments, but it works for our needs... think the camera shake you get when you fire the Warthog mounted chaingun in Halo games.

#7
08/28/2010 (9:13 pm)
My observations on general camera shake
datablock ExplosionData(shootheavy)
{
   lifeTimeMS = 100;//600

   // Camera Shaking
   shakeCamera = true;
   camShakeFreq = "-0.1 0.1 -0.1";//+left -right /// +backwards -forwards /// +downwards -upwards 
   camShakeAmp = "0.5 0.1 0.05";//(up/down is very strong)
   camShakeDuration = 0.3;
   camShakeRadius = 5.0;//1.0
};
#8
08/28/2010 (9:13 pm)
Also added a ticket to fix the issues with it... not sure if we'll get time before 1.1 final to do so.

THREED-1205

@Steve - Yes... thats where the functionality originally came from. We just wanted a continuous effect when the weapon fires.
#9
08/28/2010 (9:16 pm)
Hehe, quite fun (if sickening) with a bigass rocketlauncher :D
#10
08/28/2010 (9:18 pm)
Could be interesting if hooked up to something like a sustained trigger weapon. Chainguns or espeically something like the old Elf & Shocklance weapons from Tribes.
#11
08/30/2010 (10:12 am)
@tom,
thanks for those clarifications.

Pacific demo, is it planned for T3D final release? I heard of it since a long time, but I have no clue why everyone is expecting so much of it :D