Files
cup_edit/thermion_dart/native/include/c_api/TAnimationManager.h
Nick Fisher ed444b0615 feature!:
This is a breaking change needed to fully implement instancing and stencil highlighting.

Previously, users would work directly with entities (on the Dart side, ThermionEntity), e.g.

final entity = await viewer.loadGlb("some.glb");

However, Filament "entities" are a lower-level abstraction.

Loading a glTF file, for example, inserts multiple entities into the scene.

For example, each mesh, light, and camera within a glTF asset will be assigned an entity. A top-level (non-renderable) entity will also be created for the glTF asset, which can be used to transform the entire hierarchy.

"Asset" is a better representation for loading/inserting objects into the scene; think of this as a bundle of entities.

Unless you need to work directly with transforms, instancing, materials and renderables, you can work directly with ThermionAsset.
2024-11-27 15:02:37 +11:00

137 lines
3.7 KiB
C

#pragma once
#include "APIExport.h"
#include "APIBoundaryTypes.h"
#ifdef __cplusplus
extern "C"
{
#endif
EMSCRIPTEN_KEEPALIVE void AnimationManager_addAnimationComponent(TAnimationManager *tAnimationManager, EntityId entityId);
EMSCRIPTEN_KEEPALIVE void AnimationManager_removeAnimationComponent(TAnimationManager *tAnimationManager, EntityId entityId);
EMSCRIPTEN_KEEPALIVE bool AnimationManager_setMorphAnimation(
TAnimationManager *tAnimationManager,
EntityId entityId,
const float *const morphData,
const uint32_t *const morphIndices,
int numMorphTargets,
int numFrames,
float frameLengthInMs);
EMSCRIPTEN_KEEPALIVE bool AnimationManager_clearMorphAnimation(TAnimationManager *tAnimationManager, EntityId entityId);
EMSCRIPTEN_KEEPALIVE void AnimationManager_resetToRestPose(TAnimationManager *tAnimationManager, TSceneAsset *sceneAsset);
EMSCRIPTEN_KEEPALIVE void AnimationManager_addBoneAnimation(
TAnimationManager *tAnimationManager,
TSceneAsset *tSceneAsset,
int skinIndex,
int boneIndex,
const float *const frameData,
int numFrames,
float frameLengthInMs,
float fadeOutInSecs,
float fadeInInSecs,
float maxDelta);
EMSCRIPTEN_KEEPALIVE EntityId AnimationManager_getBone(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int skinIndex,
int boneIndex);
EMSCRIPTEN_KEEPALIVE void AnimationManager_getRestLocalTransforms(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int skinIndex,
float *const out,
int numBones);
EMSCRIPTEN_KEEPALIVE void AnimationManager_getInverseBindMatrix(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int skinIndex,
int boneIndex,
float *const out);
EMSCRIPTEN_KEEPALIVE void AnimationManager_playAnimation(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int index,
bool loop,
bool reverse,
bool replaceActive,
float crossfade,
float startOffset);
EMSCRIPTEN_KEEPALIVE void AnimationManager_stopAnimation(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int index);
// Additional methods found in implementation
EMSCRIPTEN_KEEPALIVE float AnimationManager_getAnimationDuration(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int animationIndex);
EMSCRIPTEN_KEEPALIVE int AnimationManager_getAnimationCount(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset);
EMSCRIPTEN_KEEPALIVE void AnimationManager_getAnimationName(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
char *const outPtr,
int index);
EMSCRIPTEN_KEEPALIVE int AnimationManager_getBoneCount(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
int skinIndex);
EMSCRIPTEN_KEEPALIVE void AnimationManager_getBoneNames(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
const char **out,
int skinIndex);
EMSCRIPTEN_KEEPALIVE int AnimationManager_getMorphTargetNameCount(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
EntityId childEntity);
EMSCRIPTEN_KEEPALIVE void AnimationManager_getMorphTargetName(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset,
EntityId childEntity,
char *const outPtr,
int index);
EMSCRIPTEN_KEEPALIVE bool AnimationManager_updateBoneMatrices(
TAnimationManager *tAnimationManager,
TSceneAsset *sceneAsset);
EMSCRIPTEN_KEEPALIVE bool AnimationManager_setMorphTargetWeights(
TAnimationManager *tAnimationManager,
EntityId entityId,
const float *const morphData,
int numWeights);
EMSCRIPTEN_KEEPALIVE void AnimationManager_setGltfAnimationFrame(
TAnimationManager *tAnimationManager,
TSceneAsset *tSceneAsset,
int animationIndex,
int frame
);
#ifdef __cplusplus
}
#endif