{
u32 vertex_length = vg_align8(ctx->max_vertices * sizeof(scene_vert)),
index_length = vg_align8(ctx->max_indices * sizeof(u32));
{
u32 vertex_length = vg_align8(ctx->max_vertices * sizeof(scene_vert)),
index_length = vg_align8(ctx->max_indices * sizeof(u32));
v3f n;
v3_muls( norm, 127.0f, n );
v3_minv( n, (v3f){ 127.0f, 127.0f, 127.0f }, n );
v3f n;
v3_muls( norm, 127.0f, n );
v3_minv( n, (v3f){ 127.0f, 127.0f, 127.0f }, n );
mdl_submesh *sm, m4x3f transform )
{
if( ctx->vertex_count + sm->vertex_count > ctx->max_vertices ){
mdl_submesh *sm, m4x3f transform )
{
if( ctx->vertex_count + sm->vertex_count > ctx->max_vertices ){
{
if( ctx->indice_count + 3 > ctx->max_indices )
vg_fatal_error( "Scene indice buffer overflow (%u exceeds %u)\n",
{
if( ctx->indice_count + 3 > ctx->max_indices )
vg_fatal_error( "Scene indice buffer overflow (%u exceeds %u)\n",
{
if( ctx->vertex_count + 1 > ctx->max_vertices )
vg_fatal_error( "Scene vertex buffer overflow (%u exceeds %u)\n",
{
if( ctx->vertex_count + 1 > ctx->max_vertices )
vg_fatal_error( "Scene vertex buffer overflow (%u exceeds %u)\n",
{
sm->indice_start = ctx->submesh.indice_start;
sm->indice_count = ctx->indice_count - sm->indice_start;
{
sm->indice_start = ctx->submesh.indice_start;
sm->indice_count = ctx->indice_count - sm->indice_start;
u32 start, u32 count, u16 flags ){
for( u32 i=0; i<count; i++ )
ctx->arrvertices[ start + i ].flags = flags;
u32 start, u32 count, u16 flags ){
for( u32 i=0; i<count; i++ )
ctx->arrvertices[ start + i ].flags = flags;
vg_async_item *scene_alloc_async( scene_context *scene, glmesh *mesh,
u32 max_vertices, u32 max_indices )
{
vg_async_item *scene_alloc_async( scene_context *scene, glmesh *mesh,
u32 max_vertices, u32 max_indices )
{
-VG_STATIC void scene_bh_closest( void *user, u32 index, v3f point, v3f closest )
+static void scene_bh_closest( void *user, u32 index, v3f point, v3f closest )
{
.expand_bound = scene_bh_expand_bound,
.item_centroid = scene_bh_centroid,
.item_closest = scene_bh_closest,
.item_swap = scene_bh_swap,
.item_debug = scene_bh_debug,
{
.expand_bound = scene_bh_expand_bound,
.item_centroid = scene_bh_centroid,
.item_closest = scene_bh_closest,
.item_swap = scene_bh_swap,
.item_debug = scene_bh_debug,
v3f co, v3f dir, ray_hit *hit, u16 ignore )
{
hit->tri = NULL;
v3f co, v3f dir, ray_hit *hit, u16 ignore )
{
hit->tri = NULL;
- if( ray_tri( vs, co, dir, &t ) ){
+ if( ray_tri( vs, co, dir, &t, 0 ) ){
{
u32 triangle_count = s->indice_count / 3;
return bh_create( lin_alloc, &bh_system_scene, s, triangle_count, 2 );
{
u32 triangle_count = s->indice_count / 3;
return bh_create( lin_alloc, &bh_system_scene, s, triangle_count, 2 );