fix(ludic.physics): a hull owns its box, so a boat called and sent away takes its shape with it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5cd53d4024
commit
364888bcc9
1 changed files with 3 additions and 1 deletions
|
|
@ -3,8 +3,10 @@
|
|||
|
||||
# hx, hy, hz its half width, depth and length; buoyancy over 1 floats it (4: a quarter under)
|
||||
export function phys_hull_add(physics_st: mut PhysicsState, x: float, y: float, z: float, yaw: float, hx: float, hy: float, hz: float, mass: float, buoyancy: float, drag: float) -> int {
|
||||
let id = phys_body_add(physics_st, phys_box(physics_st, hx, hy, hz), x, y, z, yaw, mass)
|
||||
let s = phys_box(physics_st, hx, hy, hz)
|
||||
let id = phys_body_add(physics_st, s, x, y, z, yaw, mass)
|
||||
if id < 0 { return -1 }
|
||||
phys_own(physics_st, id, s)
|
||||
phys_float(physics_st, id, buoyancy, drag, drag * 1.5)
|
||||
return id
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue