restructure render loop to correct timings and expose FFI methods for setBoneTransform/setMorphWeights

This commit is contained in:
Nick Fisher
2023-11-20 11:35:50 +08:00
parent f0683b0b24
commit a24f56b31a
9 changed files with 167 additions and 24 deletions

View File

@@ -92,6 +92,9 @@ namespace polyvox
bool hide(EntityId entity, const char *meshName);
bool reveal(EntityId entity, const char *meshName);
const char *getNameForEntity(EntityId entityId);
utils::Entity findChildEntityByName(
EntityId entityId,
const char *entityName);
private:
AssetLoader *_assetLoader = nullptr;
@@ -108,6 +111,8 @@ namespace polyvox
vector<SceneAsset> _assets;
tsl::robin_map<EntityId, int> _entityIdLookup;
utils::Entity findEntityByName(
SceneAsset asset,
const char *entityName);

View File

@@ -168,6 +168,7 @@ extern "C"
FLUTTER_PLUGIN_EXPORT void set_post_processing(void *const viewer, bool enabled);
FLUTTER_PLUGIN_EXPORT void pick(void *const viewer, int x, int y, EntityId *entityId);
FLUTTER_PLUGIN_EXPORT const char *get_name_for_entity(void *const assetManager, const EntityId entityId);
FLUTTER_PLUGIN_EXPORT const EntityId find_child_entity_by_name(void *const assetManager, const EntityId parent, const char* name);
FLUTTER_PLUGIN_EXPORT void ios_dummy();
FLUTTER_PLUGIN_EXPORT void flutter_filament_free(void *ptr);
#ifdef __cplusplus

View File

@@ -58,6 +58,18 @@ FLUTTER_PLUGIN_EXPORT int get_animation_count_ffi(void* const assetManager, Enti
FLUTTER_PLUGIN_EXPORT void get_animation_name_ffi(void* const assetManager, EntityId asset, char *const outPtr, int index);
FLUTTER_PLUGIN_EXPORT void get_morph_target_name_ffi(void* const assetManager, EntityId asset, const char *meshName, char *const outPtr, int index);
FLUTTER_PLUGIN_EXPORT int get_morph_target_name_count_ffi(void* const assetManager, EntityId asset, const char *meshName);
FLUTTER_PLUGIN_EXPORT void set_morph_target_weights_ffi(void* const assetManager,
EntityId asset,
const char *const entityName,
const float *const morphData,
int numWeights
);
FLUTTER_PLUGIN_EXPORT bool set_bone_transform_ffi(
void *assetManager,
EntityId asset,
const char *entityName,
const float *const transform,
const char *boneName);
FLUTTER_PLUGIN_EXPORT void set_post_processing_ffi(void* const viewer, bool enabled);
FLUTTER_PLUGIN_EXPORT void pick_ffi(void* const viewer, int x, int y, EntityId* entityId);
FLUTTER_PLUGIN_EXPORT void ios_dummy_ffi();