add hide/reveal entity

This commit is contained in:
Nick Fisher
2023-07-03 22:54:27 +08:00
parent 4adf8bbf80
commit 313fb9bebf
9 changed files with 288 additions and 137 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -220,15 +220,27 @@ class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
_cube!,
BoneAnimationData(
"Bone.001", ["Cube.001"], frameData, 1000.0 / 60.0));
// ,
// "Bone.001",
// "Cube.001",
// BoneTransform([Vec3(x: 0, y: 0.0, z: 0.0)],
// [Quaternion(x: 1, y: 1, z: 1, w: 1)]));
// break;
// ,
// "Bone.001",
// "Cube.001",
// BoneTransform([Vec3(x: 0, y: 0.0, z: 0.0)],
// [Quaternion(x: 1, y: 1, z: 1, w: 1)]));
// break;
break;
case 33:
if (_coneHidden) {
_filamentController.reveal(_cube!, "Cone");
} else {
_filamentController.hide(_cube!, "Cone");
}
setState(() {
_coneHidden = !_coneHidden;
});
}
}
bool _coneHidden = false;
Widget _item({int value = 0, Widget? child = null}) {
return GestureDetector(
onTap: () {
@@ -271,6 +283,9 @@ class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
child: Text('remove skybox'),
),
_item(value: 3, child: Text('load cube GLB')),
_item(
value: 33,
child: Text(_coneHidden ? 'show cone' : 'hide cone')),
_item(value: 4, child: Text('load cube GLTF')),
_item(value: 21, child: Text('swap cube texture')),
_item(value: 22, child: Text('transform to unit cube')),