| AnimationHelperCompress Method |
Compresses the specified animation using simple lossy compression algorithm.
Namespace: DigitalRune.AnimationAssembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax public static SrtAnimation Compress(
SrtKeyFrameAnimation animation,
float scaleThreshold,
float rotationThreshold,
float translationThreshold
)
Public Shared Function Compress (
animation As SrtKeyFrameAnimation,
scaleThreshold As Single,
rotationThreshold As Single,
translationThreshold As Single
) As SrtAnimation
public:
static SrtAnimation^ Compress(
SrtKeyFrameAnimation^ animation,
float scaleThreshold,
float rotationThreshold,
float translationThreshold
)
static member Compress :
animation : SrtKeyFrameAnimation *
scaleThreshold : float32 *
rotationThreshold : float32 *
translationThreshold : float32 -> SrtAnimation
Parameters
- animation
- Type: DigitalRune.AnimationSrtKeyFrameAnimation
The animation. - scaleThreshold
- Type: SystemSingle
The scale threshold. - rotationThreshold
- Type: SystemSingle
The rotation threshold in degrees. - translationThreshold
- Type: SystemSingle
The translation threshold.
Return Value
Type:
SrtAnimation
The compressed animation. Or
if the animation does contain any
key frames.
Exceptions Remarks
This method takes an SrtKeyFrameAnimation and removes not needed scale,
rotation or translation channels. It further removes key frames that can be interpolated
from the neighbor key frames. This a lossy compression and the threshold parameters define
the allowed errors. If the thresholds are 0 or negative, this compression is lossless. If
the thresholds are greater than 0 (recommended), the compression is lossy. The best way to
determine optimal thresholds is to compare the compressed animation with the uncompressed
animation visually.
See Also