-
Notifications
You must be signed in to change notification settings - Fork 0
/
scene3d.go
42 lines (33 loc) Β· 914 Bytes
/
scene3d.go
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
34
35
36
37
38
39
40
41
42
package main
import (
"image/color"
rl "github.com/gen2brain/raylib-go/raylib"
)
func (s *Scene3D) render() {
rl.ClearBackground(rl.SkyBlue)
rl.BeginMode3D(*GameState.camera)
// maze.draw()
for _, item := range s.Items {
if item.hidden {
continue
}
var tint color.RGBA
if item.highlight {
tint = rl.Purple
} else {
tint = rl.White
}
if GameState.editFocusedItemUid != "" && item.uid != GameState.editFocusedItemUid {
tint = rl.NewColor(0, 0, 0, 70)
}
rl.DrawModel(item.model, item.pos, item.scale, tint)
size := maze.scale * float32(len(maze.matrix))
rl.DrawPlane(rl.NewVector3(size/2-8, -0.0001, size/2-8), rl.NewVector2(size, size), rl.Gray)
}
for _, node := range maze.allNodes {
if node.Spawner.Enemy != nil {
rl.DrawBillboard(*GameState.camera, node.Spawner.Enemy.Texture, rl.NewVector3(node.posX, 3, node.posY), 6.0, rl.White)
}
}
rl.EndMode3D()
}