| SkeletonKeyFrameAnimationCompress Method |
Compresses the animation using a simple lossy compression algorithm.
Namespace: DigitalRune.Animation.CharacterAssembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax public float Compress(
float scaleThreshold,
float rotationThreshold,
float translationThreshold
)
Public Function Compress (
scaleThreshold As Single,
rotationThreshold As Single,
translationThreshold As Single
) As Single
public:
float Compress(
float scaleThreshold,
float rotationThreshold,
float translationThreshold
)
member Compress :
scaleThreshold : float32 *
rotationThreshold : float32 *
translationThreshold : float32 -> float32
Parameters
- scaleThreshold
- Type: SystemSingle
The scale threshold. - rotationThreshold
- Type: SystemSingle
The rotation threshold in degrees. - translationThreshold
- Type: SystemSingle
The translation threshold.
Return Value
Type:
Single
The amount of removed key frames in the range [0, 1]. 0 means that no key frames have been
removed. 0.5 means that 50% of the key frames have been removed. Etc.
Remarks
This method compresses the animation by removing key frames that can be computed by
interpolation of nearby key frames. The threshold parameters define the allowed errors. If
the thresholds are 0, 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.
This method does nothing if any threshold is negative.
See Also