Use proper real world scale for the car

This commit is contained in:
sergeypdev 2025-04-26 21:28:06 +04:00
parent 78ab4eeae9
commit c3945a80e5
8 changed files with 51 additions and 45 deletions

View File

@ -1,31 +1,31 @@
# Blender 4.3.2
# Blender 4.4.0
# www.blender.org
o Object_5
v -1.859343 0.407766 2.882677
v -1.496358 -0.439898 4.246497
v -1.532271 -0.014560 4.306011
v -1.458925 0.588598 4.098169
v -1.169193 1.844997 -0.020979
v -1.767808 0.808841 -2.967643
v -1.755688 0.019238 -3.954955
v 1.566465 -0.437912 4.228478
v -1.355442 0.201413 4.442485
v -1.527377 -0.513372 -3.070427
v -1.081991 -0.669592 2.507292
v 1.152275 -0.667651 2.498548
v -1.177522 1.915790 -2.273865
v -1.440784 1.165512 -4.710642
v -1.567565 0.052245 -5.155589
v 1.558806 0.207560 4.426651
v 1.597780 -0.511147 -3.072741
v 1.825968 0.019292 -3.954931
v 1.929686 0.407656 2.882679
v 1.529256 0.593033 4.083607
v 1.239481 1.844996 -0.020995
v 1.247809 1.915789 -2.273863
v 1.511068 1.165512 -4.710640
v 1.637697 0.053622 -5.155048
v 1.838094 0.808837 -2.967645
v -0.809354 0.177497 1.254802
v -0.651350 -0.191484 1.848460
v -0.666983 -0.006338 1.874366
v -0.635056 0.256211 1.783894
v -0.508939 0.803110 -0.009132
v -0.769510 0.352081 -1.291787
v -0.764234 0.008374 -1.721554
v 0.681867 -0.190619 1.840616
v -0.590011 0.087673 1.933771
v -0.664853 -0.223466 -1.336528
v -0.470980 -0.291467 1.091400
v 0.501574 -0.290622 1.087594
v -0.512564 0.833925 -0.989792
v -0.627160 0.507336 -2.050498
v -0.682346 0.022742 -2.244179
v 0.678533 0.090349 1.926879
v 0.695498 -0.222497 -1.337535
v 0.794826 0.008397 -1.721544
v 0.839974 0.177449 1.254803
v 0.665671 0.258142 1.777555
v 0.539534 0.803109 -0.009139
v 0.543159 0.833925 -0.989791
v 0.657754 0.507336 -2.050497
v 0.712874 0.023341 -2.243943
v 0.800105 0.352079 -1.291788
s 0
f 1 2 3
f 1 3 4

BIN
assets/toyota_corolla_ae86_trueno.glb (Stored with Git LFS)

Binary file not shown.

View File

@ -322,23 +322,23 @@ update_runtime_world :: proc(runtime_world: ^Runtime_World, dt: f32) {
sim_state := physics.get_sim_state(&world.physics_scene)
// 1.6 is a good value
wheel_extent_x := f32(1.7)
wheel_y := f32(-0.5)
wheel_extent_x_front := f32(1.355) / 2
wheel_extent_x_back := f32(1.345) / 2
wheel_y := f32(-0.1)
rest := f32(1)
natural_frequency := f32(0.35)
damping := f32(0.07)
radius := f32(0.6)
wheel_front_z := f32(3.05)
wheel_back_z := f32(-2.45)
wheel_mass := f32(12)
radius := f32(0.2888)
wheel_front_z := f32(1.3)
wheel_back_z := f32(-1.1)
wheel_mass := f32(30)
wheel_fl := physics.immediate_suspension_constraint(
&world.physics_scene,
&runtime_world.solver_state,
#hash("FL", "fnv32a"),
{
rel_pos = {-wheel_extent_x, wheel_y, wheel_front_z},
rel_pos = {-wheel_extent_x_front, wheel_y, wheel_front_z},
rel_dir = {0, -1, 0},
radius = radius,
rest = rest,
@ -353,7 +353,7 @@ update_runtime_world :: proc(runtime_world: ^Runtime_World, dt: f32) {
&runtime_world.solver_state,
#hash("FR", "fnv32a"),
{
rel_pos = {wheel_extent_x, wheel_y, wheel_front_z},
rel_pos = {wheel_extent_x_front, wheel_y, wheel_front_z},
rel_dir = {0, -1, 0},
radius = radius,
rest = rest,
@ -368,7 +368,7 @@ update_runtime_world :: proc(runtime_world: ^Runtime_World, dt: f32) {
&runtime_world.solver_state,
#hash("RL", "fnv32a"),
{
rel_pos = {-wheel_extent_x, wheel_y, wheel_back_z},
rel_pos = {-wheel_extent_x_back, wheel_y, wheel_back_z},
rel_dir = {0, -1, 0},
radius = radius,
rest = rest,
@ -383,7 +383,7 @@ update_runtime_world :: proc(runtime_world: ^Runtime_World, dt: f32) {
&runtime_world.solver_state,
#hash("RR", "fnv32a"),
{
rel_pos = {wheel_extent_x, wheel_y, wheel_back_z},
rel_pos = {wheel_extent_x_back, wheel_y, wheel_back_z},
rel_dir = {0, -1, 0},
radius = radius,
rest = rest,
@ -1093,7 +1093,7 @@ game_memory_size :: proc() -> int {
game_hot_reloaded :: proc(mem: rawptr) {
g_mem = (^Game_Memory)(mem)
g_mem.runtime_world.orbit_camera.distance = 10
g_mem.runtime_world.orbit_camera.distance = 4
}
@(export)

View File

@ -514,7 +514,7 @@ pgs_solve_engines :: proc(sim_state: ^Sim_State, config: Solver_Config, dt: f32,
friction :=
math.pow(
max(engine.w - rpm_to_angular_velocity(engine.lowest_rpm), 0) * 0.001,
max(engine.w - rpm_to_angular_velocity(engine.lowest_rpm), 0) * 0.002,
4,
) *
engine.internal_friction +

BIN
src_assets/ae86.blend (Stored with Git LFS) Normal file

Binary file not shown.

BIN
src_assets/ae86.blend1 (Stored with Git LFS) Normal file

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.