AR: add armor

This commit is contained in:
yuni 2024-10-11 05:12:38 +02:00
parent 811254e885
commit 72a81701e0
5 changed files with 609 additions and 0 deletions

BIN
assets/models/ar_armor.bin Normal file

Binary file not shown.

606
assets/models/ar_armor.gltf Normal file
View file

@ -0,0 +1,606 @@
{
"asset":{
"generator":"Khronos glTF Blender I/O v4.2.60",
"version":"2.0"
},
"scene":0,
"scenes":[
{
"name":"Scene",
"nodes":[
0,
1,
2,
3,
4,
5
]
}
],
"nodes":[
{
"mesh":0,
"name":"Cube",
"rotation":[
0.25769245624542236,
0,
0,
0.9662269949913025
],
"scale":[
0.46655866503715515,
0.5073187947273254,
0.03966343775391579
],
"translation":[
0,
0.12805390357971191,
-0.07347531616687775
]
},
{
"mesh":1,
"name":"Cube.002",
"rotation":[
0.2845572531223297,
0,
0,
0.9586590528488159
],
"scale":[
0.7689772248268127,
1,
0.5661381483078003
],
"translation":[
0.000524396076798439,
0.38582590222358704,
-0.22804374992847443
]
},
{
"mesh":2,
"name":"Cube.003",
"rotation":[
-0.012826149351894855,
0.09296344220638275,
-0.10715894401073456,
0.9898032546043396
],
"scale":[
0.5503033399581909,
0.06932250410318375,
0.5503033399581909
],
"translation":[
-0.03494972735643387,
0.09079104661941528,
0.2756086587905884
]
},
{
"mesh":3,
"name":"Cube.004",
"rotation":[
-0.012826149351894855,
0.09296344220638275,
-0.10715894401073456,
0.9898032546043396
],
"scale":[
0.5503033399581909,
0.06932250410318375,
0.5503033399581909
],
"translation":[
-0.03178083524107933,
-0.5902829170227051,
-0.02679361030459404
]
},
{
"mesh":4,
"name":"Cube.006",
"rotation":[
0.8040924668312073,
0.04474826529622078,
-0.36057648062705994,
0.47055017948150635
],
"scale":[
0.07814773917198181,
0.18444180488586426,
0.056227050721645355
],
"translation":[
-0.22010107338428497,
0.7045252919197083,
-0.28960752487182617
]
},
{
"mesh":5,
"name":"Cube.007",
"rotation":[
0.7425503134727478,
0.17952792346477509,
-0.25490692257881165,
0.5927994847297668
],
"scale":[
0.07814773917198181,
0.18444180488586426,
0.056227050721645355
],
"translation":[
-0.2668684124946594,
0.5790677070617676,
-0.3047392666339874
]
}
],
"materials":[
{
"doubleSided":true,
"name":"Armor",
"pbrMetallicRoughness":{
"baseColorTexture":{
"index":0
},
"metallicFactor":0.7539682388305664,
"roughnessFactor":0.1428571492433548
}
}
],
"meshes":[
{
"name":"Mesh",
"primitives":[
{
"attributes":{
"POSITION":0,
"NORMAL":1,
"TEXCOORD_0":2
},
"indices":3,
"material":0
}
]
},
{
"name":"Mesh",
"primitives":[
{
"attributes":{
"POSITION":4,
"NORMAL":5,
"TEXCOORD_0":6
},
"indices":7,
"material":0
}
]
},
{
"name":"Mesh",
"primitives":[
{
"attributes":{
"POSITION":8,
"NORMAL":9,
"TEXCOORD_0":10
},
"indices":11,
"material":0
}
]
},
{
"name":"Mesh",
"primitives":[
{
"attributes":{
"POSITION":12,
"NORMAL":13,
"TEXCOORD_0":14
},
"indices":15,
"material":0
}
]
},
{
"name":"Cube.007",
"primitives":[
{
"attributes":{
"POSITION":16,
"NORMAL":17,
"TEXCOORD_0":18
},
"indices":19,
"material":0
}
]
},
{
"name":"Cube.007",
"primitives":[
{
"attributes":{
"POSITION":20,
"NORMAL":21,
"TEXCOORD_0":22
},
"indices":19,
"material":0
}
]
}
],
"textures":[
{
"sampler":0,
"source":0
}
],
"images":[
{
"mimeType":"image/jpeg",
"name":"metal",
"uri":"textures/metal.jpg"
}
],
"accessors":[
{
"bufferView":0,
"componentType":5126,
"count":628,
"max":[
0.39057183265686035,
0.46193966269493103,
2.447216033935547
],
"min":[
-0.39057183265686035,
-0.7029863595962524,
-2.0742721557617188
],
"type":"VEC3"
},
{
"bufferView":1,
"componentType":5126,
"count":628,
"type":"VEC3"
},
{
"bufferView":2,
"componentType":5126,
"count":628,
"type":"VEC2"
},
{
"bufferView":3,
"componentType":5123,
"count":3264,
"type":"SCALAR"
},
{
"bufferView":4,
"componentType":5126,
"count":1158,
"max":[
0.33404797315597534,
0.419356107711792,
0.758513867855072
],
"min":[
-0.33404797315597534,
-0.29581165313720703,
-0.2609223425388336
],
"type":"VEC3"
},
{
"bufferView":5,
"componentType":5126,
"count":1158,
"type":"VEC3"
},
{
"bufferView":6,
"componentType":5126,
"count":1158,
"type":"VEC2"
},
{
"bufferView":7,
"componentType":5123,
"count":6144,
"type":"SCALAR"
},
{
"bufferView":8,
"componentType":5126,
"count":974,
"max":[
0.7869077324867249,
9.922114372253418,
-0.03668821603059769
],
"min":[
-0.7620211839675903,
2.062697410583496,
-0.8380033373832703
],
"type":"VEC3"
},
{
"bufferView":9,
"componentType":5126,
"count":974,
"type":"VEC3"
},
{
"bufferView":10,
"componentType":5126,
"count":974,
"type":"VEC2"
},
{
"bufferView":11,
"componentType":5123,
"count":4704,
"type":"SCALAR"
},
{
"bufferView":12,
"componentType":5126,
"count":1250,
"max":[
0.6221739053726196,
14.399925231933594,
-0.043152984231710434
],
"min":[
-0.7038323879241943,
4.562234401702881,
-0.8317314386367798
],
"type":"VEC3"
},
{
"bufferView":13,
"componentType":5126,
"count":1250,
"type":"VEC3"
},
{
"bufferView":14,
"componentType":5126,
"count":1250,
"type":"VEC2"
},
{
"bufferView":15,
"componentType":5123,
"count":6240,
"type":"SCALAR"
},
{
"bufferView":16,
"componentType":5126,
"count":572,
"max":[
6.174130439758301,
1.725797414779663,
0.7335540056228638
],
"min":[
-0.42674580216407776,
-1.166419506072998,
-5.6789445877075195
],
"type":"VEC3"
},
{
"bufferView":17,
"componentType":5126,
"count":572,
"type":"VEC3"
},
{
"bufferView":18,
"componentType":5126,
"count":572,
"type":"VEC2"
},
{
"bufferView":19,
"componentType":5123,
"count":3072,
"type":"SCALAR"
},
{
"bufferView":20,
"componentType":5126,
"count":572,
"max":[
8.145783424377441,
2.122046947479248,
0.7335540056228638
],
"min":[
-0.42674580216407776,
-1.166419506072998,
-2.2426273822784424
],
"type":"VEC3"
},
{
"bufferView":21,
"componentType":5126,
"count":572,
"type":"VEC3"
},
{
"bufferView":22,
"componentType":5126,
"count":572,
"type":"VEC2"
}
],
"bufferViews":[
{
"buffer":0,
"byteLength":7536,
"byteOffset":0,
"target":34962
},
{
"buffer":0,
"byteLength":7536,
"byteOffset":7536,
"target":34962
},
{
"buffer":0,
"byteLength":5024,
"byteOffset":15072,
"target":34962
},
{
"buffer":0,
"byteLength":6528,
"byteOffset":20096,
"target":34963
},
{
"buffer":0,
"byteLength":13896,
"byteOffset":26624,
"target":34962
},
{
"buffer":0,
"byteLength":13896,
"byteOffset":40520,
"target":34962
},
{
"buffer":0,
"byteLength":9264,
"byteOffset":54416,
"target":34962
},
{
"buffer":0,
"byteLength":12288,
"byteOffset":63680,
"target":34963
},
{
"buffer":0,
"byteLength":11688,
"byteOffset":75968,
"target":34962
},
{
"buffer":0,
"byteLength":11688,
"byteOffset":87656,
"target":34962
},
{
"buffer":0,
"byteLength":7792,
"byteOffset":99344,
"target":34962
},
{
"buffer":0,
"byteLength":9408,
"byteOffset":107136,
"target":34963
},
{
"buffer":0,
"byteLength":15000,
"byteOffset":116544,
"target":34962
},
{
"buffer":0,
"byteLength":15000,
"byteOffset":131544,
"target":34962
},
{
"buffer":0,
"byteLength":10000,
"byteOffset":146544,
"target":34962
},
{
"buffer":0,
"byteLength":12480,
"byteOffset":156544,
"target":34963
},
{
"buffer":0,
"byteLength":6864,
"byteOffset":169024,
"target":34962
},
{
"buffer":0,
"byteLength":6864,
"byteOffset":175888,
"target":34962
},
{
"buffer":0,
"byteLength":4576,
"byteOffset":182752,
"target":34962
},
{
"buffer":0,
"byteLength":6144,
"byteOffset":187328,
"target":34963
},
{
"buffer":0,
"byteLength":6864,
"byteOffset":193472,
"target":34962
},
{
"buffer":0,
"byteLength":6864,
"byteOffset":200336,
"target":34962
},
{
"buffer":0,
"byteLength":4576,
"byteOffset":207200,
"target":34962
}
],
"samplers":[
{
"magFilter":9729,
"minFilter":9987
}
],
"buffers":[
{
"byteLength":211776,
"uri":"ar_armor.bin"
}
]
}

