diff --git a/file_read/file.blend b/file_read/file.blend index 27822d6..86cbee5 100644 Binary files a/file_read/file.blend and b/file_read/file.blend differ diff --git a/mesh_generate/Sources/arm/BoxGenerator.hx b/mesh_generate/Sources/arm/BoxGenerator.hx index 69580d5..20e311e 100644 --- a/mesh_generate/Sources/arm/BoxGenerator.hx +++ b/mesh_generate/Sources/arm/BoxGenerator.hx @@ -48,15 +48,15 @@ class BoxGenerator extends iron.Trait { var posI16 = new Int16Array(numVertices * 4); // pos.xyz, nor.z var norI16 = new Int16Array(numVertices * 2); // nor.xy toI16(posI16, norI16, positions, normals); - + var indU32 = new Uint32Array(indices.length); toU32(indU32, indices); - var pos:TVertexArray = { attrib: "pos", values: posI16 }; - var nor:TVertexArray = { attrib: "nor", values: norI16 }; + var pos:TVertexArray = { attrib: "pos", values: posI16, data: "short4norm" }; + var nor:TVertexArray = { attrib: "nor", values: norI16, data: "short2norm" }; var ind:TIndexArray = { material: 0, values: indU32 }; - var rawmeshData:TMeshData = { + var rawmeshData:TMeshData = { name: "BoxMesh", vertex_arrays: [pos, nor], index_arrays: [ind], @@ -68,7 +68,7 @@ class BoxGenerator extends iron.Trait { // Mesh data parsed meshData = data; meshData.geom.calculateAABB(); - + // Fetch material from scene data Data.getMaterial("Scene", "Material", function(data:MaterialData) { // Material loaded @@ -84,7 +84,7 @@ class BoxGenerator extends iron.Trait { if (mouse.started()) { // Create new object in active scene var object = Scene.active.addMeshObject(meshData, materials); - + // Just for testing, add rigid body trait var aabb = meshData.geom.aabb; object.transform.loc.set(Math.random() * 8 - 4, Math.random() * 8 - 4, 5); diff --git a/mesh_import/Sources/arm/ImportMesh.hx b/mesh_import/Sources/arm/ImportMesh.hx index 2a02c05..c846c48 100644 --- a/mesh_import/Sources/arm/ImportMesh.hx +++ b/mesh_import/Sources/arm/ImportMesh.hx @@ -22,8 +22,8 @@ class ImportMesh extends iron.Trait { var mesh = new ObjParser(blob); // Positions, normals and indices - var pos:TVertexArray = { attrib: "pos", values: mesh.posa }; - var nor:TVertexArray = { attrib: "nor", values: mesh.nora }; + var pos:TVertexArray = { attrib: "pos", values: mesh.posa, data: "short4norm" }; + var nor:TVertexArray = { attrib: "nor", values: mesh.nora, data: "short2norm" }; var ind:TIndexArray = { material: 0, values: mesh.inda }; var rawmeshData:TMeshData = { diff --git a/screen_image/Sources/arm/MyTrait.hx b/screen_image/Sources/arm/MyTrait.hx index 9b23986..7a79bee 100644 --- a/screen_image/Sources/arm/MyTrait.hx +++ b/screen_image/Sources/arm/MyTrait.hx @@ -11,9 +11,9 @@ class MyTrait extends iron.Trait { // Access final composited image that is afterwards drawn to the screen var image = RenderPathCreator.finalTarget.image; - + g.color = 0xffffffff; - if (image.g4.renderTargetsInvertedY()) { + if (kha.Image.renderTargetsInvertedY()) { g.drawScaledImage(image, 0, image.height / 5, image.width / 5, -image.height / 5); } else {