From 864976bd5bf9582f32f830231f25b467b8ddabd2 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 21 Mar 2024 23:25:18 -0700 Subject: [PATCH] vehicle: add level boundaries --- examples/vehicle/data/ground.bin | Bin 0 -> 652 bytes examples/vehicle/data/ground.glb | Bin 1300 -> 0 bytes examples/vehicle/data/ground.gltf | 480 ++++++++++++++++++++ examples/vehicle/data/level.ron | 41 +- examples/vehicle/data/orange_light_grid.png | Bin 0 -> 6738 bytes 5 files changed, 518 insertions(+), 3 deletions(-) create mode 100644 examples/vehicle/data/ground.bin delete mode 100644 examples/vehicle/data/ground.glb create mode 100644 examples/vehicle/data/ground.gltf create mode 100755 examples/vehicle/data/orange_light_grid.png diff --git a/examples/vehicle/data/ground.bin b/examples/vehicle/data/ground.bin new file mode 100644 index 0000000000000000000000000000000000000000..8c115d777057587d2ef2862e6c0ec33d2e337086 GIT binary patch literal 652 zcma)0K@Na0466FDeXT$9YXT0kgBnSeQ3`BTeU{LpiiZ%ljyt+F`kKzUYth^H!q8PFB((k=;)^SI-HWNy(!}vN2Clw+^K_v<*lu||okzAkveOn36 zc+p7#(z(qkOQ`4!KZTvGYk5`|BNJ_@C^F6<*|9L%nW%`N019xkDp0Vf5F=~wp_z`E zi1CD~0Djs%9jpqiX|dAKCjTKPP)k)JIp7zzXF0BG-{3CxUAO1n_~xrznr2NT6&cCv z9VNVsayrWrnxH_6lEOafO^%y93u7C&H<1`qN%B04r@Ty8j22L#LJ=wGfahG?lUS>@ zz*Z0I%eH+7`;KqE#$$s5>xQ5$1>%X8YwxqVJEfM=NQ<{uwN+^&vUMi2Z4)I@iYzLn zGAr~D&W7`0IMMRX@4gShaQfv3MuBajNjM$%M<{S$d>Ko!SV3H%YLo!XPD@B)2o+q^ z5=P~6NyTGEf9j$!UvD_0OwOM-Fs!caT$?E7C4*z-sbas>1Wjz}jx#tiiz{VbDO+j` zdb}IBaEL(NquQ{;|I|L9oinua2J|^MsBq4$ow_gRu;HE!`lJ37sRh!1Lt~JkHl# diff --git a/examples/vehicle/data/ground.gltf b/examples/vehicle/data/ground.gltf new file mode 100644 index 00000000..d830dd6e --- /dev/null +++ b/examples/vehicle/data/ground.gltf @@ -0,0 +1,480 @@ +{ + "asset":{ + "generator":"Khronos glTF Blender I/O v4.0.44", + "version":"2.0" + }, + "scene":0, + "scenes":[ + { + "name":"Scene", + "nodes":[ + 0, + 1, + 2, + 3, + 4 + ] + } + ], + "nodes":[ + { + "mesh":0, + "name":"Plane", + "scale":[ + 20, + 20, + 20 + ] + }, + { + "mesh":1, + "name":"Plane.001", + "rotation":[ + 0, + 0, + -0.7071068286895752, + 0.7071068286895752 + ], + "scale":[ + 1, + 1, + 20 + ], + "translation":[ + 20, + 1, + 0 + ] + }, + { + "mesh":2, + "name":"Plane.002", + "rotation":[ + 0, + 0, + -0.7071068286895752, + 0.7071068286895752 + ], + "scale":[ + 1, + 1, + 20 + ], + "translation":[ + -20, + 1, + 0 + ] + }, + { + "mesh":3, + "name":"Plane.003", + "rotation":[ + -0.5, + 0.5, + -0.5, + 0.5 + ], + "scale":[ + 1, + 1, + 20 + ], + "translation":[ + 0, + 1, + -20 + ] + }, + { + "mesh":4, + "name":"Plane.004", + "rotation":[ + -0.5, + 0.5, + -0.5, + 0.5 + ], + "scale":[ + 1, + 1, + 20 + ], + "translation":[ + 0, + 1, + 20 + ] + } + ], + "materials":[ + { + "doubleSided":true, + "name":"Material.001", + "pbrMetallicRoughness":{ + "baseColorTexture":{ + "index":0 + }, + "metallicFactor":0, + "roughnessFactor":0.5 + } + }, + { + "doubleSided":true, + "name":"Material.002", + "pbrMetallicRoughness":{ + "baseColorFactor":[ + 0.800000011920929, + 0.800000011920929, + 0.800000011920929, + 1 + ], + "metallicFactor":0, + "roughnessFactor":0.5 + } + } + ], + "meshes":[ + { + "name":"Plane", + "primitives":[ + { + "attributes":{ + "POSITION":0, + "NORMAL":1, + "TEXCOORD_0":2 + }, + "indices":3, + "material":0 + } + ] + }, + { + "name":"Plane.001", + "primitives":[ + { + "attributes":{ + "POSITION":4, + "NORMAL":5, + "TEXCOORD_0":6 + }, + "indices":3, + "material":1 + } + ] + }, + { + "name":"Plane.002", + "primitives":[ + { + "attributes":{ + "POSITION":7, + "NORMAL":8, + "TEXCOORD_0":9 + }, + "indices":3, + "material":1 + } + ] + }, + { + "name":"Plane.003", + "primitives":[ + { + "attributes":{ + "POSITION":10, + "NORMAL":11, + "TEXCOORD_0":12 + }, + "indices":3, + "material":1 + } + ] + }, + { + "name":"Plane.004", + "primitives":[ + { + "attributes":{ + "POSITION":13, + "NORMAL":14, + "TEXCOORD_0":15 + }, + "indices":3, + "material":1 + } + ] + } + ], + "textures":[ + { + "sampler":0, + "source":0 + } + ], + "images":[ + { + "mimeType":"image/png", + "name":"orange_light_grid", + "uri":"orange_light_grid.png" + } + ], + "accessors":[ + { + "bufferView":0, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "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" + }, + { + "bufferView":4, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":5, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":6, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":7, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":8, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":9, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":10, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":11, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":12, + "componentType":5126, + "count":4, + "type":"VEC2" + }, + { + "bufferView":13, + "componentType":5126, + "count":4, + "max":[ + 1, + 0, + 1 + ], + "min":[ + -1, + 0, + -1 + ], + "type":"VEC3" + }, + { + "bufferView":14, + "componentType":5126, + "count":4, + "type":"VEC3" + }, + { + "bufferView":15, + "componentType":5126, + "count":4, + "type":"VEC2" + } + ], + "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 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":140, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":188, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":236, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":268, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":316, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":364, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":396, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":444, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":492, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":524, + "target":34962 + }, + { + "buffer":0, + "byteLength":48, + "byteOffset":572, + "target":34962 + }, + { + "buffer":0, + "byteLength":32, + "byteOffset":620, + "target":34962 + } + ], + "samplers":[ + { + "magFilter":9729, + "minFilter":9987 + } + ], + "buffers":[ + { + "byteLength":652, + "uri":"ground.bin" + } + ] +} diff --git a/examples/vehicle/data/level.ron b/examples/vehicle/data/level.ron index d6115618..12df5567 100644 --- a/examples/vehicle/data/level.ron +++ b/examples/vehicle/data/level.ron @@ -7,9 +7,8 @@ name: "ground", visuals: [ ( - model: "ground.glb", + model: "ground.gltf", pos: (0, 1, 0), - scale: 60, ), ], colliders: [ @@ -17,9 +16,45 @@ density: 1.0, friction: 1.0, shape: Cuboid( - half: (1000, 1.0, 1000), + half: (20, 1, 20), ), ), + ( + density: 1.0, + friction: 1.0, + shape: Cuboid( + half: (20, 1, 1), + ), + pos: (21, 2, 0), + rot: (0, 90, 0), + ), + ( + density: 1.0, + friction: 1.0, + shape: Cuboid( + half: (20, 1, 1), + ), + pos: (-21, 2, 0), + rot: (0, 90, 0), + ), + ( + density: 1.0, + friction: 1.0, + shape: Cuboid( + half: (20, 1, 1), + ), + pos: (0, 2, 21), + rot: (0, 0, 0), + ), + ( + density: 1.0, + friction: 1.0, + shape: Cuboid( + half: (20, 1, 1), + ), + pos: (0, 2, -21), + rot: (0, 0, 0), + ), ], ), ) diff --git a/examples/vehicle/data/orange_light_grid.png b/examples/vehicle/data/orange_light_grid.png new file mode 100755 index 0000000000000000000000000000000000000000..adcd3bb555eaf915557626cc7d68b8847e89f8e3 GIT binary patch literal 6738 zcmeAS@N?(olHy`uVBq!ia0y~yU;#2&7&zE~RK2WrGmzpe@Q5sCVBi)8VMc~ob0mO* zjKx9jP7LeL$-D%qPj~cnWMJ6X&;2Knm4QL>xu=U`NCo5DTe|CBC5Sj&{B+18Kw^@X zNpqr5Pm|`tKwpE(~K;&rt7|kDp zH!*D3eSh8it^AKa8i3Mj{cTXiVFqFEky+^&_mtQ2?<=v%_e1049UcvJsRSMk`84TT}rQ7NaG@ z@GTh*ysO*2@46kRa{>f^axd>$v+p*DNw9)p0jYv^Y>xjdvg18qW;1X7)$-4Lw^RQu z1a@$)o9N4@OM_I6mMNf67%fvq%M@TL7%feQZ)w^9%I1SJpBo(b#tCxVK$XRB-fe$f z{q}H$4G+)}2kx7lJ^gAoFUUb0SUN9|x&>LH;qUjO6*e_<^q*g5$TNzi0Wv&R z;`{ki;Wo^1GzF09qq%J~w*iyEK&AT88gDcY4$=x?a8^@9x(YN$^7yAzL+*@csSLBu z*q6+#f6$IuoiyD2TUN^tOo9iN-2{>hsGXW0{4>pBAAE1vegGur>FVdQ&MBb@0098M A6951J literal 0 HcmV?d00001