Low Pass Filter 1.2bThis is a
generic low pass filter. It's an easy to use, wonderful tool that can smooth supplied data so that the core value remains, but all the noise is filtered out. The main application is to correct any input instabilities and random movements. With this script everything feels smooth and slick, making for a great user interaction. Still, the filter can be applied to any kind of data - statistics, jumpy physics, etc.
The full instruction is available
here.A short example demonstrating script working is available
here.A more interesting game example sits right
here.And most importantly the Playmaker binding is
here. It includes example scenes made with Playmaker.
Here is the
forum thread.Example usages:- filtering all kinds of input, such as joysticks, accelerometers, gyros
- smoothing ragged data
- adding scripted inertia
- averaging data
- making sure everything looks and works pretty :)
The script works with both
Unity free and Pro for
all the target platforms. Although it's written in C#, it works from other scripting languages just as well. The package includes the
source code with everything well commented and extendable if needed. Also there are three
example scenes - a desktop version, mobile version and a more interesting desktop game. Each of these scenes comes in 3 flavors, for C#, JS and Boo.
Supported variable types:- integer types
- floating pointer types
- vector types
- quaternions
- all other types that support arithmetic operations
Update 1.2:- Moved the script under the "Plugins" folder so it can be used from Javascript and Boo. Due to that, please delete the previous version before updating. The project will work without any changes, just add
using Vatio. Filters; at the beginning of any C# script using the filter or equivalents in JS or Boo. Please see example scenes.
- Included Javascript and Boo example scenes.
- Enabled the smoothing factor to be changed outside of constructor.