refactor
This commit is contained in:
@@ -33,10 +33,16 @@ class FFIAsset extends ThermionAsset {
|
||||
///
|
||||
late final ThermionEntity entity;
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
FFIAsset(this.asset, this.app, {this.isInstance = false}) {
|
||||
entity = SceneAsset_getEntity(asset);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<List<ThermionEntity>> getChildEntities() async {
|
||||
var count = SceneAsset_getChildEntityCount(asset);
|
||||
@@ -45,6 +51,22 @@ class FFIAsset extends ThermionAsset {
|
||||
return children;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<ThermionEntity?> getChildEntity(
|
||||
FFIAsset asset, String childName) async {
|
||||
final childEntities = await getChildEntities();
|
||||
for (final entity in childEntities) {
|
||||
var name = NameComponentManager_getName(app.nameComponentManager, entity);
|
||||
if (name == childName) {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ThermionAsset> getInstance(int index) async {
|
||||
if (isInstance) {
|
||||
@@ -141,7 +163,8 @@ class FFIAsset extends ThermionAsset {
|
||||
}
|
||||
var sourceMaterialInstance = FFIMaterialInstance(
|
||||
RenderableManager_getMaterialInstanceAt(
|
||||
app.renderableManager, targetEntity, 0), app);
|
||||
app.renderableManager, targetEntity, 0),
|
||||
app);
|
||||
|
||||
await sourceMaterialInstance.setStencilWriteEnabled(true);
|
||||
await sourceMaterialInstance.setDepthWriteEnabled(true);
|
||||
@@ -173,7 +196,7 @@ class FFIAsset extends ThermionAsset {
|
||||
|
||||
await highlightMaterialInstance.setStencilReferenceValue(1);
|
||||
RenderableManager_setPriority(app.renderableManager, targetEntity, 0);
|
||||
|
||||
|
||||
TransformManager_setParent(
|
||||
app.transformManager, _highlight!.entity, entity, false);
|
||||
}
|
||||
@@ -328,6 +351,9 @@ class FFIAsset extends ThermionAsset {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future setCastShadows(bool castShadows) async {
|
||||
RenderableManager_setCastShadows(
|
||||
app.renderableManager, this.entity, castShadows);
|
||||
@@ -337,6 +363,9 @@ class FFIAsset extends ThermionAsset {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future setReceiveShadows(bool receiveShadows) async {
|
||||
RenderableManager_setReceiveShadows(
|
||||
app.renderableManager, this.entity, receiveShadows);
|
||||
@@ -345,4 +374,22 @@ class FFIAsset extends ThermionAsset {
|
||||
app.renderableManager, entity, receiveShadows);
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future<bool> isCastShadowsEnabled(ThermionEntity entity) async {
|
||||
return RenderableManager_isShadowCaster(app.renderableManager, entity);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future<bool> isReceiveShadowsEnabled(ThermionEntity entity) async {
|
||||
return RenderableManager_isShadowReceiver(app.renderableManager, entity);
|
||||
}
|
||||
|
||||
Future transformToUnitCube() async {
|
||||
SceneAsset_transformToUnitCube(asset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,61 @@
|
||||
import 'dart:ffi';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:thermion_dart/src/viewer/src/ffi/src/ffi_filament_app.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/ffi/src/thermion_dart.g.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/shared_types/layers.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
import '../../../../utils/src/matrix.dart';
|
||||
import '../../thermion_viewer_base.dart';
|
||||
import 'thermion_dart.g.dart' as g;
|
||||
|
||||
class FFICamera extends Camera {
|
||||
final Pointer<g.TCamera> camera;
|
||||
final Pointer<TCamera> camera;
|
||||
final FFIFilamentApp app;
|
||||
late ThermionEntity _entity;
|
||||
|
||||
FFICamera(this.camera, this.app) {
|
||||
_entity = g.Camera_getEntity(camera);
|
||||
_entity = Camera_getEntity(camera);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future setProjectionMatrixWithCulling(
|
||||
Matrix4 projectionMatrix, double near, double far) async {
|
||||
g.Camera_setCustomProjectionWithCulling(
|
||||
Camera_setCustomProjectionWithCulling(
|
||||
camera, matrix4ToDouble4x4(projectionMatrix), near, far);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future<Matrix4> getModelMatrix() async {
|
||||
return double4x4ToMatrix4(g.Camera_getModelMatrix(camera));
|
||||
return double4x4ToMatrix4(Camera_getModelMatrix(camera));
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<Matrix4> getProjectionMatrix() async {
|
||||
var matrixStruct = Camera_getProjectionMatrix(camera);
|
||||
return double4x4ToMatrix4(matrixStruct);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<Matrix4> getCullingProjectionMatrix() async {
|
||||
var matrixStruct = Camera_getCullingProjectionMatrix(camera);
|
||||
return double4x4ToMatrix4(matrixStruct);
|
||||
}
|
||||
|
||||
@override
|
||||
Future setTransform(Matrix4 transform) async {
|
||||
var entity = g.Camera_getEntity(camera);
|
||||
g.TransformManager_setTransform(
|
||||
var entity = Camera_getEntity(camera);
|
||||
TransformManager_setTransform(
|
||||
app.transformManager, entity, matrix4ToDouble4x4(transform));
|
||||
}
|
||||
|
||||
@@ -41,17 +65,23 @@ class FFICamera extends Camera {
|
||||
double far = kFar,
|
||||
double aspect = 1.0,
|
||||
double focalLength = kFocalLength}) async {
|
||||
g.Camera_setLensProjection(camera, near, far, aspect, focalLength);
|
||||
Camera_setLensProjection(camera, near, far, aspect, focalLength);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
ThermionEntity getEntity() {
|
||||
return _entity;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future setModelMatrix(Matrix4 matrix) async {
|
||||
g.Camera_setModelMatrix(camera, matrix4ToDouble4x4(matrix));
|
||||
Camera_setModelMatrix(camera, matrix4ToDouble4x4(matrix));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -64,30 +94,60 @@ class FFICamera extends Camera {
|
||||
@override
|
||||
int get hashCode => camera.hashCode;
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<double> getCullingFar() async {
|
||||
return g.Camera_getCullingFar(camera);
|
||||
return Camera_getCullingFar(camera);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<double> getNear() async {
|
||||
return g.Camera_getNear(camera);
|
||||
return Camera_getNear(camera);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
@override
|
||||
Future<double> getFocalLength() async {
|
||||
return g.Camera_getFocalLength(camera);
|
||||
return Camera_getFocalLength(camera);
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future<Frustum> getFrustum() async {
|
||||
var out = Float64List(24);
|
||||
Camera_getFrustum(camera, out.address);
|
||||
|
||||
var frustum = Frustum();
|
||||
frustum.plane0.setFromComponents(out[0], out[1], out[2], out[3]);
|
||||
frustum.plane1.setFromComponents(out[4], out[5], out[6], out[7]);
|
||||
frustum.plane2.setFromComponents(out[8], out[9], out[10], out[11]);
|
||||
frustum.plane3.setFromComponents(out[12], out[13], out[14], out[15]);
|
||||
frustum.plane4.setFromComponents(out[16], out[17], out[18], out[19]);
|
||||
frustum.plane5.setFromComponents(out[20], out[21], out[22], out[23]);
|
||||
return frustum;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Matrix4> getViewMatrix() async {
|
||||
return double4x4ToMatrix4(g.Camera_getViewMatrix(camera));
|
||||
return double4x4ToMatrix4(Camera_getViewMatrix(camera));
|
||||
}
|
||||
|
||||
@override
|
||||
Future setProjection(Projection projection, double left, double right,
|
||||
double bottom, double top, double near, double far) async {
|
||||
var pType = g.Projection.values[projection.index];
|
||||
g.Camera_setProjection(camera, pType, left, right, bottom, top, near, far);
|
||||
Camera_setProjection(camera, TProjection.values[projection.index], left,
|
||||
right, bottom, top, near, far);
|
||||
}
|
||||
|
||||
Future destroy() async {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,4 +152,17 @@ class FFIFilamentApp extends FilamentApp<Pointer> {
|
||||
|
||||
return FFIRenderTarget(renderTarget, this);
|
||||
}
|
||||
|
||||
// ///
|
||||
// ///
|
||||
// ///
|
||||
// Future<RenderTarget> createRenderTarget(int width, int height,
|
||||
// {covariant FFITexture? color, covariant FFITexture? depth}) async {
|
||||
// final renderTarget = await withPointerCallback<TRenderTarget>((cb) {
|
||||
// RenderTarget_createRenderThread(app.engine, width, height,
|
||||
// color?.pointer ?? nullptr, depth?.pointer ?? nullptr, cb);
|
||||
// });
|
||||
|
||||
// return FFIRenderTarget(renderTarget, app);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -21,7 +21,8 @@ class FFIGizmo extends FFIAsset implements GizmoAsset {
|
||||
}
|
||||
|
||||
bool isNonPickable(ThermionEntity entity) {
|
||||
return SceneManager_isGridEntity(sceneManager, entity);
|
||||
throw UnimplementedError();
|
||||
// return SceneManager_isGridEntity(sceneManager, entity);
|
||||
}
|
||||
|
||||
bool isGizmoEntity(ThermionEntity entity) => gizmoEntities.contains(entity);
|
||||
@@ -29,10 +30,7 @@ class FFIGizmo extends FFIAsset implements GizmoAsset {
|
||||
FFIGizmo(
|
||||
this._view,
|
||||
super.pointer,
|
||||
super.sceneManager,
|
||||
super.renderableManager,
|
||||
super.unlitMaterialProvider,
|
||||
super.viewer,
|
||||
super.app,
|
||||
this.gizmoEntities) {
|
||||
_nativeCallback =
|
||||
NativeCallable<GizmoPickCallbackFunction>.listener(_onPickResult);
|
||||
@@ -60,17 +58,17 @@ class FFIGizmo extends FFIAsset implements GizmoAsset {
|
||||
final viewport = await _view.getViewport();
|
||||
y = viewport.height - y;
|
||||
|
||||
Gizmo_pick(pointer.cast<TGizmo>(), x, y, _nativeCallback.nativeFunction);
|
||||
Gizmo_pick(asset.cast<TGizmo>(), x, y, _nativeCallback.nativeFunction);
|
||||
}
|
||||
|
||||
@override
|
||||
Future highlight(Axis axis) async {
|
||||
Gizmo_unhighlight(pointer.cast<TGizmo>());
|
||||
Gizmo_highlight(pointer.cast<TGizmo>(), TGizmoAxis.values[axis.index]);
|
||||
Gizmo_unhighlight(asset.cast<TGizmo>());
|
||||
Gizmo_highlight(asset.cast<TGizmo>(), TGizmoAxis.values[axis.index]);
|
||||
}
|
||||
|
||||
@override
|
||||
Future unhighlight() async {
|
||||
Gizmo_unhighlight(pointer.cast<TGizmo>());
|
||||
Gizmo_unhighlight(asset.cast<TGizmo>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:thermion_dart/src/viewer/src/ffi/src/ffi_filament_app.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/ffi/src/ffi_render_target.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/ffi/src/ffi_scene.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/ffi/src/ffi_swapchain.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/shared_types/scene.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/shared_types/layers.dart';
|
||||
import 'package:thermion_dart/src/viewer/src/shared_types/shared_types.dart';
|
||||
import 'callbacks.dart';
|
||||
import 'ffi_camera.dart';
|
||||
@@ -52,9 +52,8 @@ class FFIView extends View {
|
||||
|
||||
@override
|
||||
Future<Camera> getCamera() async {
|
||||
final transformManager = Engine_getTransformManager(app.engine);
|
||||
final cameraPtr = View_getCamera(view);
|
||||
return FFICamera(cameraPtr, app.engine, transformManager);
|
||||
return FFICamera(cameraPtr, app);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -85,7 +84,7 @@ class FFIView extends View {
|
||||
|
||||
@override
|
||||
Future setToneMapper(ToneMapper mapper) async {
|
||||
View_setToneMappingRenderThread(view, app.engine, mapper.index);
|
||||
View_setToneMappingRenderThread(view, app.engine, TToneMapping.values[mapper.index].value);
|
||||
}
|
||||
|
||||
Future setStencilBufferEnabled(bool enabled) async {
|
||||
@@ -112,4 +111,9 @@ class FFIView extends View {
|
||||
Future setScene(covariant FFIScene scene) async {
|
||||
await withVoidCallback((cb) => View_setScene(view, scene.scene));
|
||||
}
|
||||
|
||||
@override
|
||||
Future setLayerVisibility(VisibilityLayers layer, bool visible) async {
|
||||
View_setLayerEnabled(view, layer.value, visible);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -917,7 +917,7 @@ external void _View_setToneMapping(
|
||||
void View_setToneMapping(
|
||||
ffi.Pointer<TView> tView,
|
||||
ffi.Pointer<TEngine> tEngine,
|
||||
ToneMapping toneMapping,
|
||||
TToneMapping toneMapping,
|
||||
) =>
|
||||
_View_setToneMapping(
|
||||
tView,
|
||||
@@ -1019,6 +1019,26 @@ external void IndirectLight_setRotation(
|
||||
ffi.Pointer<ffi.Double> rotation,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TGizmo> Function(ffi.Pointer<TEngine>, ffi.Pointer<TView>,
|
||||
ffi.UnsignedInt)>(symbol: "Gizmo_create", isLeaf: true)
|
||||
external ffi.Pointer<TGizmo> _Gizmo_create(
|
||||
ffi.Pointer<TEngine> tEngine,
|
||||
ffi.Pointer<TView> tView,
|
||||
int tGizmoType,
|
||||
);
|
||||
|
||||
ffi.Pointer<TGizmo> Gizmo_create(
|
||||
ffi.Pointer<TEngine> tEngine,
|
||||
ffi.Pointer<TView> tView,
|
||||
TGizmoType tGizmoType,
|
||||
) =>
|
||||
_Gizmo_create(
|
||||
tEngine,
|
||||
tView,
|
||||
tGizmoType.value,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(ffi.Pointer<TGizmo>, ffi.Uint32, ffi.Uint32,
|
||||
GizmoPickCallback)>(isLeaf: true)
|
||||
@@ -1113,135 +1133,135 @@ external void Scene_addFilamentAsset(
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Int Function(
|
||||
ffi.Pointer<ffi.Int>, ffi.Float, ffi.Float, ffi.Float)>(isLeaf: true)
|
||||
external int set_camera_exposure(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TCamera>, ffi.Float, ffi.Float, ffi.Float)>(isLeaf: true)
|
||||
external void Camera_setExposure(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double aperture,
|
||||
double shutterSpeed,
|
||||
double sensitivity,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Int)>(isLeaf: true)
|
||||
external int set_camera_model_matrix(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
int matrix,
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TCamera>, double4x4)>(isLeaf: true)
|
||||
external void Camera_setModelMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double4x4 matrix,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int>(symbol: "double4x4")
|
||||
external int double4x41;
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 Camera_getModelMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Pointer<ffi.Int> Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external ffi.Pointer<ffi.Int> get_camera_frustum(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 Camera_getViewMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 Camera_getProjectionMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 Camera_getCullingProjectionMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TCamera>, ffi.Pointer<ffi.Double>)>(
|
||||
isLeaf: true)
|
||||
external void Camera_getFrustum(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
ffi.Pointer<ffi.Double> out,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Int Function(
|
||||
ffi.Pointer<ffi.Int>, ffi.Int, ffi.Double, ffi.Double)>(isLeaf: true)
|
||||
external int set_camera_projection_matrix(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
int matrix,
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TCamera>, double4x4, ffi.Double, ffi.Double)>(isLeaf: true)
|
||||
external void Camera_setProjectionMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double4x4 matrix,
|
||||
double near,
|
||||
double far,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Double, ffi.Double, ffi.Double,
|
||||
ffi.Double, ffi.Int)>(isLeaf: true)
|
||||
external int set_camera_projection_from_fov(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
ffi.Void Function(ffi.Pointer<TCamera>, ffi.Double, ffi.Double, ffi.Double,
|
||||
ffi.Double, ffi.Bool)>(isLeaf: true)
|
||||
external void Camera_setProjectionFromFov(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double fovInDegrees,
|
||||
double aspect,
|
||||
double near,
|
||||
double far,
|
||||
int horizontal,
|
||||
bool horizontal,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external int get_camera_focal_length(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
@ffi.Native<ffi.Double Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double Camera_getFocalLength(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external int Camera_getFocalLength(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external int Camera_getNear(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external int Camera_getCullingFar(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Int, ffi.Int, ffi.Int)>(
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TCamera>, double3, double3, double3)>(
|
||||
isLeaf: true)
|
||||
external int Camera_lookAt(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
int eye,
|
||||
int focus,
|
||||
int up,
|
||||
external void Camera_lookAt(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double3 eye,
|
||||
double3 focus,
|
||||
double3 up,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external int get_camera_near(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
@ffi.Native<ffi.Double Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double Camera_getNear(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>)>(isLeaf: true)
|
||||
external int get_camera_culling_far(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
@ffi.Native<ffi.Double Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double Camera_getCullingFar(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Int)>(isLeaf: true)
|
||||
external int get_camera_fov(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
int horizontal,
|
||||
@ffi.Native<ffi.Float Function(ffi.Pointer<TCamera>, ffi.Bool)>(isLeaf: true)
|
||||
external double Camera_getFov(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
bool horizontal,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Float)>(isLeaf: true)
|
||||
external int set_camera_focus_distance(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TCamera>, ffi.Float)>(isLeaf: true)
|
||||
external void Camera_setFocusDistance(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double focusDistance,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Int Function(
|
||||
ffi.Pointer<ffi.Int>, ffi.Int, ffi.Double, ffi.Double)>(isLeaf: true)
|
||||
external int Camera_setCustomProjectionWithCulling(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
int projectionMatrix,
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TCamera>, double4x4, ffi.Double, ffi.Double)>(isLeaf: true)
|
||||
external void Camera_setCustomProjectionWithCulling(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double4x4 projectionMatrix,
|
||||
double near,
|
||||
double far,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Int)>(isLeaf: true)
|
||||
external int Camera_setModelMatrix(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
int modelMatrix,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Int Function(ffi.Pointer<ffi.Int>, ffi.Double, ffi.Double, ffi.Double,
|
||||
ffi.Void Function(ffi.Pointer<TCamera>, ffi.Double, ffi.Double, ffi.Double,
|
||||
ffi.Double)>(isLeaf: true)
|
||||
external int Camera_setLensProjection(
|
||||
ffi.Pointer<ffi.Int> camera,
|
||||
external void Camera_setLensProjection(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
double near,
|
||||
double far,
|
||||
double aspect,
|
||||
double focalLength,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int>(symbol: "EntityId")
|
||||
external int EntityId1;
|
||||
@ffi.Native<EntityId Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external int Camera_getEntity(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Int Function(
|
||||
ffi.Pointer<ffi.Int>,
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TCamera>,
|
||||
ffi.UnsignedInt,
|
||||
ffi.Double,
|
||||
ffi.Double,
|
||||
@@ -1249,8 +1269,8 @@ external int EntityId1;
|
||||
ffi.Double,
|
||||
ffi.Double,
|
||||
ffi.Double)>(symbol: "Camera_setProjection", isLeaf: true)
|
||||
external int _Camera_setProjection(
|
||||
ffi.Pointer<ffi.Int> tCamera,
|
||||
external void _Camera_setProjection(
|
||||
ffi.Pointer<TCamera> tCamera,
|
||||
int projection,
|
||||
double left,
|
||||
double right,
|
||||
@@ -1260,9 +1280,9 @@ external int _Camera_setProjection(
|
||||
double far,
|
||||
);
|
||||
|
||||
int Camera_setProjection(
|
||||
ffi.Pointer<ffi.Int> tCamera,
|
||||
Projection projection,
|
||||
void Camera_setProjection(
|
||||
ffi.Pointer<TCamera> tCamera,
|
||||
TProjection projection,
|
||||
double left,
|
||||
double right,
|
||||
double bottom,
|
||||
@@ -1450,6 +1470,11 @@ external void RenderLoop_create();
|
||||
@ffi.Native<ffi.Void Function()>(isLeaf: true)
|
||||
external void RenderLoop_destroy();
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<ffi.Void>)>(isLeaf: true)
|
||||
external void RenderLoop_requestAnimationFrame(
|
||||
ffi.Pointer<ffi.Void> onComplete,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TRenderTicker>, ffi.Uint64)>(
|
||||
isLeaf: true)
|
||||
external void RenderTicker_renderRenderThread(
|
||||
@@ -1859,7 +1884,7 @@ external void Material_createInstanceRenderThread(
|
||||
external void View_setToneMappingRenderThread(
|
||||
ffi.Pointer<TView> tView,
|
||||
ffi.Pointer<TEngine> tEngine,
|
||||
int thermion,
|
||||
int toneMapping,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TView>, ffi.Bool, ffi.Double)>(
|
||||
@@ -2692,16 +2717,6 @@ external void TextureSampler_destroyRenderThread(
|
||||
ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> onComplete,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(ffi.Pointer<TSceneManager>, EntityId,
|
||||
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Bool)>>)>(
|
||||
isLeaf: true)
|
||||
external void update_bone_matrices_render_thread(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
int asset,
|
||||
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Bool)>> callback,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TSceneManager>,
|
||||
@@ -2790,364 +2805,6 @@ external void Scene_addFilamentAssetRenderThread(
|
||||
ffi.Pointer<ffi.NativeFunction<ffi.Void Function()>> callback,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 get_camera_model_matrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 get_camera_view_matrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 get_camera_projection_matrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 get_camera_culling_projection_matrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 Camera_getViewMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<double4x4 Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external double4x4 Camera_getModelMatrix(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<EntityId Function(ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external int Camera_getEntity(
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TGizmo> Function(
|
||||
ffi.Pointer<TSceneManager>,
|
||||
ffi.Pointer<TView>,
|
||||
ffi.Pointer<TScene>,
|
||||
ffi.UnsignedInt)>(symbol: "SceneManager_createGizmo", isLeaf: true)
|
||||
external ffi.Pointer<TGizmo> _SceneManager_createGizmo(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
ffi.Pointer<TView> tView,
|
||||
ffi.Pointer<TScene> tScene,
|
||||
int tGizmoType,
|
||||
);
|
||||
|
||||
ffi.Pointer<TGizmo> SceneManager_createGizmo(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
ffi.Pointer<TView> tView,
|
||||
ffi.Pointer<TScene> tScene,
|
||||
TGizmoType tGizmoType,
|
||||
) =>
|
||||
_SceneManager_createGizmo(
|
||||
tSceneManager,
|
||||
tView,
|
||||
tScene,
|
||||
tGizmoType.value,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TSceneAsset> Function(
|
||||
ffi.Pointer<TSceneManager>,
|
||||
ffi.Pointer<ffi.Float>,
|
||||
ffi.Int,
|
||||
ffi.Pointer<ffi.Float>,
|
||||
ffi.Int,
|
||||
ffi.Pointer<ffi.Float>,
|
||||
ffi.Int,
|
||||
ffi.Pointer<ffi.Uint16>,
|
||||
ffi.Int,
|
||||
ffi.Int,
|
||||
ffi.Pointer<ffi.Pointer<TMaterialInstance>>,
|
||||
ffi.Int,
|
||||
ffi.Bool)>(isLeaf: true)
|
||||
external ffi.Pointer<TSceneAsset> SceneManager_createGeometry(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
ffi.Pointer<ffi.Float> vertices,
|
||||
int numVertices,
|
||||
ffi.Pointer<ffi.Float> normals,
|
||||
int numNormals,
|
||||
ffi.Pointer<ffi.Float> uvs,
|
||||
int numUvs,
|
||||
ffi.Pointer<ffi.Uint16> indices,
|
||||
int numIndices,
|
||||
int primitiveType,
|
||||
ffi.Pointer<ffi.Pointer<TMaterialInstance>> materialInstances,
|
||||
int materialInstanceCount,
|
||||
bool keepData,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TMaterialProvider> Function(
|
||||
ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external ffi.Pointer<TMaterialProvider>
|
||||
SceneManager_getUbershaderMaterialProvider(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TMaterialProvider> Function(
|
||||
ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external ffi.Pointer<TMaterialProvider> SceneManager_getUnlitMaterialProvider(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TMaterialInstance> Function(
|
||||
ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external ffi.Pointer<TMaterialInstance>
|
||||
SceneManager_createUnlitMaterialInstance(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TMaterialInstance> Function(
|
||||
ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external ffi.Pointer<TMaterialInstance>
|
||||
SceneManager_createUnlitFixedSizeMaterialInstance(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(ffi.Pointer<TSceneManager>, ffi.Pointer<EntityId>,
|
||||
ffi.Pointer<ffi.Double>, ffi.Int)>(isLeaf: true)
|
||||
external void SceneManager_queueTransformUpdates(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
ffi.Pointer<EntityId> entities,
|
||||
ffi.Pointer<ffi.Double> transforms,
|
||||
int numEntities,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TCamera> Function(ffi.Pointer<TSceneManager>, EntityId,
|
||||
ffi.Pointer<ffi.Char>)>(isLeaf: true)
|
||||
external ffi.Pointer<TCamera> SceneManager_findCameraByName(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entity,
|
||||
ffi.Pointer<ffi.Char> name,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneManager>, EntityId, ffi.Int)>(
|
||||
isLeaf: true)
|
||||
external void SceneManager_setVisibilityLayer(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entity,
|
||||
int layer,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Pointer<TScene> Function(ffi.Pointer<TSceneManager>)>(
|
||||
isLeaf: true)
|
||||
external ffi.Pointer<TScene> SceneManager_getScene(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Pointer<TCamera> Function(ffi.Pointer<TSceneManager>)>(
|
||||
isLeaf: true)
|
||||
external ffi.Pointer<TCamera> SceneManager_createCamera(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TSceneManager>, ffi.Pointer<TCamera>)>(isLeaf: true)
|
||||
external void SceneManager_destroyCamera(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
ffi.Pointer<TCamera> camera,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Size Function(ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external int SceneManager_getCameraCount(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TCamera> Function(
|
||||
ffi.Pointer<TSceneManager>, ffi.Size)>(isLeaf: true)
|
||||
external ffi.Pointer<TCamera> SceneManager_getCameraAt(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
int index,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(ffi.Pointer<TSceneManager>,
|
||||
ffi.Pointer<TMaterialInstance>)>(isLeaf: true)
|
||||
external void SceneManager_destroyMaterialInstance(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
ffi.Pointer<TMaterialInstance> instance,
|
||||
);
|
||||
|
||||
@ffi.Native<Aabb3 Function(ffi.Pointer<TSceneManager>, EntityId)>(isLeaf: true)
|
||||
external Aabb3 SceneManager_getRenderableBoundingBox(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entity,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<TSceneManager>, EntityId)>(
|
||||
isLeaf: true)
|
||||
external int SceneManager_addToScene(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entity,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int Function(ffi.Pointer<TSceneManager>, EntityId)>(
|
||||
isLeaf: true)
|
||||
external int SceneManager_removeFromScene(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entity,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneManager>, EntityId)>(
|
||||
isLeaf: true)
|
||||
external void SceneManager_transformToUnitCube(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
int asset,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TSceneAsset> Function(
|
||||
ffi.Pointer<TSceneManager>,
|
||||
ffi.Pointer<ffi.Uint8>,
|
||||
ffi.Size,
|
||||
ffi.Int,
|
||||
ffi.Bool,
|
||||
ffi.Int,
|
||||
ffi.Int,
|
||||
ffi.Bool)>(isLeaf: true)
|
||||
external ffi.Pointer<TSceneAsset> SceneManager_loadGlbFromBuffer(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
ffi.Pointer<ffi.Uint8> arg1,
|
||||
int length,
|
||||
int numInstances,
|
||||
bool keepData,
|
||||
int priority,
|
||||
int layer,
|
||||
bool loadResourcesAsync,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TSceneAsset> Function(ffi.Pointer<TSceneManager>,
|
||||
ffi.Pointer<ffi.Char>, ffi.Int, ffi.Bool)>(isLeaf: true)
|
||||
external ffi.Pointer<TSceneAsset> SceneManager_loadGlb(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
ffi.Pointer<ffi.Char> assetPath,
|
||||
int numInstances,
|
||||
bool keepData,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TSceneAsset> Function(ffi.Pointer<TSceneManager>,
|
||||
ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, ffi.Bool)>(isLeaf: true)
|
||||
external ffi.Pointer<TSceneAsset> SceneManager_loadGltf(
|
||||
ffi.Pointer<TSceneManager> sceneManager,
|
||||
ffi.Pointer<ffi.Char> assetPath,
|
||||
ffi.Pointer<ffi.Char> relativePath,
|
||||
bool keepData,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
EntityId Function(
|
||||
ffi.Pointer<TSceneManager>,
|
||||
ffi.Uint8,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Float,
|
||||
ffi.Bool)>(isLeaf: true)
|
||||
external int SceneManager_addLight(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int type,
|
||||
double colour,
|
||||
double intensity,
|
||||
double posX,
|
||||
double posY,
|
||||
double posZ,
|
||||
double dirX,
|
||||
double dirY,
|
||||
double dirZ,
|
||||
double falloffRadius,
|
||||
double spotLightConeInner,
|
||||
double spotLightConeOuter,
|
||||
double sunAngularRadius,
|
||||
double sunHaloSize,
|
||||
double sunHaloFallof,
|
||||
bool shadows,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneManager>, EntityId)>(
|
||||
isLeaf: true)
|
||||
external void SceneManager_removeLight(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entityId,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external void SceneManager_destroyLights(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TSceneManager>, ffi.Pointer<TSceneAsset>)>(isLeaf: true)
|
||||
external void SceneManager_destroyAsset(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
ffi.Pointer<TSceneAsset> sceneAsset,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external void SceneManager_destroyAssets(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external void SceneManager_destroyAll(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TAnimationManager> Function(
|
||||
ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external ffi.Pointer<TAnimationManager> SceneManager_getAnimationManager(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TNameComponentManager> Function(
|
||||
ffi.Pointer<TSceneManager>)>(isLeaf: true)
|
||||
external ffi.Pointer<TNameComponentManager>
|
||||
SceneManager_getNameComponentManager(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TSceneAsset> Function(
|
||||
ffi.Pointer<TSceneManager>, ffi.Pointer<TMaterial>)>(isLeaf: true)
|
||||
external ffi.Pointer<TSceneAsset> SceneManager_createGrid(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
ffi.Pointer<TMaterial> tMaterial,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Bool Function(ffi.Pointer<TSceneManager>, EntityId)>(
|
||||
isLeaf: true)
|
||||
external bool SceneManager_isGridEntity(
|
||||
ffi.Pointer<TSceneManager> tSceneManager,
|
||||
int entityId,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(ffi.Pointer<TRenderableManager>, EntityId, ffi.Int,
|
||||
ffi.Pointer<TMaterialInstance>)>(isLeaf: true)
|
||||
@@ -3158,15 +2815,6 @@ external void RenderableManager_setMaterialInstanceAt(
|
||||
ffi.Pointer<TMaterialInstance> tMaterialInstance,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TRenderableManager>, EntityId, ffi.Int)>(isLeaf: true)
|
||||
external void RenderableManager_setPriority(
|
||||
ffi.Pointer<TRenderableManager> tRenderableManager,
|
||||
int entityId,
|
||||
int priority,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TMaterialInstance> Function(
|
||||
ffi.Pointer<TRenderableManager>, EntityId, ffi.Int)>(isLeaf: true)
|
||||
@@ -3250,6 +2898,24 @@ external Aabb3 RenderableManager_getAabb(
|
||||
int entityId,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TRenderableManager>, EntityId, ffi.Uint8)>(isLeaf: true)
|
||||
external void RenderableManager_setVisibilityLayer(
|
||||
ffi.Pointer<TRenderableManager> tRenderableManager,
|
||||
int entityId,
|
||||
int layer,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Void Function(
|
||||
ffi.Pointer<TRenderableManager>, EntityId, ffi.Uint8)>(isLeaf: true)
|
||||
external void RenderableManager_setPriority(
|
||||
ffi.Pointer<TRenderableManager> tRenderableManager,
|
||||
int entityId,
|
||||
int priority,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<TEngine> Function(
|
||||
ffi.UnsignedInt,
|
||||
@@ -3515,6 +3181,11 @@ external ffi.Pointer<TSceneAsset> SceneAsset_loadGltf(
|
||||
int numInstances,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneAsset>)>(isLeaf: true)
|
||||
external void SceneAsset_destroy(
|
||||
ffi.Pointer<TSceneAsset> tSceneAsset,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Void Function(ffi.Pointer<TSceneAsset>, ffi.Pointer<TScene>)>(
|
||||
isLeaf: true)
|
||||
external void SceneAsset_addToScene(
|
||||
@@ -3546,14 +3217,23 @@ external void SceneAsset_getChildEntities(
|
||||
ffi.Pointer<EntityId> out,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Int>()
|
||||
external final int utils;
|
||||
@ffi.Native<ffi.Pointer<EntityId> Function(ffi.Pointer<TSceneAsset>)>(
|
||||
isLeaf: true)
|
||||
external ffi.Pointer<EntityId> SceneAsset_getCameraEntities(
|
||||
ffi.Pointer<TSceneAsset> tSceneAsset,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Size Function(ffi.Pointer<TSceneAsset>)>(isLeaf: true)
|
||||
external int SceneAsset_getCameraEntityCount(
|
||||
ffi.Pointer<TSceneAsset> tSceneAsset,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Pointer<EntityId> Function(ffi.Pointer<TSceneAsset>)>(
|
||||
isLeaf: true)
|
||||
external ffi.Pointer<EntityId> SceneAsset_getLightEntities(
|
||||
ffi.Pointer<TSceneAsset> tSceneAsset,
|
||||
);
|
||||
|
||||
@ffi.Native<ffi.Size Function(ffi.Pointer<TSceneAsset>)>(isLeaf: true)
|
||||
external int SceneAsset_getLightEntityCount(
|
||||
ffi.Pointer<TSceneAsset> tSceneAsset,
|
||||
@@ -3821,15 +3501,6 @@ external void AnimationManager_setGltfAnimationFrame(
|
||||
int frame,
|
||||
);
|
||||
|
||||
@ffi.Native<
|
||||
ffi.Pointer<ffi.Void> Function(LoadFilamentResourceFromOwner,
|
||||
FreeFilamentResourceFromOwner, ffi.Pointer<ffi.Void>)>(isLeaf: true)
|
||||
external ffi.Pointer<ffi.Void> make_resource_loader(
|
||||
LoadFilamentResourceFromOwner loadFn,
|
||||
FreeFilamentResourceFromOwner freeFn,
|
||||
ffi.Pointer<ffi.Void> owner,
|
||||
);
|
||||
|
||||
final class TCamera extends ffi.Opaque {}
|
||||
|
||||
final class TEngine extends ffi.Opaque {}
|
||||
@@ -3844,6 +3515,8 @@ final class TLightManager extends ffi.Opaque {}
|
||||
|
||||
final class TRenderer extends ffi.Opaque {}
|
||||
|
||||
final class TRenderTicker extends ffi.Opaque {}
|
||||
|
||||
final class TFence extends ffi.Opaque {}
|
||||
|
||||
final class TRenderTarget extends ffi.Opaque {}
|
||||
@@ -4115,7 +3788,7 @@ enum TGizmoType {
|
||||
};
|
||||
}
|
||||
|
||||
abstract class TPrimitiveType {
|
||||
sealed class TPrimitiveType {
|
||||
/// !< points
|
||||
static const PRIMITIVETYPE_POINTS = 0;
|
||||
|
||||
@@ -4533,7 +4206,7 @@ enum TTextureFormat {
|
||||
}
|
||||
|
||||
/// ! Pixel Data Format
|
||||
abstract class TPixelDataFormat {
|
||||
sealed class TPixelDataFormat {
|
||||
/// !< One Red channel, float
|
||||
static const PIXELDATAFORMAT_R = 0;
|
||||
|
||||
@@ -4567,7 +4240,7 @@ abstract class TPixelDataFormat {
|
||||
static const PIXELDATAFORMAT_ALPHA = 11;
|
||||
}
|
||||
|
||||
abstract class TPixelDataType {
|
||||
sealed class TPixelDataType {
|
||||
/// !< unsigned byte
|
||||
static const PIXELDATATYPE_UBYTE = 0;
|
||||
|
||||
@@ -4738,19 +4411,19 @@ final class TViewport extends ffi.Struct {
|
||||
external int height;
|
||||
}
|
||||
|
||||
enum ToneMapping {
|
||||
enum TToneMapping {
|
||||
ACES(0),
|
||||
FILMIC(1),
|
||||
LINEAR(2);
|
||||
|
||||
final int value;
|
||||
const ToneMapping(this.value);
|
||||
const TToneMapping(this.value);
|
||||
|
||||
static ToneMapping fromValue(int value) => switch (value) {
|
||||
static TToneMapping fromValue(int value) => switch (value) {
|
||||
0 => ACES,
|
||||
1 => FILMIC,
|
||||
2 => LINEAR,
|
||||
_ => throw ArgumentError("Unknown value for ToneMapping: $value"),
|
||||
_ => throw ArgumentError("Unknown value for TToneMapping: $value"),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4832,22 +4505,20 @@ typedef GizmoPickCallbackFunction = ffi.Void Function(
|
||||
typedef DartGizmoPickCallbackFunction = void Function(
|
||||
TGizmoPickResultType resultType, double x, double y, double z);
|
||||
|
||||
enum Projection {
|
||||
enum TProjection {
|
||||
Perspective(0),
|
||||
Orthographic(1);
|
||||
|
||||
final int value;
|
||||
const Projection(this.value);
|
||||
const TProjection(this.value);
|
||||
|
||||
static Projection fromValue(int value) => switch (value) {
|
||||
static TProjection fromValue(int value) => switch (value) {
|
||||
0 => Perspective,
|
||||
1 => Orthographic,
|
||||
_ => throw ArgumentError("Unknown value for Projection: $value"),
|
||||
_ => throw ArgumentError("Unknown value for TProjection: $value"),
|
||||
};
|
||||
}
|
||||
|
||||
typedef TRenderTicker = ffi.Int;
|
||||
typedef DartTRenderTicker = int;
|
||||
typedef FilamentRenderCallback
|
||||
= ffi.Pointer<ffi.NativeFunction<FilamentRenderCallbackFunction>>;
|
||||
typedef FilamentRenderCallbackFunction = ffi.Void Function(
|
||||
@@ -4884,55 +4555,6 @@ enum TBackend {
|
||||
};
|
||||
}
|
||||
|
||||
final class ResourceBuffer extends ffi.Struct {
|
||||
external ffi.Pointer<ffi.Void> data;
|
||||
|
||||
@ffi.Int32()
|
||||
external int size;
|
||||
|
||||
@ffi.Int32()
|
||||
external int id;
|
||||
}
|
||||
|
||||
final class ResourceLoaderWrapper extends ffi.Struct {
|
||||
external LoadFilamentResource loadResource;
|
||||
|
||||
external FreeFilamentResource freeResource;
|
||||
|
||||
external LoadFilamentResourceFromOwner loadFromOwner;
|
||||
|
||||
external FreeFilamentResourceFromOwner freeFromOwner;
|
||||
|
||||
external ffi.Pointer<ffi.Void> owner;
|
||||
|
||||
external LoadFilamentResourceIntoOutPointer loadToOut;
|
||||
}
|
||||
|
||||
typedef LoadFilamentResource
|
||||
= ffi.Pointer<ffi.NativeFunction<LoadFilamentResourceFunction>>;
|
||||
typedef LoadFilamentResourceFunction = ResourceBuffer Function(
|
||||
ffi.Pointer<ffi.Char> uri);
|
||||
typedef FreeFilamentResource
|
||||
= ffi.Pointer<ffi.NativeFunction<FreeFilamentResourceFunction>>;
|
||||
typedef FreeFilamentResourceFunction = ffi.Void Function(ResourceBuffer);
|
||||
typedef DartFreeFilamentResourceFunction = void Function(ResourceBuffer);
|
||||
typedef LoadFilamentResourceFromOwner
|
||||
= ffi.Pointer<ffi.NativeFunction<LoadFilamentResourceFromOwnerFunction>>;
|
||||
typedef LoadFilamentResourceFromOwnerFunction = ResourceBuffer Function(
|
||||
ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Void>);
|
||||
typedef FreeFilamentResourceFromOwner
|
||||
= ffi.Pointer<ffi.NativeFunction<FreeFilamentResourceFromOwnerFunction>>;
|
||||
typedef FreeFilamentResourceFromOwnerFunction = ffi.Void Function(
|
||||
ResourceBuffer, ffi.Pointer<ffi.Void>);
|
||||
typedef DartFreeFilamentResourceFromOwnerFunction = void Function(
|
||||
ResourceBuffer, ffi.Pointer<ffi.Void>);
|
||||
typedef LoadFilamentResourceIntoOutPointer = ffi
|
||||
.Pointer<ffi.NativeFunction<LoadFilamentResourceIntoOutPointerFunction>>;
|
||||
typedef LoadFilamentResourceIntoOutPointerFunction = ffi.Void Function(
|
||||
ffi.Pointer<ffi.Char> uri, ffi.Pointer<ResourceBuffer> out);
|
||||
typedef DartLoadFilamentResourceIntoOutPointerFunction = void Function(
|
||||
ffi.Pointer<ffi.Char> uri, ffi.Pointer<ResourceBuffer> out);
|
||||
|
||||
const int __bool_true_false_are_defined = 1;
|
||||
|
||||
const int true1 = 1;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import 'package:thermion_dart/src/viewer/src/shared_types/layers.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
import '../thermion_viewer_base.dart';
|
||||
|
||||
enum Projection { Perspective, Orthographic }
|
||||
@@ -26,6 +26,8 @@ abstract class Camera {
|
||||
|
||||
Future<Matrix4> getViewMatrix();
|
||||
Future<Matrix4> getModelMatrix();
|
||||
Future<Matrix4> getProjectionMatrix();
|
||||
Future<Matrix4> getCullingProjectionMatrix();
|
||||
Future setModelMatrix(Matrix4 matrix);
|
||||
|
||||
ThermionEntity getEntity();
|
||||
@@ -35,4 +37,6 @@ abstract class Camera {
|
||||
Future<double> getNear();
|
||||
Future<double> getCullingFar();
|
||||
Future<double> getFocalLength();
|
||||
|
||||
Future destroy();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:thermion_dart/src/viewer/src/shared_types/layers.dart';
|
||||
import 'package:thermion_dart/thermion_dart.dart';
|
||||
|
||||
///
|
||||
@@ -14,12 +15,7 @@ class Viewport {
|
||||
Viewport(this.left, this.bottom, this.width, this.height);
|
||||
}
|
||||
|
||||
enum QualityLevel {
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH,
|
||||
ULTRA
|
||||
}
|
||||
enum QualityLevel { LOW, MEDIUM, HIGH, ULTRA }
|
||||
|
||||
abstract class View {
|
||||
Future<Viewport> getViewport();
|
||||
@@ -33,10 +29,11 @@ abstract class View {
|
||||
Future setRenderable(bool renderable, covariant SwapChain swapChain);
|
||||
Future setFrustumCullingEnabled(bool enabled);
|
||||
Future setToneMapper(ToneMapper mapper);
|
||||
Future setStencilBufferEnabled(bool enabled);
|
||||
Future setStencilBufferEnabled(bool enabled);
|
||||
Future<bool> isStencilBufferEnabled();
|
||||
Future setDithering(bool enabled);
|
||||
Future<bool> isDitheringEnabled();
|
||||
Future setBloom(bool enabled, double strength);
|
||||
Future setRenderQuality(QualityLevel quality);
|
||||
Future setLayerVisibility(VisibilityLayers layer, bool visible);
|
||||
}
|
||||
|
||||
@@ -622,20 +622,6 @@ abstract class ThermionViewer {
|
||||
///
|
||||
Future removeAnimationComponent(ThermionEntity entity);
|
||||
|
||||
///
|
||||
/// Makes [entity] collidable.
|
||||
/// This allows you to call [testCollisions] with any other entity ("entity B") to see if [entity] has collided with entity B. The callback will be invoked if so.
|
||||
/// Alternatively, if [affectsTransform] is true and this entity collides with another entity, any queued position updates to the latter entity will be ignored.
|
||||
///
|
||||
Future addCollisionComponent(ThermionEntity entity,
|
||||
{void Function(int entityId1, int entityId2)? callback,
|
||||
bool affectsTransform = false});
|
||||
|
||||
///
|
||||
/// Removes the collision component from [entity], meaning this will no longer be tested when [testCollisions] or [queuePositionUpdate] is called with another entity.
|
||||
///
|
||||
Future removeCollisionComponent(ThermionEntity entity);
|
||||
|
||||
///
|
||||
/// Creates a (renderable) entity with the specified geometry and adds to the scene.
|
||||
/// If [keepData] is true, the source data will not be released.
|
||||
@@ -660,12 +646,6 @@ abstract class ThermionViewer {
|
||||
Future setParent(ThermionEntity child, ThermionEntity? parent,
|
||||
{bool preserveScaling});
|
||||
|
||||
///
|
||||
/// Test all collidable entities against this entity to see if any have collided.
|
||||
/// This method returns void; the relevant callback passed to [addCollisionComponent] will be fired if a collision is detected.
|
||||
///
|
||||
Future testCollisions(ThermionEntity entity);
|
||||
|
||||
///
|
||||
/// Sets the draw priority for the given entity. See RenderableManager.h for more details.
|
||||
///
|
||||
@@ -811,11 +791,6 @@ abstract class ThermionViewer {
|
||||
///
|
||||
Future<MaterialInstance> createUnlitMaterialInstance();
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
Future<MaterialInstance> createUnlitFixedSizeMaterialInstance();
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
|
||||
@@ -1244,7 +1244,7 @@
|
||||
|
||||
// @override
|
||||
// Future<double> getCameraCullingFar() async {
|
||||
// final result = _module!.ccall("get_camera_culling_far", "double",
|
||||
// final result = _module!.ccall("Camera_getCullingFar", "double",
|
||||
// ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber;
|
||||
// return result.toDartDouble;
|
||||
// }
|
||||
@@ -1259,7 +1259,7 @@
|
||||
// @override
|
||||
// Future<Matrix4> getCameraCullingProjectionMatrix() async {
|
||||
// final ptr = _module!._malloc(16 * 8);
|
||||
// _module!.ccall("get_camera_culling_projection_matrix", "void",
|
||||
// _module!.ccall("Camera_getCullingProjectionMatrix", "void",
|
||||
// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null);
|
||||
// final matrix = Matrix4.zero();
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
@@ -1303,7 +1303,7 @@
|
||||
|
||||
// @override
|
||||
// Future<Matrix4> getCameraModelMatrix() async {
|
||||
// final ptr = _module!.ccall("get_camera_model_matrix", "void*",
|
||||
// final ptr = _module!.ccall("Camera_getModelMatrix", "void*",
|
||||
// ["void*".toJS].toJS, [_viewer!].toJS, null) as JSNumber;
|
||||
// final matrix = _matrixFromPtr(ptr);
|
||||
// _module!.ccall(
|
||||
@@ -1331,7 +1331,7 @@
|
||||
// @override
|
||||
// Future<Matrix4> getCameraProjectionMatrix() async {
|
||||
// final ptr = _module!._malloc(16 * 8);
|
||||
// _module!.ccall("get_camera_projection_matrix", "void",
|
||||
// _module!.ccall("Camera_getProjectionMatrix", "void",
|
||||
// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null);
|
||||
// final matrix = _matrixFromPtr(ptr);
|
||||
// _module!._free(ptr);
|
||||
@@ -1348,7 +1348,7 @@
|
||||
// @override
|
||||
// Future<Matrix4> getCameraViewMatrix() async {
|
||||
// final ptr = _module!._malloc(16 * 8);
|
||||
// _module!.ccall("get_camera_view_matrix", "void",
|
||||
// _module!.ccall("Camera_getViewMatrix", "void",
|
||||
// ["void*".toJS, "double*".toJS].toJS, [_viewer!, ptr].toJS, null);
|
||||
// final matrix = Matrix4.zero();
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
@@ -1761,7 +1761,7 @@
|
||||
// Future setCameraExposure(
|
||||
// double aperture, double shutterSpeed, double sensitivity) async {
|
||||
// _module!.ccall(
|
||||
// "set_camera_exposure",
|
||||
// "Camera_setExposure",
|
||||
// "void",
|
||||
// ["void*".toJS, "float".toJS, "float".toJS, "float".toJS].toJS,
|
||||
// [
|
||||
@@ -1786,7 +1786,7 @@
|
||||
// @override
|
||||
// Future setCameraFocusDistance(double focusDistance) async {
|
||||
// _module!.ccall(
|
||||
// "set_camera_focus_distance",
|
||||
// "Camera_setFocusDistance",
|
||||
// "void",
|
||||
// ["void*".toJS, "float".toJS].toJS,
|
||||
// [_viewer!, focusDistance.toJS].toJS,
|
||||
@@ -1812,7 +1812,7 @@
|
||||
// _module!
|
||||
// .setValue((ptr.toDartInt + (i * 8)).toJS, matrix[i].toJS, "double");
|
||||
// }
|
||||
// _module!.ccall("set_camera_model_matrix", "void",
|
||||
// _module!.ccall("Camera_setModelMatrix", "void",
|
||||
// ["void*".toJS, "float*".toJS].toJS, [_viewer!, ptr].toJS, null);
|
||||
// _module!._free(ptr);
|
||||
// }
|
||||
@@ -2125,7 +2125,7 @@
|
||||
// @override
|
||||
// Future<double> getCameraFov(bool horizontal) async {
|
||||
// var fov = _module!.ccall(
|
||||
// "get_camera_fov",
|
||||
// "Camera_getFov",
|
||||
// "float",
|
||||
// ["void*".toJS, "bool".toJS].toJS,
|
||||
// [_viewer!, horizontal.toJS].toJS,
|
||||
|
||||
Reference in New Issue
Block a user