basilisk-engine 0.1.11__py3-none-any.whl → 0.1.13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of basilisk-engine might be problematic. Click here for more details.
- basilisk/nodes/node.py +4 -2
- basilisk/render/camera.py +8 -3
- basilisk/scene.py +14 -8
- {basilisk_engine-0.1.11.dist-info → basilisk_engine-0.1.13.dist-info}/METADATA +1 -1
- {basilisk_engine-0.1.11.dist-info → basilisk_engine-0.1.13.dist-info}/RECORD +7 -7
- {basilisk_engine-0.1.11.dist-info → basilisk_engine-0.1.13.dist-info}/WHEEL +0 -0
- {basilisk_engine-0.1.11.dist-info → basilisk_engine-0.1.13.dist-info}/top_level.txt +0 -0
basilisk/nodes/node.py
CHANGED
|
@@ -572,16 +572,18 @@ class Node():
|
|
|
572
572
|
self.chunk.node_update_callback(self)
|
|
573
573
|
|
|
574
574
|
@velocity.setter
|
|
575
|
-
def velocity(self, value: tuple | list | glm.vec3 | np.ndarray):
|
|
575
|
+
def velocity(self, value: tuple | list | glm.vec3 | np.ndarray | Vec3):
|
|
576
576
|
if isinstance(value, glm.vec3): self._velocity = glm.vec3(value)
|
|
577
|
+
elif isinstance(value, Vec3): self._velocity = glm.vec3(value.data)
|
|
577
578
|
elif isinstance(value, tuple) or isinstance(value, list) or isinstance(value, np.ndarray):
|
|
578
579
|
if len(value) != 3: raise ValueError(f'Node: Invalid number of values for velocity. Expected 3, got {len(value)}')
|
|
579
580
|
self._velocity = glm.vec3(value)
|
|
580
581
|
else: raise TypeError(f'Node: Invalid velocity value type {type(value)}')
|
|
581
582
|
|
|
582
583
|
@rotational_velocity.setter
|
|
583
|
-
def rotational_velocity(self, value: tuple | list | glm.vec3 | np.ndarray):
|
|
584
|
+
def rotational_velocity(self, value: tuple | list | glm.vec3 | np.ndarray | Vec3):
|
|
584
585
|
if isinstance(value, glm.vec3): self._rotational_velocity = glm.vec3(value)
|
|
586
|
+
elif isinstance(value, Vec3): self._rotational_velocity = glm.vec3(value.data)
|
|
585
587
|
elif isinstance(value, tuple) or isinstance(value, list) or isinstance(value, np.ndarray):
|
|
586
588
|
if len(value) != 3: raise ValueError(f'Node: Invalid number of values for rotational velocity. Expected 3, got {len(value)}')
|
|
587
589
|
self._rotational_velocity = glm.vec3(value)
|
basilisk/render/camera.py
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import pygame as pg
|
|
2
2
|
import glm
|
|
3
3
|
import numpy as np
|
|
4
|
+
from ..generic.vec3 import Vec3
|
|
5
|
+
from ..generic.quat import Quat
|
|
6
|
+
|
|
4
7
|
|
|
5
8
|
# Camera view constants
|
|
6
9
|
FOV = 50 # Degrees
|
|
@@ -112,16 +115,18 @@ class Camera:
|
|
|
112
115
|
self.use()
|
|
113
116
|
|
|
114
117
|
@position.setter
|
|
115
|
-
def position(self, value: tuple | list | glm.vec3 | np.ndarray):
|
|
118
|
+
def position(self, value: tuple | list | glm.vec3 | np.ndarray | Vec3):
|
|
116
119
|
if isinstance(value, glm.vec3): self._position = glm.vec3(value)
|
|
120
|
+
elif isinstance(value, Vec3): self._position = glm.vec3(value.data)
|
|
117
121
|
elif isinstance(value, tuple) or isinstance(value, list) or isinstance(value, np.ndarray):
|
|
118
122
|
if len(value) != 3: raise ValueError(f'Camera: Invalid number of values for position. Expected 3, got {len(value)}')
|
|
119
123
|
self._position = glm.vec3(value)
|
|
120
124
|
else: raise TypeError(f'Camera: Invalid position value type {type(value)}')
|
|
121
125
|
|
|
122
126
|
@direction.setter
|
|
123
|
-
def direction(self, value: tuple | list | glm.vec3 | np.ndarray):
|
|
124
|
-
if isinstance(value, glm.vec3): self.
|
|
127
|
+
def direction(self, value: tuple | list | glm.vec3 | np.ndarray | Vec3):
|
|
128
|
+
if isinstance(value, glm.vec3): self.forward = glm.normalize(glm.vec3(value))
|
|
129
|
+
elif isinstance(value, Vec3): self.forward = glm.normalize(value.data)
|
|
125
130
|
elif isinstance(value, tuple) or isinstance(value, list) or isinstance(value, np.ndarray):
|
|
126
131
|
if len(value) != 3: raise ValueError(f'Camera: Invalid number of values for direction. Expected 3, got {len(value)}')
|
|
127
132
|
self.forward = glm.normalize(glm.vec3(value))
|
basilisk/scene.py
CHANGED
|
@@ -140,14 +140,7 @@ class Scene():
|
|
|
140
140
|
if len(returns) == 1: return returns[0]
|
|
141
141
|
return returns
|
|
142
142
|
|
|
143
|
-
def
|
|
144
|
-
"""
|
|
145
|
-
Sets the back references to the engine and creates handlers with the context
|
|
146
|
-
"""
|
|
147
|
-
|
|
148
|
-
self.engine = engine
|
|
149
|
-
self.ctx = engine.ctx
|
|
150
|
-
|
|
143
|
+
def init_handlers(self) -> None:
|
|
151
144
|
self.camera = FreeCamera()
|
|
152
145
|
self.shader_handler = ShaderHandler(self)
|
|
153
146
|
self.material_handler = MaterialHandler(self)
|
|
@@ -159,6 +152,19 @@ class Scene():
|
|
|
159
152
|
self.draw_handler = DrawHandler(self)
|
|
160
153
|
self.frame = Frame(self)
|
|
161
154
|
self.sky = Sky(self.engine)
|
|
155
|
+
|
|
156
|
+
def set_engine(self, engine: any) -> None:
|
|
157
|
+
"""
|
|
158
|
+
Sets the back references to the engine and creates handlers with the context
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
if not self.engine:
|
|
162
|
+
self.engine = engine
|
|
163
|
+
self.ctx = engine.ctx
|
|
164
|
+
self.init_handlers()
|
|
165
|
+
else:
|
|
166
|
+
self.engine = engine
|
|
167
|
+
self.ctx = engine.ctx
|
|
162
168
|
|
|
163
169
|
def raycast(self, position: glm.vec3=None, forward: glm.vec3=None, max_distance: float=1e5, has_collisions: bool=None, has_physics: bool=None, tags: list[str]=[]) -> RaycastResult:
|
|
164
170
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
basilisk/__init__.py,sha256=38Rmitj-4yslVnv6Gik9AHoArXMvCJRh4HcoZVKK48c,545
|
|
2
2
|
basilisk/config.py,sha256=ynTRlX633DGoEtZOeAK8KNJF6offV3k3XFD7cia3Keg,61
|
|
3
3
|
basilisk/engine.py,sha256=y15OdTsTjDk51Q06nLkVOx4KlJVM_6_owGdSGh92gBQ,6912
|
|
4
|
-
basilisk/scene.py,sha256=
|
|
4
|
+
basilisk/scene.py,sha256=CtoN7ufiVVKHWYnYE1uObzuUp56723gTZ0ZxZy6M1H0,11799
|
|
5
5
|
basilisk/audio/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
basilisk/audio/sound.py,sha256=BjqaPv_07iD_-NDRy1cc0TS4PJzAnQc4hfsW9ntNjGQ,719
|
|
7
7
|
basilisk/bsk_assets/Roboto-Regular.ttf,sha256=kqYnZjMRQMpbyLulIChCLSdgYa1XF8GsUIoRi2Gcauw,168260
|
|
@@ -54,7 +54,7 @@ basilisk/mesh/narrow_bvh.py,sha256=jLQhmUNi6mFyU2wVwB_SOf4PIaOAygBTtcnQIyaMOGg,4
|
|
|
54
54
|
basilisk/mesh/narrow_primative.py,sha256=vWpIeo8I9le-EAvcr9rFUQlbl9mi6eYroqCSMK-m9eY,953
|
|
55
55
|
basilisk/nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
56
|
basilisk/nodes/helper.py,sha256=VdlGuEaMtLa992_8yNOB-QIgz4Izr5wNMSm8H6KftKE,2097
|
|
57
|
-
basilisk/nodes/node.py,sha256=
|
|
57
|
+
basilisk/nodes/node.py,sha256=5_qUQbPqrnCf3VJMtpeMM7QYAe79I3s6XVd5wi0YLTs,32474
|
|
58
58
|
basilisk/nodes/node_handler.py,sha256=zN7z_XhgJhxcKHq137h5xAcF8RqRD1mjQjkYgnC8Fpk,4097
|
|
59
59
|
basilisk/particles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
60
|
basilisk/particles/particle_handler.py,sha256=8TXVE4drKwwErqgFzWLyQgU-kk97cABsEMitrfSY4SA,2916
|
|
@@ -65,7 +65,7 @@ basilisk/physics/physics_body.py,sha256=_mi-AVMgQqUsC3bQIca5tgk2xWXTIUw0D_uC4DcQ
|
|
|
65
65
|
basilisk/physics/physics_engine.py,sha256=IPMshr4j5TII5JdcRqiULc6BfkeCLPxdICKqQeZGAtY,1735
|
|
66
66
|
basilisk/render/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
67
67
|
basilisk/render/batch.py,sha256=VvcKXNmiPxdQ92jzoARPGhLujUGomm6nQX7f7rkoyAQ,3775
|
|
68
|
-
basilisk/render/camera.py,sha256=
|
|
68
|
+
basilisk/render/camera.py,sha256=EnX4iq_bd0CZ6cqqckWaWF0VyrU0CcknNVOpGC9HWK0,7824
|
|
69
69
|
basilisk/render/chunk.py,sha256=R6Jlugxisnl_jkxp0KYkwTt9lzmz-IFCOgdSqGMBf1c,2824
|
|
70
70
|
basilisk/render/chunk_handler.py,sha256=KY-AqnydAc4ae2yKUsLrjs1GdvjoGdZbyXmSSnTtOFY,6497
|
|
71
71
|
basilisk/render/frame.py,sha256=cYeuEAyiMwXUQZgHfNPGEH43zZfrmNXyOpCjxtz2Ji8,3292
|
|
@@ -97,7 +97,7 @@ basilisk/shaders/particle.frag,sha256=Cv8cWQpVVQvhZeWj3NqL0D5nLtSO3EWV0VzOU-ZVL4
|
|
|
97
97
|
basilisk/shaders/particle.vert,sha256=ElXzT7ywiZ0SjrFcUistVDBi4wOobQ7_J5O7XVxrsVs,3027
|
|
98
98
|
basilisk/shaders/sky.frag,sha256=vTmZ1Xsd601_gmeBRfLYodHuBoBDI-M_1IybRt0ZDFk,178
|
|
99
99
|
basilisk/shaders/sky.vert,sha256=v_BSdnMiljSJGPqno-J_apAiom38IrBzbDoxM7pIgwI,345
|
|
100
|
-
basilisk_engine-0.1.
|
|
101
|
-
basilisk_engine-0.1.
|
|
102
|
-
basilisk_engine-0.1.
|
|
103
|
-
basilisk_engine-0.1.
|
|
100
|
+
basilisk_engine-0.1.13.dist-info/METADATA,sha256=RC_JwRpCSs-AUQRkNzj2oynOsJ0X4d79vSOcArGEZpM,1147
|
|
101
|
+
basilisk_engine-0.1.13.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
102
|
+
basilisk_engine-0.1.13.dist-info/top_level.txt,sha256=enlSYSf7CUyAly1jmUCNNGInTbaFUjGk4SKwyckZQkw,9
|
|
103
|
+
basilisk_engine-0.1.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|