summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/models/Untitled.pngbin0 -> 449357 bytes
-rw-r--r--assets/models/plane.binbin0 -> 140 bytes
-rw-r--r--assets/models/plane.gltf137
-rw-r--r--src/entities.cpp15
4 files changed, 152 insertions, 0 deletions
diff --git a/assets/models/Untitled.png b/assets/models/Untitled.png
new file mode 100644
index 0000000..9d5f6f4
--- /dev/null
+++ b/assets/models/Untitled.png
Binary files differ
diff --git a/assets/models/plane.bin b/assets/models/plane.bin
new file mode 100644
index 0000000..c7dbdbe
--- /dev/null
+++ b/assets/models/plane.bin
Binary files differ
diff --git a/assets/models/plane.gltf b/assets/models/plane.gltf
new file mode 100644
index 0000000..da40554
--- /dev/null
+++ b/assets/models/plane.gltf
@@ -0,0 +1,137 @@
+{
+ "asset":{
+ "generator":"Khronos glTF Blender I/O v3.6.27",
+ "version":"2.0"
+ },
+ "scene":0,
+ "scenes":[
+ {
+ "name":"Scene",
+ "nodes":[
+ 0
+ ]
+ }
+ ],
+ "nodes":[
+ {
+ "mesh":0,
+ "name":"Plane"
+ }
+ ],
+ "materials":[
+ {
+ "doubleSided":true,
+ "name":"Material",
+ "pbrMetallicRoughness":{
+ "baseColorTexture":{
+ "index":0
+ },
+ "metallicFactor":0,
+ "roughnessFactor":0.5
+ }
+ }
+ ],
+ "meshes":[
+ {
+ "name":"Plane",
+ "primitives":[
+ {
+ "attributes":{
+ "POSITION":0,
+ "NORMAL":1,
+ "TEXCOORD_0":2
+ },
+ "indices":3,
+ "material":0
+ }
+ ]
+ }
+ ],
+ "textures":[
+ {
+ "sampler":0,
+ "source":0
+ }
+ ],
+ "images":[
+ {
+ "mimeType":"image/png",
+ "name":"Untitled",
+ "uri":"Untitled.png"
+ }
+ ],
+ "accessors":[
+ {
+ "bufferView":0,
+ "componentType":5126,
+ "count":4,
+ "max":[
+ 1,
+ 1,
+ 0
+ ],
+ "min":[
+ -1,
+ -1,
+ 0
+ ],
+ "type":"VEC3"
+ },
+ {
+ "bufferView":1,
+ "componentType":5126,
+ "count":4,
+ "type":"VEC3"
+ },
+ {
+ "bufferView":2,
+ "componentType":5126,
+ "count":4,
+ "type":"VEC2"
+ },
+ {
+ "bufferView":3,
+ "componentType":5123,
+ "count":6,
+ "type":"SCALAR"
+ }
+ ],
+ "bufferViews":[
+ {
+ "buffer":0,
+ "byteLength":48,
+ "byteOffset":0,
+ "target":34962
+ },
+ {
+ "buffer":0,
+ "byteLength":48,
+ "byteOffset":48,
+ "target":34962
+ },
+ {
+ "buffer":0,
+ "byteLength":32,
+ "byteOffset":96,
+ "target":34962
+ },
+ {
+ "buffer":0,
+ "byteLength":12,
+ "byteOffset":128,
+ "target":34963
+ }
+ ],
+ "samplers":[
+ {
+ "magFilter":9729,
+ "minFilter":9987
+ }
+ ],
+ "buffers":[
+ {
+ "byteLength":140,
+ "uri":"plane.bin"
+ }
+ ]
+}
diff --git a/src/entities.cpp b/src/entities.cpp
index 70b3a58..0c7003c 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -73,6 +73,21 @@ void EntityType_Init() {
}
}
);
+ globalEntityTypes.Push(
+ EntityType {
+ .modelsDir = "assets/models",
+ .modelFile = "plane.gltf",
+ .entityTypeCode = "EntTypePlane",
+ .entityHandle = ECS_CreateEntity(),
+ .startingInstanceCount = 16,
+ .Importer_GLTF = {
+ .AccessorIndexVertex = 0,
+ .AccessorIndexNormal = 1,
+ .AccessorIndexUV = 2,
+ .AccessorIndexIndex = 3,
+ }
+ }
+ );
VkDescriptorSetLayoutBinding vkDescriptorSetLayoutBindings[2];
for (long i = 0; i < 2; ++i) {