wip(0.S3): the packages migrated by ludic migrate state packages - every package test green
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1e8b5b0523
commit
07505e7ef2
294 changed files with 14996 additions and 14675 deletions
|
|
@ -10,25 +10,23 @@ export function char_stand_at(x: float, z: float, from_y: float) -> float {
|
|||
# A step up and a slope up are different refusals. Within CHAR_STEP of the feet is a step, taken
|
||||
# whatever the gradient into it (a 45 cm deck arrives in one frame); above that the boots decide,
|
||||
# measured over CHAR_SLOPE_PROBE, so the frame rate never changes the answer.
|
||||
export function char_slope_blocks(nh: float, fx: float, fz: float) -> bool {
|
||||
if nh - chr_y > CHAR_STEP { return true }
|
||||
let sx = chr_x + fx * CHAR_SLOPE_PROBE
|
||||
let sz = chr_z + fz * CHAR_SLOPE_PROBE
|
||||
return CharacterGround.height(sx, sz) - chr_y > CHAR_SLOPE_PROBE * CharacterGround.slope_limit()
|
||||
export function char_slope_blocks(character_st: CharacterState, nh: float, fx: float, fz: float) -> bool {
|
||||
if nh - character_st.chr_y > CHAR_STEP { return true }
|
||||
let sx = character_st.chr_x + fx * CHAR_SLOPE_PROBE
|
||||
let sz = character_st.chr_z + fz * CHAR_SLOPE_PROBE
|
||||
return CharacterGround.height(sx, sz) - character_st.chr_y > CHAR_SLOPE_PROBE * CharacterGround.slope_limit()
|
||||
}
|
||||
|
||||
# a body of radius r at (x, z) from y0 to y1, out of every collider: the resolved point is chr_out_*
|
||||
var chr_out_x: float = 0.0
|
||||
var chr_out_z: float = 0.0
|
||||
function chr_push(x: float, z: float, r: float, y0: float, y1: float) -> bool {
|
||||
chr_ask_x = x
|
||||
chr_ask_z = z
|
||||
function chr_push(character_st: mut CharacterState, x: float, z: float, r: float, y0: float, y1: float) -> bool {
|
||||
character_st.chr_ask_x = x
|
||||
character_st.chr_ask_z = z
|
||||
let hit = CharacterGround.push(x, z, r, y0, y1)
|
||||
chr_out_x = x
|
||||
chr_out_z = z
|
||||
character_st.chr_out_x = x
|
||||
character_st.chr_out_z = z
|
||||
if hit {
|
||||
chr_out_x = CharacterGround.pushed_x()
|
||||
chr_out_z = CharacterGround.pushed_z()
|
||||
character_st.chr_out_x = CharacterGround.pushed_x()
|
||||
character_st.chr_out_z = CharacterGround.pushed_z()
|
||||
}
|
||||
return hit
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue