* qu3e - Randy Gaul
*/
+#include "vg/vg.h"
+static void rb_tangent_basis( v3f n, v3f tx, v3f ty );
+
#ifndef RIGIDBODY_H
#define RIGIDBODY_H
#define RB_DEPR
-#include "vg/vg.h"
-#include "scene.h"
+#include "world.h"
#define k_rb_delta (1.0f/60.0f)
v3_cross( n, tx, ty );
}
-static void rb_build_manifold( rigidbody *rb, scene *sc )
+static void rb_build_manifold( rigidbody *rb )
{
v3f *box = rb->bbx;
v3f pts[8];
struct contact *ct = &rb->manifold[rb->manifold_count];
v3f surface;
-
v3_copy( point, surface );
+ surface[1] += 4.0f;
ray_hit hit;
- bvh_scene_sample( sc, surface, &hit );
+ hit.dist = INFINITY;
+ if( !ray_world( surface, (v3f){0.0f,-1.0f,0.0f}, &hit ))
+ continue;
+
v3_copy( hit.normal, ct->n );
+ v3_copy( hit.pos, surface );
float p = vg_minf( surface[1] - point[1], 1.0f );