add Dart-side methods
This commit is contained in:
@@ -5,6 +5,14 @@ import '../thermion_viewer_base.dart';
|
||||
enum Projection { Perspective, Orthographic }
|
||||
|
||||
abstract class Camera {
|
||||
Future lookAt(Vector3 position, {Vector3? focus, Vector3? up}) async {
|
||||
focus ??= Vector3.zero();
|
||||
up ??= Vector3(0, 1, 0);
|
||||
final viewMatrix = makeViewMatrix(position, focus, up);
|
||||
viewMatrix.invert();
|
||||
await setModelMatrix(viewMatrix);
|
||||
}
|
||||
|
||||
Future setProjection(Projection projection, double left, double right,
|
||||
double bottom, double top, double near, double far);
|
||||
Future setProjectionMatrixWithCulling(
|
||||
|
||||
@@ -2,4 +2,5 @@ import 'package:thermion_dart/thermion_dart.dart';
|
||||
|
||||
abstract class RenderTarget {
|
||||
Future<Texture> getColorTexture();
|
||||
Future<Texture> getDepthTexture();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ enum QualityLevel {
|
||||
|
||||
abstract class View {
|
||||
Future<Viewport> getViewport();
|
||||
Future updateViewport(int width, int height);
|
||||
Future setViewport(int width, int height);
|
||||
Future<RenderTarget?> getRenderTarget();
|
||||
Future setRenderTarget(covariant RenderTarget? renderTarget);
|
||||
Future setCamera(covariant Camera camera);
|
||||
|
||||
Reference in New Issue
Block a user