BIN
src/blender/ar_armor.blend Normal file

Binary file not shown.

View file

@ -52,6 +52,7 @@ pub const PLAYER_AR_AVATARS: &[(Avatar, &str, f32, &str)] = &[
(Avatar::Nekomimi, "suit_ar_nekomimi", 1.0, "Cat Ears"),
(Avatar::Wings, "suit_ar_wings", 1.0, "Wings"),
(Avatar::Bra, "suit_ar_bra", 1.0, "Bra"),
(Avatar::Armor, "suit_ar_armor", 1.0, "Armor"),
(Avatar::Asteroid, "metis", 1.3, "Asteroid"),
];
@ -188,6 +189,7 @@ pub enum Avatar {
Wings,
Asteroid,
Bra,
Armor,
}
pub enum LogLevel {

View file

@ -29,6 +29,7 @@ impl Plugin for LoadPlugin {
pub fn asset_name_to_path(name: &str) -> &'static str {
match name {
"suitv2" => "models/suit_v2.gltf#Scene0",
"suit_ar_armor" => "models/ar_armor.gltf#Scene0",
"suit_ar_bra" => "models/ar_bra.gltf#Scene0",
"suit_ar_chefhat" => "models/suit_v2/ar_chefhat.glb#Scene0",
"suit_ar_nekomimi" => "models/ar_nekomimi.gltf#Scene0",