#include "rigidbody.h"
#include "bvh.h"
#include "model.h"
+#include "entity.h"
#include "shaders/scene_standard.h"
#include "shaders/scene_standard_alphatest.h"
ent_checkpoint,
ent_route;
+ ent_gate *rendering_gate;
+
#if 0
/*
* Named safe places to respawn
float min_t = 1.0f;
int idx;
- while( bh_next( world->geo_bh, &it, region, &idx ) )
- {
+ while( bh_next( world->geo_bh, &it, region, &idx ) ){
u32 *ptri = &world->scene_geo->arrindices[ idx*3 ];
v3f tri[3];
boxf box;
box_init_inf( box );
- for( int j=0; j<3; j++ )
- {
+ for( int j=0; j<3; j++ ){
v3_copy( world->scene_geo->arrvertices[ptri[j]].co, tri[j] );
box_addpt( box, tri[j] );
}
float t;
v3f n1;
- if( spherecast_triangle( tri, pa, dir, r, &t, n1 ) )
- {
- if( t < min_t )
- {
+ if( spherecast_triangle( tri, pa, dir, r, &t, n1 ) ){
+ if( t < min_t ){
min_t = t;
hit = idx;
v3_copy( n1, n );
struct world_surface *world_tri_index_surface( world_instance *world,
u32 index )
{
- for( int i=1; i<world->surface_count; i++ )
- {
- struct world_surface *mat = &world->surfaces[i];
+ for( int i=1; i<world->surface_count; i++ ){
+ struct world_surface *surf = &world->surfaces[i];
- if( (index >= mat->sm_geo.vertex_start) &&
- (index < mat->sm_geo.vertex_start+mat->sm_geo.vertex_count ) )
+ if( (index >= surf->sm_geo.vertex_start) &&
+ (index < surf->sm_geo.vertex_start+surf->sm_geo.vertex_count ) )
{
- return mat;
+ return surf;
}
}
- /* error surface */
return &world->surfaces[0];
}