# Path: cuwo/vector.py
# def ivec3(x=0, y=0, z=0):
# def vec3(x=0, y=0, z=0):
# def qvec3(x=0, y=0, z=0):


import sys
import sdl2
import sdl2.ext
import threading
import math
import os
                import traceback
from cuwo import tgen
from cuwo.vector import Vector3, Quaternion
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.constants import GLfloat_4
from OpenGL.GL import shaders
from OpenGL.GL.ARB.vertex_buffer_object import *
from queue import PriorityQueue, Full
from ctypes import *
            sdl2.keycode.SDLK_s: 'down',
            sdl2.keycode.SDLK_a: 'left',
            sdl2.keycode.SDLK_d: 'right',
            sdl2.keycode.SDLK_LSHIFT: 'shift',
            sdl2.keycode.SDLK_RSHIFT: 'shift'
        }
        if key not in keys:
            return
        setattr(self, keys[key], value)

    def update(self, dt):
        move = Vector3()
        if self.up:
            move.y = 1.0
        elif self.down:
            move.y = -1.0
        if self.left:
            move.x = -1.0
        elif self.right:
            move.x = 1.0
        if self.shift:
            speed = 150
        else:
            speed = 50
        speed *= dt
        self.pos += self.get_rot() * (move * speed)

    def set(self):
        rot = self.get_rot()
        look_vec = rot * Vector3((0.0, 1.0, 0.0))

# Path: cuwo/vector.py
# def ivec3(x=0, y=0, z=0):
# def vec3(x=0, y=0, z=0):
# def qvec3(x=0, y=0, z=0):


# Path: tools/mapviewer.py
import sys
import sdl2
import sdl2.ext
import threading
import math
import os
                import traceback
from cuwo import tgen
from cuwo.vector import Vector3, Quaternion
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.constants import GLfloat_4
from OpenGL.GL import shaders
from OpenGL.GL.ARB.vertex_buffer_object import *
from queue import PriorityQueue, Full
from ctypes import *

            sdl2.keycode.SDLK_s: 'down',
            sdl2.keycode.SDLK_a: 'left',
            sdl2.keycode.SDLK_d: 'right',
            sdl2.keycode.SDLK_LSHIFT: 'shift',
            sdl2.keycode.SDLK_RSHIFT: 'shift'
        }
        if key not in keys:
            return
        setattr(self, keys[key], value)

    def update(self, dt):
        move = Vector3()
        if self.up:
            move.y = 1.0
        elif self.down:
            move.y = -1.0
        if self.left:
            move.x = -1.0
        elif self.right:
            move.x = 1.0
        if self.shift:
            speed = 150
        else:
            speed = 50
        speed *= dt
        self.pos += self.get_rot() * (move * speed)

    def set(self):
        rot = self.get_rot()
        look_vec = rot * Vector3((0.0, 1.0, 0.0))

        up_vec = rot * Vector3((0.0, 0.0, 1.0))