separate getter/create method for boundingBoxAsset
This commit is contained in:
@@ -45,7 +45,8 @@ abstract class ThermionAsset {
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<MaterialInstance> getMaterialInstanceAt({ThermionEntity? entity, int index = 0});
|
Future<MaterialInstance> getMaterialInstanceAt(
|
||||||
|
{ThermionEntity? entity, int index = 0});
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
@@ -64,9 +65,19 @@ abstract class ThermionAsset {
|
|||||||
Future removeStencilHighlight();
|
Future removeStencilHighlight();
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Creates/returns a wireframe asset representing the bounding box for this asset.
|
/// The bounding box for this asset, as an actual renderable asset.
|
||||||
|
/// Null by default; call [createBoundingBoxAsset] first to create.
|
||||||
///
|
///
|
||||||
Future<ThermionAsset> getBoundingBoxAsset();
|
ThermionAsset? get boundingBoxAsset;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Creates the renderable bounding box for this asset.
|
||||||
|
/// This is safe to call multiple times; if [boundingBoxAsset] is non-null,
|
||||||
|
/// this will simply return the existing bounding box asset.
|
||||||
|
///
|
||||||
|
/// You will still need to call [Scene.add] to add this to the scene.
|
||||||
|
///
|
||||||
|
Future<ThermionAsset> createBoundingBoxAsset();
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -343,8 +343,10 @@ class BackgroundImage extends ThermionAsset {
|
|||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ThermionAsset? get boundingBoxAsset => throw UnimplementedError();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<ThermionAsset> getBoundingBoxAsset() {
|
Future<ThermionAsset> createBoundingBoxAsset() {
|
||||||
// TODO: implement getBoundingBoxAsset
|
// TODO: implement getBoundingBoxAsset
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ class FFIAsset extends ThermionAsset {
|
|||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
FFIAsset? boundingBoxAsset;
|
ThermionAsset? boundingBoxAsset;
|
||||||
|
|
||||||
Future<v64.Aabb3> getBoundingBox() async {
|
Future<v64.Aabb3> getBoundingBox() async {
|
||||||
final entities = <ThermionEntity>[];
|
final entities = <ThermionEntity>[];
|
||||||
@@ -272,8 +272,7 @@ class FFIAsset extends ThermionAsset {
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
@override
|
Future<ThermionAsset> createBoundingBoxAsset() async {
|
||||||
Future<ThermionAsset> getBoundingBoxAsset() async {
|
|
||||||
if (boundingBoxAsset == null) {
|
if (boundingBoxAsset == null) {
|
||||||
final boundingBox = await SceneAsset_getBoundingBox(asset);
|
final boundingBox = await SceneAsset_getBoundingBox(asset);
|
||||||
|
|
||||||
@@ -365,6 +364,10 @@ class FFIAsset extends ThermionAsset {
|
|||||||
return boundingBoxAsset!;
|
return boundingBoxAsset!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
@override
|
||||||
Future<MaterialInstance> getMaterialInstanceAt(
|
Future<MaterialInstance> getMaterialInstanceAt(
|
||||||
{ThermionEntity? entity, int index = 0}) async {
|
{ThermionEntity? entity, int index = 0}) async {
|
||||||
entity ??= this.entity;
|
entity ??= this.entity;
|
||||||
|
|||||||
Reference in New Issue
Block a user