refactor: Dart types

This commit is contained in:
Nick Fisher
2024-09-19 09:07:35 +08:00
parent ab649e860d
commit ddc433a126
6 changed files with 35 additions and 5 deletions

View File

@@ -8,6 +8,4 @@ export 'light_options.dart';
// a handle that can be safely passed back to the rendering layer to manipulate an Entity
typedef ThermionEntity = int;
abstract class ThermionTexture {
}

View File

@@ -8,7 +8,6 @@ class Geometry {
final Float32List normals;
final Float32List uvs;
final PrimitiveType primitiveType;
final String? materialPath;
Geometry(
this.vertices,
@@ -16,7 +15,6 @@ class Geometry {
Float32List? normals,
Float32List? uvs,
this.primitiveType = PrimitiveType.TRIANGLES,
this.materialPath,
}) : indices = Uint16List.fromList(indices),
normals = normals ?? Float32List(0),
uvs = uvs ?? Float32List(0) {

View File

@@ -53,4 +53,24 @@ DirectLight.point({
direction: Vector3.zero(),
falloffRadius: falloffRadius,
);
DirectLight.sun({
double color = 6500,
double intensity = 100000,
bool castShadows = true,
Vector3? direction,
double sunAngularRadius = 0.545,
double sunHaloSize = 10.0,
double sunHaloFalloff = 80.0,
}) : this(
type: LightType.DIRECTIONAL,
color: color,
intensity: intensity,
castShadows: castShadows,
position: Vector3(0, 0, 0),
direction: direction ?? Vector3(0, -1, 0),
sunAngularRadius: sunAngularRadius,
sunHaloSize: sunHaloSize,
sunHaloFallof: sunHaloFalloff,
);
}

View File

@@ -0,0 +1,9 @@
abstract class MaterialInstance {
}
enum AlphaMode {
OPAQUE,
MASK,
BLEND
}

View File

@@ -1,5 +1,7 @@
library shared_types;
export 'material.dart';
export 'texture.dart';
export 'entities.dart';
export 'light.dart';
export 'shadow.dart';

View File

@@ -0,0 +1,3 @@
abstract class ThermionTexture {
}