start using menu for example project & add methods for getting camera model/view matrices
This commit is contained in:
@@ -440,9 +440,10 @@ abstract class FilamentController {
|
||||
|
||||
///
|
||||
/// Sets the options for manipulating the camera via the viewport.
|
||||
/// ManipulatorMode.FREE_FLIGHT and ManipulatorMode.MAP are currently unsupported and will throw an exception.
|
||||
///
|
||||
Future setCameraManipulatorOptions(
|
||||
{ManipulatorMode mode = ManipulatorMode.FREE_FLIGHT,
|
||||
{ManipulatorMode mode = ManipulatorMode.ORBIT,
|
||||
double orbitSpeedX = 0.01,
|
||||
double orbitSpeedY = 0.01,
|
||||
double zoomSpeed = 0.01});
|
||||
|
||||
@@ -1012,8 +1012,11 @@ class FilamentControllerFFI extends FilamentController {
|
||||
var arrayPtr = _lib.get_camera_model_matrix(_viewer!);
|
||||
var doubleList = arrayPtr.asTypedList(16);
|
||||
var modelMatrix = Matrix4.fromFloat64List(doubleList);
|
||||
|
||||
var position = modelMatrix.getColumn(3).xyz;
|
||||
|
||||
calloc.free(arrayPtr);
|
||||
return modelMatrix.getColumn(3).xyz;
|
||||
return position;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1032,13 +1035,16 @@ class FilamentControllerFFI extends FilamentController {
|
||||
|
||||
@override
|
||||
Future setCameraManipulatorOptions(
|
||||
{ManipulatorMode mode = ManipulatorMode.FREE_FLIGHT,
|
||||
{ManipulatorMode mode = ManipulatorMode.ORBIT,
|
||||
double orbitSpeedX = 0.01,
|
||||
double orbitSpeedY = 0.01,
|
||||
double zoomSpeed = 0.01}) async {
|
||||
if (_viewer == null) {
|
||||
throw Exception("No viewer available");
|
||||
}
|
||||
if (mode != ManipulatorMode.ORBIT) {
|
||||
throw Exception("Manipulator mode $mode not yet implemented");
|
||||
}
|
||||
_lib.set_camera_manipulator_options(
|
||||
_viewer!, mode.index, orbitSpeedX, orbitSpeedX, zoomSpeed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user