|
Kanzi Graphics Engine
|
Single key frame of animation data. More...
#include <core/util/math/kzc_vector2.h>#include <system/kzs_types.h>#include <system/debug/kzs_error.h>#include <system/kzs_header.h>Enumerations | |
| enum | KzuAnimationInterpolation { KZU_ANIMATION_INTERPOLATION_STEP, KZU_ANIMATION_INTERPOLATION_LINEAR, KZU_ANIMATION_INTERPOLATION_BEZIER, KZU_ANIMATION_INTERPOLATION_SMOOTHSTEP } |
| Used interpolation method for animation key frame. More... | |
| enum | KzuAnimationKeyValueSource { KZU_ANIMATION_KEY_VALUE_SOURCE_TIMELINE, KZU_ANIMATION_KEY_VALUE_SOURCE_ANIMATED_OBJECT_CURRENT_VALUE, KZU_ANIMATION_KEY_VALUE_SOURCE_TARGET_OBJECT_CURRENT_VALUE } |
| Key frame value source, in additional to regular timeline keyframes the value can be fetch from source/target value. More... | |
Single key frame of animation data.
Copyright 2008-2019 by Rightware. All rights reserved.
Key frame value source, in additional to regular timeline keyframes the value can be fetch from source/target value.
| kzsError kzuAnimationKeyFloatCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| kzFloat | time, | ||
| kzFloat | value, | ||
| enum KzuAnimationInterpolation | interpolation, | ||
| struct KzuAnimationKeyFloat ** | out_animationKey | ||
| ) |
Creates animation key.
| memoryManager | The memory manager to use. |
| time | The time when the animation has value 'value'. |
| value | The value the animation has at time 'time'. |
| interpolation | This must be KZU_ANIMATION_INTERPOLATION_STEP, KZU_ANIMATION_INTERPOLATION_LINEAR or KZU_ANIMATION_INTERPOLATION_SMOOTHSTEP. |
| out_animationKey | A pointer that is set to point to the new animation key. |
| kzsError kzuAnimationKeyFloatWithTangentsCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| kzFloat | time, | ||
| kzFloat | value, | ||
| enum KzuAnimationInterpolation | interpolation, | ||
| struct KzcVector2 | inPoint, | ||
| struct KzcVector2 | outPoint, | ||
| struct KzuAnimationKeyFloatWithTangents ** | out_animationKey | ||
| ) |
Creates an animation key, which represents a point on a Bezier curve and up to two Bezier control points.
The Bezier curve will go through the point (time, value). The 'inPoint' parameter defines a Bezier control point in case the animation key before 'time' also defines a Bezier point. Similarly, the 'outPoint' is used as an additional Bezier control point if there is a Bezier animation key after 'time'.
For example, if there are two Bezier animation keys A and B and A's 'time' (A_time) is smaller than B's 'time' (B_time), then A and B together define a cubic Bezier curve which starting point is (A_time, A_value), the first control point is (A_outPoint.data[0], A_outPoint.data[1]), the second control point is (B_inPoint.data[0], B_inPoint.data[1]) and the end point is (B_time, B_value). Now, if there is a third Bezier animation key C and C_time > B_time, then there would be another cubic Bezier curve defined by (B_time, B_value), (B_outPoint.data[0], B_outPoint.data[1]), (C_inPoint.data[0], C_inPoint.data[1]), and (C_time, C_value).
If the animation key before 'time' is not of Bezier type, the animation value will transition linearly from that point to (time, value). Similarly, if the animation key after 'time' is not of Bezier type, the animation value will transition linearly from (time, value) to that point.
| memoryManager | The memory manager to use. |
| time | The time when the curve has value 'value'. |
| value | The value the curve has at time 'time'. |
| interpolation | This must be KZU_ANIMATION_INTERPOLATION_BEZIER. |
| inPoint | A Bezier control point that is used in case there is a Bezier animation key before 'time'. |
| outPoint | A Bezier control point that is used in case there is a Bezier animation key after 'time'. |
| out_animationKey | A pointer that is set to point to the new animation key. |
| kzsError kzuAnimationKeyTextureCreate | ( | const struct KzcMemoryManager * | memoryManager, |
| kzFloat | time, | ||
| struct KzuTexture * | outputTexture, | ||
| struct KzuAnimationKeyTexture ** | out_animationKeyTexture | ||
| ) |
Creates new animation key for texture animation.
| kzsError kzuAnimationKeyMatrix4x4Create | ( | const struct KzcMemoryManager * | memoryManager, |
| kzFloat | time, | ||
| const struct KzcMatrix4x4 * | outputMatrix, | ||
| struct KzuAnimationKeyMatrix4x4 ** | out_animationKeyMatrix | ||
| ) |
Creates animation key for matrix4x4 animation.
| kzsError kzuAnimationKeyDelete | ( | struct KzuAnimationKey * | animationKey) |
Deallocates memory reserved for animation key.
| kzFloat kzuAnimationKeyGetTime | ( | const struct KzuAnimationKey * | key) |
Gets time from a given KzuAnimationKey.
| kzFloat kzuAnimationKeyFloatGetValue | ( | const struct KzuAnimationKeyFloat * | key) |
Gets output value from a given KzuAnimationFloatKey.
| kzsError kzuAnimationKeySetValueSource_private | ( | struct KzuAnimationKey * | key, |
| enum KzuAnimationKeyValueSource | source, | ||
| struct KzuResource * | resource | ||
| ) |
Private function for setting value source for animation key frame.
| enum KzuAnimationKeyValueSource kzuAnimationKeyGetValueSource | ( | const struct KzuAnimationKey * | key) |
Gets value source from animation key.
| void kzuAnimationKeyFloatSetValue | ( | struct KzuAnimationKeyFloat * | key, |
| kzFloat | value | ||
| ) |
Sets value for animation key float.
| struct KzuResource* kzuAnimationKeyGetValueSourceTargetObject | ( | const struct KzuAnimationKey * | key) |
Gets target object from key frame value source.
| kzsError kzuAnimationKeySetTargetObjectPath | ( | struct KzuAnimationKey * | key, |
| enum KzuAnimationKeyValueSource | source, | ||
| kzString | path | ||
| ) |
Sets target object path.
| kzString kzuAnimationKeyGetTargetObjectPath | ( | const struct KzuAnimationKey * | key) |
Sets target object path.
| struct KzuAnimationKey* kzuAnimationKeyFloatToAnimationKey | ( | const struct KzuAnimationKeyFloat * | key) |
Type casts KzuAnimationKeyFloat to KzuAnimationKey.
| struct KzuAnimationKeyFloat* kzuAnimationKeyFloatFromAnimationKey | ( | const struct KzuAnimationKey * | key) |
Type casts KzuAnimationKeyFloat from KzuAnimationKey.
| struct KzuAnimationKey* kzuAnimationKeyFloatWithTangentsToAnimationKey | ( | const struct KzuAnimationKeyFloatWithTangents * | key) |
Type casts KzuAnimationKeyFloatWithTangents to KzuAnimationKey.
| struct KzuAnimationKeyFloatWithTangents* kzuAnimationKeyFloatWithTangentsFromAnimationKey | ( | const struct KzuAnimationKey * | key) |
Type casts KzuAnimationKeyFloatWithTangents from KzuAnimationKey.
| struct KzuAnimationKey* kzuAnimationKeyTextureToAnimationKey | ( | const struct KzuAnimationKeyTexture * | key) |
Type casts KzuAnimationKeyTexture to KzuAnimationKey.
| struct KzuAnimationKeyTexture* kzuAnimationKeyToAnimationKeyTexture | ( | const struct KzuAnimationKey * | key) |
Type casts KzuAnimationKeyTexture from KzuAnimationKey.
| struct KzuAnimationKey* kzuAnimationKeyMatrix4x4ToAnimationKey | ( | const struct KzuAnimationKeyMatrix4x4 * | key) |
Type casts KzuAnimationKeyMatrix4x4 to KzuAnimationKey.
| struct KzuAnimationKeyMatrix4x4* kzuAnimationKeyToAnimationKeyMatrix4x4 | ( | const struct KzuAnimationKey * | key) |
Type casts KzuAnimationKeyMatrix4x4 from KzuAnimationKey.
| kzFloat kzuAnimationKeyFloatInterpolate | ( | kzFloat | input, |
| struct KzuAnimationKeyFloat * | keyStart, | ||
| struct KzuAnimationKeyFloat * | keyEnd | ||
| ) |
Returns the output value from given point input, which is located between the two keys.
| void kzuAnimationKeyMatrix4x4Interpolate | ( | kzFloat | input, |
| const struct KzuAnimationKeyMatrix4x4 * | keyStart, | ||
| const struct KzuAnimationKeyMatrix4x4 * | keyEnd, | ||
| struct KzcMatrix4x4 * | out_matrix | ||
| ) |
Returns the interpolated output value from input point, which is between the given two keys.
| struct KzuTexture* kzuAnimationKeyTextureInterpolate | ( | const struct KzuAnimationKeyTexture * | keyStart, |
| const struct KzuAnimationKeyTexture * | keyEnd | ||
| ) |
Returns the texture from given key frames.
The interpolation is made with step interpolation.
| kzFloat kzuAnimationInterpolateLinear | ( | kzFloat | time, |
| kzFloat | startValue, | ||
| kzFloat | endValue, | ||
| kzFloat | startTime, | ||
| kzFloat | endTime | ||
| ) |
Returns linearly interpolated value between given two values.
| kzFloat kzuAnimationInterpolateSmoothstep | ( | kzFloat | time, |
| kzFloat | startValue, | ||
| kzFloat | endValue, | ||
| kzFloat | startTime, | ||
| kzFloat | endTime | ||
| ) |
Returns smoothstep interpolated value between given two values.
| kzFloat kzuAnimationInterpolateBezier | ( | kzFloat | time, |
| kzFloat | startValue, | ||
| kzFloat | endValue, | ||
| kzFloat | startTime, | ||
| kzFloat | endTime, | ||
| const struct KzcVector2 * | outTangent, | ||
| const struct KzcVector2 * | inTangent | ||
| ) |
Returns cubic Bezier interpolated value from given values.
| kzFloat kzuAnimationInterpolateHermite | ( | kzFloat | time, |
| kzFloat | startValue, | ||
| kzFloat | endValue, | ||
| kzFloat | startTime, | ||
| kzFloat | endTime, | ||
| const struct KzcVector2 * | outTangent, | ||
| const struct KzcVector2 * | inTangent | ||
| ) |
Returns hermite interpolated value from given values.