before the storm
[carveJwlIkooP6JGAAIwe30JlM.git] / player_model.h
index 652753c81d71a23335f7c13dd2d65381a169b26c..1673581a98aedb719d7c9dcc455328281d9202bb 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * Copyright 2021-2022 (C) Mount0 Software, Harry Godden - All Rights Reserved
+ */
+
 #ifndef CHARACTER_H 
 #define CHARACTER_H
 
@@ -10,6 +14,9 @@
 #include "skeleton_animator.h"
 #include "shaders/viewchar.h"
 
+static float k_ragdoll_floatyiness = 10.0f,
+             k_ragdoll_floatydrag  = 1.0f;
+
 vg_tex2d tex_characters = { .path = "textures/ch_gradient.qoi" };
 
 static void character_register(void)
@@ -239,6 +246,10 @@ static void character_ragdoll_iter( struct character *ch )
             rb_debug_constraint_limits( &pj->rb, &pp->rb, lca, pj->limits );
          }
       }
+
+      v4f plane = {0.0f,1.0f,0.0f,0.0f};
+      rb_effect_simple_bouyency( &pj->rb, plane, k_ragdoll_floatyiness,
+                                                 k_ragdoll_floatydrag );
    }
 
    /* CONSTRAINTS */