Table of Contents

Class AnimationUtil

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class AnimationUtil : IRenderer, IDisposable
Inheritance
AnimationUtil
Implements
Inherited Members
Extension Methods

Constructors

AnimationUtil(ICoreAPI, Vec3d)

public AnimationUtil(ICoreAPI api, Vec3d position)

Parameters

api ICoreAPI
position Vec3d

Fields

activeAnimationsByAnimCode

public Dictionary<string, AnimationMetaData> activeAnimationsByAnimCode

Field Value

Dictionary<string, AnimationMetaData>

animator

public AnimatorBase animator

Field Value

AnimatorBase

api

protected ICoreAPI api

Field Value

ICoreAPI

capi

protected ICoreClientAPI capi

Field Value

ICoreClientAPI

position

protected Vec3d position

Field Value

Vec3d

renderer

public AnimatableRenderer renderer

Field Value

AnimatableRenderer

stopRenderTriggered

protected bool stopRenderTriggered

Field Value

bool

Properties

RenderOrder

0 = drawn first, 1 = drawn last
Default render orders by render stage:
Before:
0 = Ambient Manager
0 = Camera

Opaque:
0.1 = Blue sky (Icosahedron)
0.2 = Night skybox
0.3 = Sun and moon
0.37 = Terrain opaque
0.4 = Enitities
0.5 = Decals
0.5 = Debug wireframe
0.6 = particles
0.7 = Cinematic camera line preview
0.8 = fp held item
0.9 = held item opaque custom renderer

OIT:
0.2 = Frame buffer debug screen
0.35 = Clouds
0.37 = Terrain oit
0.4 = Enitities
0.6 = particles
0.9 = held item oit custom renderer

Shadow far:
0 = shadow map init
0.37 = Terrain shadow far
0.4 = Enitities

Shadow far done:
1 = shadow map finish

Shadow near:
0 = shadow map init
0.37 = Terrain shadow near
0.4 = Enitities

Shadow near done:
1 = shadow map finish
Ortho:
0.2 = Frame buffer debug screen
0.4 = Enitities
0.9 = held item ortho custom renderer
0.95 = sleeping overlay
0.98 = bow/spear aiming reticle
1 = Gui manager
1.02 = crosshair and mouse cursor

AfterFinalComposition:
2 = screenshot

Done:
0.1 = gui manager
2 = screenshot

0.98 = Cinematic camera camera advancing and frame capture when recording
0.99 = Chunk Tesselator Manager (uploads new/modified chunk meshes)
0.999 = Compress chunks scan
1 = video recorder

public double RenderOrder { get; }

Property Value

double

RenderRange

Within what range to the player OnRenderFrame() should be called (currently not used!)

public int RenderRange { get; }

Property Value

int

RenderTextureId

protected virtual int RenderTextureId { get; }

Property Value

int

Methods

AnimationTickServer(float)

public void AnimationTickServer(float deltaTime)

Parameters

deltaTime float

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetAnimator(ICoreAPI, string, Shape)

public static AnimatorBase GetAnimator(ICoreAPI api, string cacheDictKey, Shape shape)

Parameters

api ICoreAPI
cacheDictKey string
shape Shape

Returns

AnimatorBase

InitializeAnimator(string, MeshData, Shape, Vec3f, EnumRenderStage)

public virtual void InitializeAnimator(string cacheDictKey, MeshData meshdata, Shape shape, Vec3f rotation, EnumRenderStage renderStage = EnumRenderStage.Opaque)

Parameters

cacheDictKey string
meshdata MeshData
shape Shape
rotation Vec3f
renderStage EnumRenderStage

InitializeAnimator(string, MeshRef, Shape, Vec3f, EnumRenderStage)

[Obsolete("Use MultiTextureMeshRef initialize instead, standard MeshRef does not support multiple texture atlasses")]
public virtual void InitializeAnimator(string cacheDictKey, MeshRef meshref, Shape blockShape, Vec3f rotation, EnumRenderStage renderStage = EnumRenderStage.Opaque)

Parameters

cacheDictKey string
meshref MeshRef
blockShape Shape
rotation Vec3f
renderStage EnumRenderStage

InitializeAnimator(string, MultiTextureMeshRef, Shape, Vec3f, EnumRenderStage)

public virtual void InitializeAnimator(string cacheDictKey, MultiTextureMeshRef meshref, Shape blockShape, Vec3f rotation, EnumRenderStage renderStage = EnumRenderStage.Opaque)

Parameters

cacheDictKey string
meshref MultiTextureMeshRef
blockShape Shape
rotation Vec3f
renderStage EnumRenderStage

InitializeAnimatorServer(string, Shape)

public virtual void InitializeAnimatorServer(string cacheDictKey, Shape blockShape)

Parameters

cacheDictKey string
blockShape Shape

InitializeShapeAndAnimator(string, Shape, ITexPositionSource, Vec3f, out MeshData)

public virtual void InitializeShapeAndAnimator(string cacheDictKey, Shape shape, ITexPositionSource texSource, Vec3f rotation, out MeshData meshdata)

Parameters

cacheDictKey string
shape Shape
texSource ITexPositionSource
rotation Vec3f
meshdata MeshData

OnAnimationsStateChange(bool)

protected virtual void OnAnimationsStateChange(bool animsNowActive)

Parameters

animsNowActive bool

OnRenderFrame(float, EnumRenderStage)

Called every frame for rendering whatever you need to render

public void OnRenderFrame(float deltaTime, EnumRenderStage stage)

Parameters

deltaTime float
stage EnumRenderStage

StartAnimation(AnimationMetaData)

public virtual bool StartAnimation(AnimationMetaData meta)

Parameters

meta AnimationMetaData

Returns

bool

StopAnimation(string)

public void StopAnimation(string code)

Parameters

code string