projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
water splash
[carveJwlIkooP6JGAAIwe30JlM.git]
/
gate.h
diff --git
a/gate.h
b/gate.h
index eb0f335782b0ff367c2d1685548a4263e24cf494..fec28266caa1aaf176898565bfb52d488825a686 100644
(file)
--- a/
gate.h
+++ b/
gate.h
@@
-1,13
+1,12
@@
#ifndef GATE_H
#define GATE_H
#ifndef GATE_H
#define GATE_H
-#define VG_3D
-#include "vg/vg.h"
+#include "common.h"
#include "model.h"
#include "render.h"
#include "shaders/gate.h"
#include "shaders/gatelq.h"
#include "model.h"
#include "render.h"
#include "shaders/gate.h"
#include "shaders/gatelq.h"
-#include "water.h"
+#include "w
orld_w
ater.h"
typedef struct teleport_gate teleport_gate;
typedef struct teleport_gate teleport_gate;
@@
-72,10
+71,9
@@
static void gate_fb_resize(void)
fb_resize( &grender.fb );
}
fb_resize( &grender.fb );
}
-static int render_gate( teleport_gate *gate, m4x3f camera )
+static int render_gate( teleport_gate *gate,
v3f viewpos,
m4x3f camera )
{
{
- v3f viewpos, viewdir, gatedir;
- v3_copy( camera[3], viewpos );
+ v3f viewdir, gatedir;
m3x3_mulv( camera, (v3f){0.0f,0.0f,-1.0f}, viewdir );
m3x3_mulv( gate->to_world, (v3f){0.0f,0.0f,-1.0f}, gatedir );
m3x3_mulv( camera, (v3f){0.0f,0.0f,-1.0f}, viewdir );
m3x3_mulv( gate->to_world, (v3f){0.0f,0.0f,-1.0f}, gatedir );
@@
-234,7
+232,7
@@
static int gate_intersect( teleport_gate *gate, v3f pos, v3f last )
float d = v3_dot(surface, v0);
float d = v3_dot(surface, v0);
- if(
fabsf(d)
> 0.00001f )
+ if(
d
> 0.00001f )
{
float t = v3_dot(delta, surface) / d;
if( t >= 0.0f && t <= l )
{
float t = v3_dot(delta, surface) / d;
if( t >= 0.0f && t <= l )