[gameplay] fix disappearing boulders (#1252)

* fix disappearing boulders

* format'
This commit is contained in:
water111
2022-03-25 21:24:18 -04:00
committed by GitHub
parent 8d4d251bec
commit be0075a4e4
2 changed files with 12 additions and 2 deletions
-2
View File
@@ -247,8 +247,6 @@ void input_mode_pad_set(s64 idx) {
********************************
*/
void check_gamepad() {
if (g_gamepads.gamepad_idx == -1) {
for (int i = GLFW_JOYSTICK_1; i <= GLFW_JOYSTICK_LAST; i++) {
+12
View File
@@ -49,6 +49,18 @@
(init-vf0-vector)
(.lvf vf2 (&-> (-> arg1 bone) transform vector 3 quad))
(.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11)
;; ADDED
;; there's a bug in swamp-blimp where they vector<-cspace!
;; on some default-initialized-to-zero bones
;; we have to return 0s for this to avoid NaNs getting everywhere.
(let ((temp (new-stack-vector0)))
(.svf (&-> temp quad) vf2)
(when (= (-> temp w) 0.0)
(set-vector! arg0 0. 0. 0. 1.)
(return arg0)
)
)
(.wait.vf)
(.mul.vf vf2 vf2 Q :mask #b111)
(.nop.vf)