summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-08-22 12:40:58 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-08-22 12:40:58 -0400
commit7c283bf98c54245e87c43aac100bb87cb04bb04e (patch)
treee9d7f74e089e7e5c0fd7a71f302115a8fae59114
parenta015e2b38edc4d5c3b18e5fa126d50b26fb5f473 (diff)
pke-editor: EntType create != collision callback
-rw-r--r--assets/models/cube.gltf33
-rw-r--r--assets/models/cube.pngbin182802 -> 0 bytes
-rw-r--r--assets/models/pill.binbin0 -> 39592 bytes
-rw-r--r--assets/models/pill.gltf104
-rw-r--r--assets/models/plane.gltf33
-rw-r--r--assets/models/plane.pngbin449357 -> 0 bytes
-rw-r--r--assets/models/torus.gltf33
-rw-r--r--assets/models/torus.pngbin340857 -> 0 bytes
-rw-r--r--editor/editor.cpp8
-rw-r--r--src/entities.hpp3
10 files changed, 112 insertions, 102 deletions
diff --git a/assets/models/cube.gltf b/assets/models/cube.gltf
index e43dd04..c4ad912 100644
--- a/assets/models/cube.gltf
+++ b/assets/models/cube.gltf
@@ -18,19 +18,6 @@
"name":"Cube"
}
],
- "materials":[
- {
- "doubleSided":true,
- "name":"Material.001",
- "pbrMetallicRoughness":{
- "baseColorTexture":{
- "index":0
- },
- "metallicFactor":0,
- "roughnessFactor":0.5
- }
- }
- ],
"meshes":[
{
"name":"Cube.001",
@@ -42,24 +29,10 @@
"TEXCOORD_0":2
},
"indices":3,
- "material":0
}
]
}
],
- "textures":[
- {
- "sampler":0,
- "source":0
- }
- ],
- "images":[
- {
- "mimeType":"image/png",
- "name":"cube",
- "uri":"cube.png"
- }
- ],
"accessors":[
{
"bufferView":0,
@@ -122,12 +95,6 @@
"target":34963
}
],
- "samplers":[
- {
- "magFilter":9729,
- "minFilter":9987
- }
- ],
"buffers":[
{
"byteLength":840,
diff --git a/assets/models/cube.png b/assets/models/cube.png
deleted file mode 100644
index 74a7e29..0000000
--- a/assets/models/cube.png
+++ /dev/null
Binary files differ
diff --git a/assets/models/pill.bin b/assets/models/pill.bin
new file mode 100644
index 0000000..4cbf14d
--- /dev/null
+++ b/assets/models/pill.bin
Binary files differ
diff --git a/assets/models/pill.gltf b/assets/models/pill.gltf
new file mode 100644
index 0000000..9eec3c3
--- /dev/null
+++ b/assets/models/pill.gltf
@@ -0,0 +1,104 @@
+{
+ "asset":{
+ "generator":"Khronos glTF Blender I/O v3.6.28",
+ "version":"2.0"
+ },
+ "scene":0,
+ "scenes":[
+ {
+ "name":"Scene",
+ "nodes":[
+ 0
+ ]
+ }
+ ],
+ "nodes":[
+ {
+ "mesh":0,
+ "name":"Mball.001"
+ }
+ ],
+ "meshes":[
+ {
+ "name":"Mesh",
+ "primitives":[
+ {
+ "attributes":{
+ "POSITION":0,
+ "NORMAL":1,
+ "TEXCOORD_0":2
+ },
+ "indices":3
+ }
+ ]
+ }
+ ],
+ "accessors":[
+ {
+ "bufferView":0,
+ "componentType":5126,
+ "count":1136,
+ "max":[
+ 1.1333107948303223,
+ 2.115109443664551,
+ 1.1333107948303223
+ ],
+ "min":[
+ -1.1333107948303223,
+ -2.115109443664551,
+ -1.1333107948303223
+ ],
+ "type":"VEC3"
+ },
+ {
+ "bufferView":1,
+ "componentType":5126,
+ "count":1136,
+ "type":"VEC3"
+ },
+ {
+ "bufferView":2,
+ "componentType":5126,
+ "count":1136,
+ "type":"VEC2"
+ },
+ {
+ "bufferView":3,
+ "componentType":5123,
+ "count":1620,
+ "type":"SCALAR"
+ }
+ ],
+ "bufferViews":[
+ {
+ "buffer":0,
+ "byteLength":13632,
+ "byteOffset":0,
+ "target":34962
+ },
+ {
+ "buffer":0,
+ "byteLength":13632,
+ "byteOffset":13632,
+ "target":34962
+ },
+ {
+ "buffer":0,
+ "byteLength":9088,
+ "byteOffset":27264,
+ "target":34962
+ },
+ {
+ "buffer":0,
+ "byteLength":3240,
+ "byteOffset":36352,
+ "target":34963
+ }
+ ],
+ "buffers":[
+ {
+ "byteLength":39592,
+ "uri":"pill.bin"
+ }
+ ]
+}
diff --git a/assets/models/plane.gltf b/assets/models/plane.gltf
index 6d9c6a5..d64b04b 100644
--- a/assets/models/plane.gltf
+++ b/assets/models/plane.gltf
@@ -18,19 +18,6 @@
"name":"Plane"
}
],
- "materials":[
- {
- "doubleSided":true,
- "name":"Material.001",
- "pbrMetallicRoughness":{
- "baseColorTexture":{
- "index":0
- },
- "metallicFactor":0,
- "roughnessFactor":0.5
- }
- }
- ],
"meshes":[
{
"name":"Plane",
@@ -42,24 +29,10 @@
"TEXCOORD_0":2
},
"indices":3,
- "material":0
}
]
}
],
- "textures":[
- {
- "sampler":0,
- "source":0
- }
- ],
- "images":[
- {
- "mimeType":"image/png",
- "name":"Untitled",
- "uri":"Untitled.png"
- }
- ],
"accessors":[
{
"bufferView":0,
@@ -122,12 +95,6 @@
"target":34963
}
],
- "samplers":[
- {
- "magFilter":9729,
- "minFilter":9987
- }
- ],
"buffers":[
{
"byteLength":140,
diff --git a/assets/models/plane.png b/assets/models/plane.png
deleted file mode 100644
index 9d5f6f4..0000000
--- a/assets/models/plane.png
+++ /dev/null
Binary files differ
diff --git a/assets/models/torus.gltf b/assets/models/torus.gltf
index 89f5103..1131513 100644
--- a/assets/models/torus.gltf
+++ b/assets/models/torus.gltf
@@ -18,19 +18,6 @@
"name":"Torus"
}
],
- "materials":[
- {
- "doubleSided":true,
- "name":"Material.001",
- "pbrMetallicRoughness":{
- "baseColorTexture":{
- "index":0
- },
- "metallicFactor":0,
- "roughnessFactor":0.5
- }
- }
- ],
"meshes":[
{
"name":"Torus",
@@ -42,24 +29,10 @@
"TEXCOORD_0":2
},
"indices":3,
- "material":0
}
]
}
],
- "textures":[
- {
- "sampler":0,
- "source":0
- }
- ],
- "images":[
- {
- "mimeType":"image/png",
- "name":"torus",
- "uri":"torus.png"
- }
- ],
"accessors":[
{
"bufferView":0,
@@ -122,12 +95,6 @@
"target":34963
}
],
- "samplers":[
- {
- "magFilter":9729,
- "minFilter":9987
- }
- ],
"buffers":[
{
"byteLength":80640,
diff --git a/assets/models/torus.png b/assets/models/torus.png
deleted file mode 100644
index 5955502..0000000
--- a/assets/models/torus.png
+++ /dev/null
Binary files differ
diff --git a/editor/editor.cpp b/editor/editor.cpp
index 4aa2c0c..e1c10d2 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -335,10 +335,14 @@ void PkeEditor_Tick(double delta) {
EntityType_Load(entityTypeToCreate);
+ /*
for (int64_t i = 0; i < entityTypeToCreate.detailsCount; ++i) {
- strncpy(newEntType->details[i].grBinds->collisionCallback.name, entityTypeToCreate.details[i].grBinds->collisionCallback.name, CallbackSignatureLength);
+ if (entityTypeToCreate.details[i].grBinds == nullptr) continue;
+ // strncpy(newEntType->details[i].grBinds->collisionCallback.name, entityTypeToCreate.createInstanceCallback.name, CallbackSignatureLength);
+ // newEntType->details[i].grBinds->collisionCallback.func = entityTypeToCreate.createInstanceCallback.func;
PkePlugin_SetSignatureFunc(&newEntType->details[i].grBinds->collisionCallback);
}
+ */
} else {
// TODO leaks entityTypeToCreate.entityTypeCode
}
@@ -1567,7 +1571,7 @@ void RecordImGuiModalCreateEntityType() {
ImGui::OpenPopup("CallbackSelect");
}
ImGui::SameLine();
- ImGui::Text("Collision Callback: '%s'", createInstanceSig);
+ ImGui::Text("Create Instance Callback: '%s'", createInstanceSig);
if (RecordImGui_CallbackSelectModal(index)) {
long x = 0;
memcpy(createInstanceSig, PkePlugin_GetSortedSignatures(x)[index], CallbackSignatureLength);
diff --git a/src/entities.hpp b/src/entities.hpp
index 7ce6757..4e3c17b 100644
--- a/src/entities.hpp
+++ b/src/entities.hpp
@@ -34,7 +34,8 @@ struct EntityType : public Entity_Base {
EntityTypeDetails details[EntityTypeDetails_MAX];
pk_ev_cb_id_T pke_ev_cb_id_framebuffer_resized;
PkeCallback createInstanceCallback;
- // PkeCallback serializeInstanceCallback; // TODO
+ // PkeCallback collisionCallback; // TODO
+ // PkeCallback serializeInstanceCallback; // TODO
// PkeCallback deserializeInstanceCallback; // TODO
};
struct EntityTypeHandle : pk_bkt_arr_handle {};