All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kzu_animation_clip.h File Reference

Classes

struct  KzuAnimationClip
 Animation clip structure. More...
 

Namespaces

 kanzi
 

Typedefs

typedef shared_ptr
< KzuAnimationClip
kanzi::AnimationClipSharedPtr
 

Enumerations

enum  kzuAnimationClipType { KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP, KZU_ANIMATION_CLIP_TYPE_CHILD_CLIP }
 Animation clip type. More...
 

Functions

KANZI_API kzsError kzuAnimationClipCreate (kanzi::Domain *domain, kzFloat startTime, kzFloat endTime, kzuAnimationClipType clipType, KzuAnimationClip **out_animationClip)
 Creates a new animation clip. More...
 
KANZI_API kzsError kzuAnimationClipCreate (kanzi::Domain *domain, kanzi::string_view name, kzFloat startTime, kzFloat endTime, kzuAnimationClipType clipType, KzuAnimationClip **out_animationClip)
 
KANZI_API
kanzi::AnimationClipSharedPtr 
kzuAnimationClipCreate (kanzi::Domain *domain, kzFloat startTime, kzFloat endTime, kzuAnimationClipType clipType)
 
KANZI_API
kanzi::AnimationClipSharedPtr 
kzuAnimationClipCreateFromAnimation (kanzi::Domain *domain, kanzi::AnimationSharedPtr animation)
 Creates new animation clip which contains given animation. More...
 
KANZI_API kzsError kzuAnimationClipLoadFromKZB (struct KzuAnimationClip *animationClip, struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file)
 Loads an animation clip and any of its child clips and animations from the KZB file. More...
 
KANZI_API kzsError kzuAnimationClipLoadChildClipFromKZB (struct KzuAnimationClip *animationClip, struct KzcInputStream *inputStream, const struct KzuBinaryFileInfo *file)
 Loads a child animation clip and any of its child clips and animations from the KZB file. More...
 
KANZI_API void kzuAnimationClipSetRelative (struct KzuAnimationClip *animationClip, kzBool relative)
 Sets whether or not the animation clip is relative to the original value. More...
 
KANZI_API void kzuAnimationClipAddAnimation (KzuAnimationClip *animationClip, kanzi::AnimationSharedPtr animation)
 Adds given animation as target for this animation clip. More...
 
KANZI_API void kzuAnimationClipRemoveAnimation (KzuAnimationClip *animationClip, kanzi::AnimationSharedPtr animation)
 Removes animation from animation clip. More...
 
KANZI_API void kzuAnimationClipAddAnimationClip (KzuAnimationClip *animationClip, kanzi::AnimationClipSharedPtr childClip)
 Adds new child clip for the animation clip. More...
 
KANZI_API void kzuAnimationClipRemoveAnimationClip (KzuAnimationClip *animationClip, kanzi::AnimationClipSharedPtr childClip)
 Removes child clip from animation clip. More...
 
KANZI_API kzFloat kzuAnimationClipGetStartTime (const struct KzuAnimationClip *animationClip)
 Gets starting time of the animation sequence. More...
 
KANZI_API kzFloat kzuAnimationClipGetEndTime (const struct KzuAnimationClip *animationClip)
 Gets ending time of the animation sequence. More...
 
KANZI_API kzFloat kzuAnimationClipGetDuration (const struct KzuAnimationClip *animationClip)
 Gets duration of the animation sequence stored in animation clip. More...
 
KANZI_API kzsError kzuAnimationClipAnimate (struct KzuAnimationPlayer *player, struct KzuAnimationClip *animationClip, kzFloat time)
 Animates given animations clip targeting specified property. More...
 
KANZI_API kzsError kzuAnimationClipPrepare (struct KzuAnimationPlayer *player, struct KzuAnimationClip *animationClip)
 Prepares animation clip target properties for animation. More...
 
KANZI_API kzsError kzuAnimationClipSetTargetObjectPath (struct KzuAnimationClip *animationClip, kzString path)
 Sets the target object path. More...
 
KANZI_API kzString kzuAnimationClipGetTargetObjectPath (const struct KzuAnimationClip *animationClip)
 Gets target object path. More...
 
KANZI_API void * kzuAnimationClipGetTargetResource (const struct KzuAnimationClip *animationClip)
 Gets target resource (pointer to Resource) from animation clip. More...
 
KANZI_API struct KzuAnimationClipkzuAnimationClipGetParentClip (const struct KzuAnimationClip *animationClip)
 
KANZI_API struct KzuAnimationClipkzuAnimationClipGetRootClip (struct KzuAnimationClip *animationClip)
 Gets the root clip from the animation clip, which is the last clip in the chain of parent clips the animation clip has. More...
 

Enumeration Type Documentation

Animation clip type.

Enumerator
KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP 

Root animation clip, can be used in entries and "play animation" actions.

KZU_ANIMATION_CLIP_TYPE_CHILD_CLIP 

Child animation clip.

Function Documentation

KANZI_API kzsError kzuAnimationClipCreate ( kanzi::Domain domain,
kzFloat  startTime,
kzFloat  endTime,
kzuAnimationClipType  clipType,
KzuAnimationClip **  out_animationClip 
)

Creates a new animation clip.

