feat: re-implement (native) Gizmo class, expose preserveScaling parameter for setParent, add methods for getting viewport bounding box from renderable entity

This commit is contained in:
Nick Fisher
2024-08-22 18:04:06 +08:00
parent 98c3676fdf
commit 7693a0fe14
15 changed files with 769 additions and 347 deletions

View File

@@ -822,9 +822,9 @@ extern "C"
return ((SceneManager *)sceneManager)->getParent(child);
}
EMSCRIPTEN_KEEPALIVE void set_parent(void *const sceneManager, EntityId child, EntityId parent)
EMSCRIPTEN_KEEPALIVE void set_parent(void *const sceneManager, EntityId child, EntityId parent, bool preserveScaling)
{
((SceneManager *)sceneManager)->setParent(child, parent);
((SceneManager *)sceneManager)->setParent(child, parent, preserveScaling);
}
EMSCRIPTEN_KEEPALIVE void test_collisions(void *const sceneManager, EntityId entity)
@@ -841,4 +841,10 @@ extern "C"
{
return ((SceneManager *)sceneManager)->getGizmo(out);
}
EMSCRIPTEN_KEEPALIVE Aabb2 get_bounding_box(void *const sceneManager, EntityId entity) {
return ((SceneManager *)sceneManager)->getBoundingBox(entity);
}
}