-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDemo.kt
43 lines (34 loc) · 1.16 KB
/
Demo.kt
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
43
import be.encelade.chimp.material.MaterialDefinitions
import be.encelade.chimp.utils.ColorHelperUtils.ColorRGBA
import be.encelade.ouistiti.CameraManager
import com.jme3.app.SimpleApplication
import com.jme3.system.AppSettings
fun main() {
val settings = AppSettings(true)
settings.title = "ouistiti demo"
settings.isFullscreen = false
settings.isVSync = false
settings.samples = 16
// settings.setResolution(1920, 1080)
settings.setResolution(1280, 720)
val simpleApp = DemoSimpleApp()
simpleApp.setSettings(settings)
simpleApp.isShowSettings = false
simpleApp.start()
}
class DemoSimpleApp : SimpleApplication() {
private lateinit var cameraManager: CameraManager
override fun simpleInitApp() {
// init chimp-utils API for materials
MaterialDefinitions.load(assetManager)
// init CameraManager
cameraManager = CameraManager(this)
cameraManager.addDefaultKeyMappings()
// build scene
viewPort.backgroundColor = ColorRGBA("#1c3064")
rootNode.attachChild(SceneNode())
}
override fun simpleUpdate(tpf: Float) {
cameraManager.simpleUpdate(tpf)
}
}