-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathscene.py
33 lines (27 loc) · 873 Bytes
/
scene.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from settings import *
import moderngl as mgl
from world import World
from world_objects.voxel_marker import VoxelMarker
from world_objects.water import Water
from world_objects.clouds import Clouds
class Scene:
def __init__(self, app):
self.app = app
self.world = World(self.app)
self.voxel_marker = VoxelMarker(self.world.voxel_handler)
self.water = Water(app)
self.clouds = Clouds(app)
def update(self):
self.world.update()
self.voxel_marker.update()
self.clouds.update()
def render(self):
# chunks rendering
self.world.render()
# rendering without cull face
self.app.ctx.disable(mgl.CULL_FACE)
self.clouds.render()
self.water.render()
self.app.ctx.enable(mgl.CULL_FACE)
# voxel selection
self.voxel_marker.render()