Additive Transforms and Shake
NeoFPS uses a system called additive transforms to manage camera and object transform effects such as recoil and shake. In order to make use of additive transforms, the AdditiveTransformHandler is added to an object and then various additive effects are attached to it. It is very simple to write custom additive effects, but a number of useful effects are included with NeoFPS including:
|AdditiveKicker||A simple knock and spring return. Triggered by the CharacterEventKickTrigger and ImpactHandlerKickTrigger.||Any|
|BodyLean||Lean to either side||Body|
|BodyTilt||Tilt the body in an arbitrary direction||Body|
|HeadBob||Position bob using curves||Camera|
|HeadDuck||A simple lowering of the head used for charged jumps||Camera|
|TransformMatcher||Matches the offset of one transform relative to another. Used to blend keyframe animation in with procedural effects.||Camera|
|WeaponAimAmplifier||Multiplies the movement of the camera back onto the held weapon to add weight and momentum.||Weapon|
|WeaponBob||A bob effect for weapons, similar to the head bob but with rotation too.||Weapon|
|WeaponMomentumSway||Similar to the WeaponAimAmplifier, but changes the position instead of the rotation.||Weapon|
The AdditiveTransformHandler will check each of the effects every tick (the update frequency can be set in the component properties) and then layer them on top of each other in order to create a combined offset. Translation and rotation are handled separately, meaning that the rotation offset of an effect will not alter the position offset of another effect further along the chain. This makes the outcome more predictable when a number of effects are applied at once.
You can also specify a pivot point for the resulting transform if desired.