projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added scene_vert struct, result is good
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_routes.h
diff --git
a/world_routes.h
b/world_routes.h
index 5a7c07b36df0b154c921a3970fd050eaafb19d63..4e455d345b8f4728ae2cdc9c3c305aefb9a76203 100644
(file)
--- a/
world_routes.h
+++ b/
world_routes.h
@@
-5,6
+5,7
@@
#ifndef ROUTES_H
#define ROUTES_H
#ifndef ROUTES_H
#define ROUTES_H
+#include <time.h>
#include "world.h"
#include "world_gate.h"
#include "world.h"
#include "world_gate.h"
@@
-530,6
+531,17
@@
VG_STATIC void world_routes_verify_run( u32 route )
world.routes[route].latest_pass = world.time;
}
world.routes[route].latest_pass = world.time;
}
+VG_STATIC void world_routes_clear(void)
+{
+ for( u32 i=0; i<world.route_count; i++ )
+ {
+ struct route *route = &world.routes[i];
+ route->active = 0;
+ }
+ world.current_run_version += 4;
+ world.last_use = 0.0;
+}
+
/*
* When going through a gate this is called for bookkeeping purposes
*/
/*
* When going through a gate this is called for bookkeeping purposes
*/
@@
-734,12
+746,13
@@
VG_STATIC void world_routes_create_mesh( u32 route_id )
if( ray_world( sa, down, &ha ) &&
ray_world( sb, down, &hb ))
{
if( ray_world( sa, down, &ha ) &&
ray_world( sb, down, &hb ))
{
-
mdl
_vert va, vb;
+
scene
_vert va, vb;
v3_muladds( ha.pos, up, 0.06f, va.co );
v3_muladds( hb.pos, up, 0.06f, vb.co );
v3_muladds( ha.pos, up, 0.06f, va.co );
v3_muladds( hb.pos, up, 0.06f, vb.co );
- v3_copy( up, va.norm );
- v3_copy( up, vb.norm );
+
+ scene_vert_pack_norm( &va, up );
+ scene_vert_pack_norm( &vb, up );
v2_zero( va.uv );
v2_zero( vb.uv );
v2_zero( va.uv );
v2_zero( vb.uv );
@@
-1120,7
+1133,7
@@
VG_STATIC void world_routes_update(void)
}
VG_STATIC void bind_terrain_noise(void);
}
VG_STATIC void bind_terrain_noise(void);
-VG_STATIC void render_world_routes(
m4x4f projection, v3f camera
)
+VG_STATIC void render_world_routes(
camera *cam
)
{
m4x3f identity_matrix;
m4x3_identity( identity_matrix );
{
m4x3f identity_matrix;
m4x3_identity( identity_matrix );
@@
-1130,9
+1143,12
@@
VG_STATIC void render_world_routes( m4x4f projection, v3f camera )
shader_link_standard_ub( _shader_route.id, 2 );
bind_terrain_noise();
shader_link_standard_ub( _shader_route.id, 2 );
bind_terrain_noise();
- shader_route_uPv( projection );
+ shader_route_uPv( cam->mtx.pv );
+ shader_route_uPvmPrev( cam->mtx_prev.pv );
shader_route_uMdl( identity_matrix );
shader_route_uMdl( identity_matrix );
- shader_route_uCamera( camera );
+ shader_route_uCamera( cam->transform[3] );
+ shader_route_uBoard0( TEMP_BOARD_0 );
+ shader_route_uBoard1( TEMP_BOARD_1 );
mesh_bind( &world.mesh_route_lines );
mesh_bind( &world.mesh_route_lines );