# Path: p5/sketch/events.py
# class VispyButton(IntEnum):
# class MouseButton:
# class Key:
# class Event:
# class KeyEvent(Event):
# class MouseEvent(Event):
#     LEFT = 1
#     RIGHT = 2
#     MIDDLE = 3
#     def __init__(self, buttons):
#     def buttons(self):
#     def __eq__(self, other):
#     def __neq__(self, other):
#     def __repr__(self):
#     def __init__(self, name, text=''):
#     def __eq__(self, other):
#     def __neq__(self, other):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, raw_event, active=False):
#     def modifiers(self):
#     def pressed(self):
#     def is_shift_down(self):
#     def is_ctrl_down(self):
#     def is_alt_down(self):
#     def is_meta_down(self):
#     def _update_builtins(self):
#     def __init__(self, *args, **kwargs):
#     def _update_builtins(self):
#     def __init__(self, *args, **kwargs):
#     def _update_builtins(self):
#     def __repr__(self):
# 
# Path: p5/core/p5.py

# 
# Path: p5/pmath/matrix.py
# def _magnitude(arr):
# def _normalize(arry):
# def scale_transform(x, y, z=1):
# def translation_matrix(x, y, z=0):
# def rotation_matrix(axis, angle):
# def euler_rotation_matrix(heading, attitude, bank):
# def triple_axis_rotation_matrix(x, y, z):
# def look_at(eye, at, up):
# def perspective_matrix(field_of_view, aspect_ratio, near_plane, far_plane):


import __main__
import math
import numpy as np
import builtins
import sys
import time
        import vispy
from functools import wraps
from .events import handler_names
from ..core import p5
from ..pmath import matrix
        from p5.sketch.Vispy2DRenderer.base import VispySketch
        from vispy import app
            from p5.sketch.Vispy2DRenderer.renderer2d import VispyRenderer2D
            from p5.sketch.Vispy3DRenderer.renderer3d import Renderer3D
            from vispy import app
    :type width: int

    :param height: height of the sketch window.
    :type height: int

    """
    builtins.width = int(width)
    builtins.height = int(height)
    p5.sketch.size = (builtins.width, builtins.height)

    # update the look at matrix coordinates according to sketch size
    if p5.mode == "P3D":
        eye = np.array((0, 0, height / math.tan(math.pi / 6)))
        p5.renderer.lookat_matrix = matrix.look_at(
            eye,
            np.array((0, 0, 0)),
            np.array((0, 1, 0)))
        p5.renderer.camera_pos = eye


def no_loop():
    """Stop draw() from being continuously called.

    By default, the sketch continuously calls `draw()` as long as it
    runs. Calling `no_loop()` stops draw() from being called the next
    time. Note that this only prevents execution of the code inside
    `draw()` and the user can manipulate the screen contents through
    event handlers like `mouse_pressed()`, etc.

    """

# Path: p5/sketch/events.py
# class VispyButton(IntEnum):
# class MouseButton:
# class Key:
# class Event:
# class KeyEvent(Event):
# class MouseEvent(Event):
#     LEFT = 1
#     RIGHT = 2
#     MIDDLE = 3
#     def __init__(self, buttons):
#     def buttons(self):
#     def __eq__(self, other):
#     def __neq__(self, other):
#     def __repr__(self):
#     def __init__(self, name, text=''):
#     def __eq__(self, other):
#     def __neq__(self, other):
#     def __str__(self):
#     def __repr__(self):
#     def __init__(self, raw_event, active=False):
#     def modifiers(self):
#     def pressed(self):
#     def is_shift_down(self):
#     def is_ctrl_down(self):
#     def is_alt_down(self):
#     def is_meta_down(self):
#     def _update_builtins(self):
#     def __init__(self, *args, **kwargs):
#     def _update_builtins(self):
#     def __init__(self, *args, **kwargs):
#     def _update_builtins(self):
#     def __repr__(self):
# 
# Path: p5/core/p5.py

# 
# Path: p5/pmath/matrix.py
# def _magnitude(arr):
# def _normalize(arry):
# def scale_transform(x, y, z=1):
# def translation_matrix(x, y, z=0):
# def rotation_matrix(axis, angle):
# def euler_rotation_matrix(heading, attitude, bank):
# def triple_axis_rotation_matrix(x, y, z):
# def look_at(eye, at, up):
# def perspective_matrix(field_of_view, aspect_ratio, near_plane, far_plane):


# Path: p5/sketch/userspace.py
import __main__
import math
import numpy as np
import builtins
import sys
import time
        import vispy
from functools import wraps
from .events import handler_names
from ..core import p5
from ..pmath import matrix
        from p5.sketch.Vispy2DRenderer.base import VispySketch
        from vispy import app
            from p5.sketch.Vispy2DRenderer.renderer2d import VispyRenderer2D
            from p5.sketch.Vispy3DRenderer.renderer3d import Renderer3D
            from vispy import app

    :type width: int

    :param height: height of the sketch window.
    :type height: int

    """
    builtins.width = int(width)
    builtins.height = int(height)
    p5.sketch.size = (builtins.width, builtins.height)

    # update the look at matrix coordinates according to sketch size
    if p5.mode == "P3D":
        eye = np.array((0, 0, height / math.tan(math.pi / 6)))
        p5.renderer.lookat_matrix = matrix.look_at(
            eye,
            np.array((0, 0, 0)),
            np.array((0, 1, 0)))
        p5.renderer.camera_pos = eye


def no_loop():
    """Stop draw() from being continuously called.

    By default, the sketch continuously calls `draw()` as long as it
    runs. Calling `no_loop()` stops draw() from being called the next
    time. Note that this only prevents execution of the code inside
    `draw()` and the user can manipulate the screen contents through
    event handlers like `mouse_pressed()`, etc.

    """

    p5.sketch.looping = False