There are two types of animation clips: KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP and KZU_ANIMATION_CLIP_TYPE_CHILD_CLIP. Root animation clips have start time, end time, duration, and relative (kzuAnimationClipSetRelative()) flag. Child animation clips are children of root animation clips or other child animation clips. Child animations have a target object or resource. Each animation clip can include zero or more KzuAnimation objects.

Parameters
domainThe UI domain to use.
startTimeThe start time of the clip in seconds in animation player time.
endTimeThe end time of the clip in seconds in animation player time.
clipTypeKZU_ANIMATION_CLIP_TYPE_ROOT_CLIP or KZU_ANIMATION_CLIP_TYPE_CHILD_CLIP.
out_animationClipA pointer that is set to point to the new animation clip.
Returns
KZS_SUCCESS on success.
KANZI_API kzsError kzuAnimationClipCreate ( kanzi::Domain domain,
kanzi::string_view  name,
kzFloat  startTime,
kzFloat  endTime,
kzuAnimationClipType  clipType,
KzuAnimationClip **  out_animationClip 
)
KANZI_API kanzi::AnimationClipSharedPtr kzuAnimationClipCreate ( kanzi::Domain domain,
kzFloat  startTime,
kzFloat  endTime,
kzuAnimationClipType  clipType 
)
KANZI_API kanzi::AnimationClipSharedPtr kzuAnimationClipCreateFromAnimation ( kanzi::Domain domain,
kanzi::AnimationSharedPtr  animation 
)

Creates new animation clip which contains given animation.

KANZI_API kzsError kzuAnimationClipLoadFromKZB ( struct KzuAnimationClip animationClip,
struct KzcInputStream inputStream,
const struct KzuBinaryFileInfo file 
)

Loads an animation clip and any of its child clips and animations from the KZB file.

KANZI_API kzsError kzuAnimationClipLoadChildClipFromKZB ( struct KzuAnimationClip animationClip,
struct KzcInputStream inputStream,
const struct KzuBinaryFileInfo file 
)

Loads a child animation clip and any of its child clips and animations from the KZB file.

KANZI_API void kzuAnimationClipSetRelative ( struct KzuAnimationClip animationClip,
kzBool  relative 
)

Sets whether or not the animation clip is relative to the original value.

Being relative means that the animation value of the clip is added to the original animated value, instead of it replacing the original value. The clip type must be KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP.

KANZI_API void kzuAnimationClipAddAnimation ( KzuAnimationClip animationClip,
kanzi::AnimationSharedPtr  animation 
)

Adds given animation as target for this animation clip.

KANZI_API void kzuAnimationClipRemoveAnimation ( KzuAnimationClip animationClip,
kanzi::AnimationSharedPtr  animation 
)

Removes animation from animation clip.

KANZI_API void kzuAnimationClipAddAnimationClip ( KzuAnimationClip animationClip,
kanzi::AnimationClipSharedPtr  childClip 
)

Adds new child clip for the animation clip.

KANZI_API void kzuAnimationClipRemoveAnimationClip ( KzuAnimationClip animationClip,
kanzi::AnimationClipSharedPtr  childClip 
)

Removes child clip from animation clip.

KANZI_API kzFloat kzuAnimationClipGetStartTime ( const struct KzuAnimationClip animationClip)

Gets starting time of the animation sequence.

Returned time is relative to animation time line. The clip type must be KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP.

KANZI_API kzFloat kzuAnimationClipGetEndTime ( const struct KzuAnimationClip animationClip)

Gets ending time of the animation sequence.

Returned time is relative to animation time line. The clip type must be KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP.

KANZI_API kzFloat kzuAnimationClipGetDuration ( const struct KzuAnimationClip animationClip)

Gets duration of the animation sequence stored in animation clip.

The clip type must be KZU_ANIMATION_CLIP_TYPE_ROOT_CLIP.

KANZI_API kzsError kzuAnimationClipAnimate ( struct KzuAnimationPlayer player,
struct KzuAnimationClip animationClip,
kzFloat  time 
)

Animates given animations clip targeting specified property.

Parameters
timeTime of animation in seconds, relative to the beginning of the animation clip.
KANZI_API kzsError kzuAnimationClipPrepare ( struct KzuAnimationPlayer player,
struct KzuAnimationClip animationClip 
)

Prepares animation clip target properties for animation.

Resets states and values.

KANZI_API kzsError kzuAnimationClipSetTargetObjectPath ( struct KzuAnimationClip animationClip,
kzString  path 
)

Sets the target object path.

The path should point to a ::KzuObjectNode only. The path can be absolute or relative to the context object path of the time line entry containing this clip (see kzuTimeLineEntrySetContextObjectPath()).

KANZI_API kzString kzuAnimationClipGetTargetObjectPath ( const struct KzuAnimationClip animationClip)

Gets target object path.

KANZI_API void* kzuAnimationClipGetTargetResource ( const struct KzuAnimationClip animationClip)

Gets target resource (pointer to Resource) from animation clip.

KANZI_API struct KzuAnimationClip* kzuAnimationClipGetParentClip ( const struct KzuAnimationClip animationClip)
Returns
The parent animation clip or KZ_NULL if it has none.
KANZI_API struct KzuAnimationClip* kzuAnimationClipGetRootClip ( struct KzuAnimationClip animationClip)

Gets the root clip from the animation clip, which is the last clip in the chain of parent clips the animation clip has.