Better collision match

This commit is contained in:
sergeypdev 2025-06-28 18:01:12 +04:00
parent 1094afac02
commit 973cdb9506
5 changed files with 64 additions and 9 deletions

View File

@ -0,0 +1,18 @@
# Blender 4.4.3
# www.blender.org
o BodyHigh_Col
v 1.049841 1.503469 1.709093
v 1.049841 1.503469 -3.470500
v -1.049841 1.503469 1.709093
v -1.049841 1.503469 -3.470500
v 1.049841 2.742037 1.438413
v 1.049841 2.742037 -3.470500
v -1.049841 2.742037 1.438413
v -1.049841 2.742037 -3.470500
s 0
f 2 1 3 4
f 6 8 7 5
f 4 3 7 8
f 3 1 5 7
f 2 4 8 6
f 1 2 6 5

View File

@ -0,0 +1,21 @@
# Blender 4.4.3
# www.blender.org
o BodyLow_Col
v 1.049841 0.369559 2.380744
v 1.049841 1.130518 2.380744
v 1.049841 1.503469 1.709093
v 1.049841 0.356804 -3.483506
v 1.049841 1.503469 -3.470500
v -1.049841 0.369559 2.380744
v -1.049841 1.130518 2.380744
v -1.049841 1.503469 1.709093
v -1.049841 0.356804 -3.483506
v -1.049841 1.503469 -3.470500
s 0
f 1 6 9 4
f 3 2 1 4 5
f 6 1 2 7
f 4 9 10 5
f 5 10 8 3
f 8 10 9 6 7
f 8 7 2 3

View File

@ -401,7 +401,14 @@ update_world :: proc(world: ^World, dt: f32, config: World_Update_Config) {
)
}
car_convex := assets.get_convex(&g_mem.assetman, "assets/ice_cream_truck_convex.obj")
body_low_convex := assets.get_convex(
&g_mem.assetman,
"assets/ice_cream_truck_body_low_convex.obj",
)
body_high_convex := assets.get_convex(
&g_mem.assetman,
"assets/ice_cream_truck_body_high_convex.obj",
)
cone_convex := assets.get_convex(&g_mem.assetman, "assets/cone_convex.obj")
left_fence_convex := assets.get_convex(&g_mem.assetman, "assets/left_fence_convex.obj")
right_fence_convex := assets.get_convex(&g_mem.assetman, "assets/right_fence_convex.obj")
@ -423,10 +430,19 @@ update_world :: proc(world: ^World, dt: f32, config: World_Update_Config) {
{
rel_q = linalg.QUATERNIONF32_IDENTITY,
inner_shape = physics.Shape_Convex {
mesh = car_convex.mesh,
center_of_mass = car_convex.center_of_mass,
inertia_tensor = auto_cast car_convex.inertia_tensor,
total_volume = car_convex.total_volume,
mesh = body_low_convex.mesh,
center_of_mass = body_low_convex.center_of_mass,
inertia_tensor = auto_cast body_low_convex.inertia_tensor,
total_volume = body_low_convex.total_volume,
},
},
{
rel_q = linalg.QUATERNIONF32_IDENTITY,
inner_shape = physics.Shape_Convex {
mesh = body_high_convex.mesh,
center_of_mass = body_high_convex.center_of_mass,
inertia_tensor = auto_cast body_high_convex.inertia_tensor,
total_volume = body_high_convex.total_volume,
},
},
{

BIN
src_assets/ice_cream_truck.blend (Stored with Git LFS)

Binary file not shown.

BIN
src_assets/ice_cream_truck.blend1 (Stored with Git LFS)

Binary file not shown.