- v3f vup, vside;
- m3x3_mulv( gate->to_world, (v3f){0.0f,1.0f,0.0f}, vup );
- m3x3_mulv( gate->to_world, (v3f){1.0f,0.0f,0.0f}, vside );
+ where[0] = v3_dot( rel, gate->to_world[0] );
+ where[1] = v3_dot( rel, gate->to_world[1] );
+
+ where[0] /= v3_dot( gate->to_world[0], gate->to_world[0] );
+ where[1] /= v3_dot( gate->to_world[1], gate->to_world[1] );
+
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+VG_STATIC int gate_intersect( teleport_gate *gate, v3f pos, v3f last )
+{
+ v2f xy;
+
+ if( gate_intersect_plane( gate, pos, last, xy ) )
+ {
+ vg_info( "%f %f\n", xy[0], xy[1] );
+ if( fabsf(xy[0]) <= 1.0f && fabsf(xy[1]) <= 1.0f )
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+struct gate_hit
+{
+ struct nonlocal_gate *nonlocal;
+ struct route_gate *route;
+ teleport_gate *gate;
+};