И ещё дальше
Более полные коллизии Ентити Приседания UserInput Больше отрисовки Более реалистичные движения
This commit is contained in:
parent
5fe7668fe5
commit
f907124af6
@ -2,12 +2,15 @@ package ru.dbotthepony.kstarbound
|
||||
|
||||
import org.apache.logging.log4j.LogManager
|
||||
import org.lwjgl.Version
|
||||
import org.lwjgl.glfw.GLFW.glfwSetWindowShouldClose
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.defs.TileDefinition
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.world.CHUNK_SIZE_FF
|
||||
import ru.dbotthepony.kstarbound.world.Chunk
|
||||
import ru.dbotthepony.kstarbound.world.ChunkPos
|
||||
import ru.dbotthepony.kstarbound.world.entities.Humanoid
|
||||
import ru.dbotthepony.kstarbound.world.entities.PlayerEntity
|
||||
import ru.dbotthepony.kstarbound.world.entities.Move
|
||||
import java.io.File
|
||||
|
||||
private val LOGGER = LogManager.getLogger()
|
||||
@ -20,7 +23,7 @@ fun main() {
|
||||
Starbound.addFilePath(File("./unpacked_assets/"))
|
||||
|
||||
Starbound.initializeGame { finished, replaceStatus, status ->
|
||||
client.pushLoadingText(status, replaceStatus)
|
||||
client.putDebugLog(status, replaceStatus)
|
||||
}
|
||||
|
||||
client.onTermination {
|
||||
@ -29,6 +32,8 @@ fun main() {
|
||||
|
||||
var chunkA: Chunk? = null
|
||||
|
||||
val ent = PlayerEntity(client.world!!)
|
||||
|
||||
Starbound.onInitialize {
|
||||
chunkA = client.world!!.computeIfAbsent(ChunkPos(0, 0)).chunk
|
||||
val chunkB = client.world!!.computeIfAbsent(ChunkPos(-1, 0)).chunk
|
||||
@ -40,25 +45,45 @@ fun main() {
|
||||
for (y in 0 .. 20) {
|
||||
val chnk = client.world!!.computeIfAbsent(ChunkPos(x, y))
|
||||
|
||||
for (bx in 0 .. 31) {
|
||||
for (by in 0 .. 3) {
|
||||
chnk.chunk.foreground[bx, by] = tile
|
||||
if (y == 0) {
|
||||
for (bx in 0 .. 31) {
|
||||
for (by in 0 .. 3) {
|
||||
chnk.chunk.foreground[bx, by] = tile
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run {
|
||||
val chunk = client.world!!.computeIfAbsent(ChunkPos(-2, 0)).chunk
|
||||
|
||||
for (y in 0 .. CHUNK_SIZE_FF) {
|
||||
for (x in 0 .. (CHUNK_SIZE_FF - y)) {
|
||||
chunk.foreground[x, y] = tile
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run {
|
||||
val chunk = client.world!!.computeIfAbsent(ChunkPos(-3, 0)).chunk
|
||||
|
||||
for (y in 0 .. CHUNK_SIZE_FF) {
|
||||
for (x in 0 .. (CHUNK_SIZE_FF - y * 2)) {
|
||||
chunk.foreground[x, y] = tile
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (x in 0 .. 31) {
|
||||
for (y in 0 .. 3) {
|
||||
chunkA!!.foreground[x, y] = tile
|
||||
chunkC.foreground[x, y] = tile
|
||||
}
|
||||
}
|
||||
|
||||
for (x in 0 .. 31) {
|
||||
for (y in 8 .. 9) {
|
||||
chunkA!!.foreground[x, y] = tile
|
||||
chunkC.foreground[x, y] = tile
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,34 +104,63 @@ fun main() {
|
||||
for (i in 0 .. 400) {
|
||||
chunkA!!.foreground[rand.nextInt(0, CHUNK_SIZE_FF), rand.nextInt(0, CHUNK_SIZE_FF)] = tile
|
||||
}*/
|
||||
|
||||
ent.dropToFloor()
|
||||
}
|
||||
|
||||
//val rand = Random()
|
||||
val ent = Humanoid(client.world!!)
|
||||
|
||||
ent.pos += Vector2d(y = 36.0, x = 10.0)
|
||||
ent.pos += Vector2d(y = 36.0, x = -10.0)
|
||||
|
||||
client.onDrawGUI {
|
||||
client.gl.font.render("${ent.pos}", y = 100f, scale = 0.25f)
|
||||
client.gl.font.render("${ent.velocity}", y = 120f, scale = 0.25f)
|
||||
}
|
||||
|
||||
client.onPreDrawWorld {
|
||||
client.camera.pos.x = ent.pos.x.toFloat()
|
||||
client.camera.pos.y = ent.pos.y.toFloat()
|
||||
}
|
||||
|
||||
client.onPostDrawWorld {
|
||||
client.gl.quadWireframe {
|
||||
it.quad(ent.aabb + ent.pos)
|
||||
it.quad(ent.worldaabb)
|
||||
}
|
||||
}
|
||||
|
||||
ent.spawn()
|
||||
|
||||
while (client.renderFrame()) {
|
||||
Starbound.pollCallbacks()
|
||||
|
||||
ent.moveAndCollide(client.frameRenderTime)
|
||||
//ent.think(client.frameRenderTime)
|
||||
client.camera.pos.x = ent.pos.x.toFloat()
|
||||
client.camera.pos.y = ent.pos.y.toFloat()
|
||||
|
||||
//println(client.camera.velocity.toDoubleVector() * client.frameRenderTime * 0.1)
|
||||
|
||||
//if (ent.onGround)
|
||||
ent.velocity += client.camera.velocity.toDoubleVector() * client.frameRenderTime * 0.1
|
||||
//ent.velocity += client.camera.velocity.toDoubleVector() * client.frameRenderTime * 0.1
|
||||
|
||||
if (client.input.KEY_LEFT_DOWN) {
|
||||
ent.moveDirection = Move.MOVE_LEFT
|
||||
} else if (client.input.KEY_RIGHT_DOWN) {
|
||||
ent.moveDirection = Move.MOVE_RIGHT
|
||||
} else {
|
||||
ent.moveDirection = Move.STAND_STILL
|
||||
}
|
||||
|
||||
if (client.input.KEY_SPACE_PRESSED && ent.onGround) {
|
||||
ent.requestJump()
|
||||
} else if (client.input.KEY_SPACE_RELEASED) {
|
||||
ent.recallJump()
|
||||
}
|
||||
|
||||
if (client.input.KEY_ESCAPE_PRESSED) {
|
||||
glfwSetWindowShouldClose(client.window, true)
|
||||
}
|
||||
|
||||
ent.wantsToDuck = client.input.KEY_DOWN_DOWN
|
||||
|
||||
//if (chunkA != null && glfwGetTime() < 10.0) {
|
||||
// val tile = Starbound.getTileDefinition("alienrock")
|
||||
|
@ -1,5 +1,6 @@
|
||||
package ru.dbotthepony.kstarbound.client
|
||||
|
||||
import org.lwjgl.glfw.GLFW.glfwGetTime
|
||||
import ru.dbotthepony.kstarbound.api.IStruct2d
|
||||
import ru.dbotthepony.kstarbound.api.IStruct2f
|
||||
import ru.dbotthepony.kstarbound.client.render.ChunkRenderer
|
||||
@ -73,4 +74,10 @@ class ClientWorld(val client: StarboundClient, seed: Long = 0L) : World<ClientWo
|
||||
renderer.renderDebug()
|
||||
}
|
||||
}
|
||||
|
||||
override fun thinkInner(delta: Double) {
|
||||
for (ent in entities) {
|
||||
ent.think(delta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,22 +10,20 @@ import org.lwjgl.system.MemoryUtil
|
||||
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNIT
|
||||
import ru.dbotthepony.kstarbound.PIXELS_IN_STARBOUND_UNITf
|
||||
import ru.dbotthepony.kstarbound.client.gl.GLStateTracker
|
||||
import ru.dbotthepony.kstarbound.client.input.UserInput
|
||||
import ru.dbotthepony.kstarbound.math.Matrix4f
|
||||
import ru.dbotthepony.kstarbound.client.render.Camera
|
||||
import ru.dbotthepony.kstarbound.client.render.TextAlignX
|
||||
import ru.dbotthepony.kstarbound.client.render.TextAlignY
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.math.Vector2f
|
||||
import ru.dbotthepony.kstarbound.util.Color
|
||||
import ru.dbotthepony.kstarbound.util.formatBytesShort
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.roundToInt
|
||||
import kotlin.math.sin
|
||||
|
||||
class StarboundClient : AutoCloseable {
|
||||
val window: Long
|
||||
val camera = Camera()
|
||||
val camera = Camera(this)
|
||||
val input = UserInput()
|
||||
var world: ClientWorld? = ClientWorld(this, 0L)
|
||||
|
||||
var gameTerminated = false
|
||||
@ -46,7 +44,7 @@ class StarboundClient : AutoCloseable {
|
||||
private val startupTextList = ArrayList<String>()
|
||||
private var finishStartupRendering = System.currentTimeMillis() + 4000L
|
||||
|
||||
fun pushLoadingText(text: String, replace: Boolean = false) {
|
||||
fun putDebugLog(text: String, replace: Boolean = false) {
|
||||
if (replace) {
|
||||
if (startupTextList.isEmpty()) {
|
||||
startupTextList.add(text)
|
||||
@ -87,13 +85,7 @@ class StarboundClient : AutoCloseable {
|
||||
require(window != MemoryUtil.NULL) { "Unable to create GLFW window" }
|
||||
startupTextList.add("Created GLFW window")
|
||||
|
||||
GLFW.glfwSetKeyCallback(window) { window, key, scancode, action, mods ->
|
||||
if (key == GLFW.GLFW_KEY_ESCAPE || key == GLFW.GLFW_RELEASE) {
|
||||
GLFW.glfwSetWindowShouldClose(window, true)
|
||||
} else {
|
||||
camera.userInput(key, scancode, action, mods)
|
||||
}
|
||||
}
|
||||
input.installCallback(window)
|
||||
|
||||
GLFW.glfwSetFramebufferSizeCallback(window) { _, w, h ->
|
||||
viewportWidth = w
|
||||
@ -128,7 +120,7 @@ class StarboundClient : AutoCloseable {
|
||||
GLFW.glfwSwapInterval(1)
|
||||
|
||||
GLFW.glfwShowWindow(window)
|
||||
pushLoadingText("Initialized GLFW window")
|
||||
putDebugLog("Initialized GLFW window")
|
||||
}
|
||||
|
||||
val gl = GLStateTracker()
|
||||
@ -136,17 +128,17 @@ class StarboundClient : AutoCloseable {
|
||||
fun ensureSameThread() = gl.ensureSameThread()
|
||||
|
||||
init {
|
||||
pushLoadingText("Initialized OpenGL context")
|
||||
putDebugLog("Initialized OpenGL context")
|
||||
gl.clearColor = Color.SLATE_GREY
|
||||
|
||||
gl.blend = true
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
}
|
||||
|
||||
var frameRenderTime = 1.0
|
||||
var frameRenderTime = 0.0
|
||||
private set
|
||||
|
||||
val framesPerSecond get() = 1.0 / frameRenderTime
|
||||
val framesPerSecond get() = if (frameRenderTime == 0.0) 1.0 else 1.0 / frameRenderTime
|
||||
|
||||
private val frameRenderTimes = DoubleArray(60) { 1.0 }
|
||||
private var frameRenderIndex = 0
|
||||
@ -158,6 +150,9 @@ class StarboundClient : AutoCloseable {
|
||||
sum += value
|
||||
}
|
||||
|
||||
if (sum == 0.0)
|
||||
return 0.0
|
||||
|
||||
return frameRenderTimes.size / sum
|
||||
}
|
||||
|
||||
@ -181,6 +176,12 @@ class StarboundClient : AutoCloseable {
|
||||
onPostDrawWorld.add(lambda)
|
||||
}
|
||||
|
||||
private val onPostDrawWorldOnce = ArrayList<() -> Unit>()
|
||||
|
||||
fun onPostDrawWorldOnce(lambda: () -> Unit) {
|
||||
onPostDrawWorldOnce.add(lambda)
|
||||
}
|
||||
|
||||
fun renderFrame(): Boolean {
|
||||
ensureSameThread()
|
||||
|
||||
@ -191,6 +192,9 @@ class StarboundClient : AutoCloseable {
|
||||
|
||||
val measure = GLFW.glfwGetTime()
|
||||
|
||||
if (frameRenderTime != 0.0)
|
||||
world?.think(frameRenderTime)
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT)
|
||||
gl.matrixStack.clear(viewportMatrixGame.toMutableMatrix())
|
||||
|
||||
@ -206,6 +210,11 @@ class StarboundClient : AutoCloseable {
|
||||
lambda.invoke()
|
||||
}
|
||||
|
||||
for (i in onPostDrawWorldOnce.size - 1 downTo 0) {
|
||||
onPostDrawWorldOnce[i].invoke()
|
||||
onPostDrawWorldOnce.removeAt(i)
|
||||
}
|
||||
|
||||
world?.render(AABB.rectangle(
|
||||
camera.pos.toDoubleVector(),
|
||||
viewportWidth / settings.scale / PIXELS_IN_STARBOUND_UNIT,
|
||||
@ -255,8 +264,9 @@ class StarboundClient : AutoCloseable {
|
||||
|
||||
GLFW.glfwSwapBuffers(window)
|
||||
GLFW.glfwPollEvents()
|
||||
input.think()
|
||||
|
||||
camera.tick(GLFW.glfwGetTime() - measure)
|
||||
camera.think(GLFW.glfwGetTime() - measure)
|
||||
|
||||
gl.cleanup()
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
package ru.dbotthepony.kstarbound.client
|
||||
|
||||
class UserInput {
|
||||
}
|
@ -10,6 +10,7 @@ import ru.dbotthepony.kstarbound.math.Matrix4f
|
||||
import ru.dbotthepony.kstarbound.math.Matrix4fStack
|
||||
import ru.dbotthepony.kstarbound.client.render.Font
|
||||
import ru.dbotthepony.kstarbound.client.render.TileRenderers
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.util.Color
|
||||
import java.io.File
|
||||
import java.lang.ref.Cleaner
|
||||
@ -380,7 +381,7 @@ class GLStateTracker {
|
||||
|
||||
val font = Font(this)
|
||||
|
||||
fun quadWireframe(lambda: (StreamVertexBuilder) -> Unit) {
|
||||
inline fun quadWireframe(color: Color = Color.WHITE, lambda: (StreamVertexBuilder) -> Unit) {
|
||||
val stateful = flat2DQuadWireframe.statefulSmall
|
||||
val builder = stateful.builder
|
||||
|
||||
@ -391,12 +392,19 @@ class GLStateTracker {
|
||||
stateful.upload()
|
||||
|
||||
flatProgram.use()
|
||||
flatProgram.color.set(Color.WHITE)
|
||||
flatProgram.color.set(color)
|
||||
flatProgram.transform.set(matrixStack.last)
|
||||
|
||||
stateful.draw(GL_LINES)
|
||||
}
|
||||
|
||||
inline fun quadWireframe(value: AABB, color: Color = Color.WHITE, chain: (StreamVertexBuilder) -> Unit = {}) {
|
||||
quadWireframe(color) {
|
||||
it.quad(value.mins.x.toFloat(), value.mins.y.toFloat(), value.maxs.x.toFloat(), value.maxs.y.toFloat())
|
||||
chain(it)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val LOGGER = LogManager.getLogger(GLStateTracker::class.java)
|
||||
}
|
||||
|
1084
src/main/kotlin/ru/dbotthepony/kstarbound/client/input/IUserInput.kt
Normal file
1084
src/main/kotlin/ru/dbotthepony/kstarbound/client/input/IUserInput.kt
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,530 @@
|
||||
package ru.dbotthepony.kstarbound.client.input
|
||||
|
||||
class MutableUserInputSnapshot(
|
||||
other: IUserInput
|
||||
) : IUserInput {
|
||||
override var KEY_SPACE_DOWN: Boolean = other.KEY_SPACE_DOWN
|
||||
override var KEY_SPACE_DURATION: Double = other.KEY_SPACE_DURATION
|
||||
override var KEY_APOSTROPHE_DOWN: Boolean = other.KEY_APOSTROPHE_DOWN
|
||||
override var KEY_APOSTROPHE_DURATION: Double = other.KEY_APOSTROPHE_DURATION
|
||||
override var KEY_COMMA_DOWN: Boolean = other.KEY_COMMA_DOWN
|
||||
override var KEY_COMMA_DURATION: Double = other.KEY_COMMA_DURATION
|
||||
override var KEY_MINUS_DOWN: Boolean = other.KEY_MINUS_DOWN
|
||||
override var KEY_MINUS_DURATION: Double = other.KEY_MINUS_DURATION
|
||||
override var KEY_PERIOD_DOWN: Boolean = other.KEY_PERIOD_DOWN
|
||||
override var KEY_PERIOD_DURATION: Double = other.KEY_PERIOD_DURATION
|
||||
override var KEY_SLASH_DOWN: Boolean = other.KEY_SLASH_DOWN
|
||||
override var KEY_SLASH_DURATION: Double = other.KEY_SLASH_DURATION
|
||||
override var KEY_0_DOWN: Boolean = other.KEY_0_DOWN
|
||||
override var KEY_0_DURATION: Double = other.KEY_0_DURATION
|
||||
override var KEY_1_DOWN: Boolean = other.KEY_1_DOWN
|
||||
override var KEY_1_DURATION: Double = other.KEY_1_DURATION
|
||||
override var KEY_2_DOWN: Boolean = other.KEY_2_DOWN
|
||||
override var KEY_2_DURATION: Double = other.KEY_2_DURATION
|
||||
override var KEY_3_DOWN: Boolean = other.KEY_3_DOWN
|
||||
override var KEY_3_DURATION: Double = other.KEY_3_DURATION
|
||||
override var KEY_4_DOWN: Boolean = other.KEY_4_DOWN
|
||||
override var KEY_4_DURATION: Double = other.KEY_4_DURATION
|
||||
override var KEY_5_DOWN: Boolean = other.KEY_5_DOWN
|
||||
override var KEY_5_DURATION: Double = other.KEY_5_DURATION
|
||||
override var KEY_6_DOWN: Boolean = other.KEY_6_DOWN
|
||||
override var KEY_6_DURATION: Double = other.KEY_6_DURATION
|
||||
override var KEY_7_DOWN: Boolean = other.KEY_7_DOWN
|
||||
override var KEY_7_DURATION: Double = other.KEY_7_DURATION
|
||||
override var KEY_8_DOWN: Boolean = other.KEY_8_DOWN
|
||||
override var KEY_8_DURATION: Double = other.KEY_8_DURATION
|
||||
override var KEY_9_DOWN: Boolean = other.KEY_9_DOWN
|
||||
override var KEY_9_DURATION: Double = other.KEY_9_DURATION
|
||||
override var KEY_SEMICOLON_DOWN: Boolean = other.KEY_SEMICOLON_DOWN
|
||||
override var KEY_SEMICOLON_DURATION: Double = other.KEY_SEMICOLON_DURATION
|
||||
override var KEY_EQUAL_DOWN: Boolean = other.KEY_EQUAL_DOWN
|
||||
override var KEY_EQUAL_DURATION: Double = other.KEY_EQUAL_DURATION
|
||||
override var KEY_A_DOWN: Boolean = other.KEY_A_DOWN
|
||||
override var KEY_A_DURATION: Double = other.KEY_A_DURATION
|
||||
override var KEY_B_DOWN: Boolean = other.KEY_B_DOWN
|
||||
override var KEY_B_DURATION: Double = other.KEY_B_DURATION
|
||||
override var KEY_C_DOWN: Boolean = other.KEY_C_DOWN
|
||||
override var KEY_C_DURATION: Double = other.KEY_C_DURATION
|
||||
override var KEY_D_DOWN: Boolean = other.KEY_D_DOWN
|
||||
override var KEY_D_DURATION: Double = other.KEY_D_DURATION
|
||||
override var KEY_E_DOWN: Boolean = other.KEY_E_DOWN
|
||||
override var KEY_E_DURATION: Double = other.KEY_E_DURATION
|
||||
override var KEY_F_DOWN: Boolean = other.KEY_F_DOWN
|
||||
override var KEY_F_DURATION: Double = other.KEY_F_DURATION
|
||||
override var KEY_G_DOWN: Boolean = other.KEY_G_DOWN
|
||||
override var KEY_G_DURATION: Double = other.KEY_G_DURATION
|
||||
override var KEY_H_DOWN: Boolean = other.KEY_H_DOWN
|
||||
override var KEY_H_DURATION: Double = other.KEY_H_DURATION
|
||||
override var KEY_I_DOWN: Boolean = other.KEY_I_DOWN
|
||||
override var KEY_I_DURATION: Double = other.KEY_I_DURATION
|
||||
override var KEY_J_DOWN: Boolean = other.KEY_J_DOWN
|
||||
override var KEY_J_DURATION: Double = other.KEY_J_DURATION
|
||||
override var KEY_K_DOWN: Boolean = other.KEY_K_DOWN
|
||||
override var KEY_K_DURATION: Double = other.KEY_K_DURATION
|
||||
override var KEY_L_DOWN: Boolean = other.KEY_L_DOWN
|
||||
override var KEY_L_DURATION: Double = other.KEY_L_DURATION
|
||||
override var KEY_M_DOWN: Boolean = other.KEY_M_DOWN
|
||||
override var KEY_M_DURATION: Double = other.KEY_M_DURATION
|
||||
override var KEY_N_DOWN: Boolean = other.KEY_N_DOWN
|
||||
override var KEY_N_DURATION: Double = other.KEY_N_DURATION
|
||||
override var KEY_O_DOWN: Boolean = other.KEY_O_DOWN
|
||||
override var KEY_O_DURATION: Double = other.KEY_O_DURATION
|
||||
override var KEY_P_DOWN: Boolean = other.KEY_P_DOWN
|
||||
override var KEY_P_DURATION: Double = other.KEY_P_DURATION
|
||||
override var KEY_Q_DOWN: Boolean = other.KEY_Q_DOWN
|
||||
override var KEY_Q_DURATION: Double = other.KEY_Q_DURATION
|
||||
override var KEY_R_DOWN: Boolean = other.KEY_R_DOWN
|
||||
override var KEY_R_DURATION: Double = other.KEY_R_DURATION
|
||||
override var KEY_S_DOWN: Boolean = other.KEY_S_DOWN
|
||||
override var KEY_S_DURATION: Double = other.KEY_S_DURATION
|
||||
override var KEY_T_DOWN: Boolean = other.KEY_T_DOWN
|
||||
override var KEY_T_DURATION: Double = other.KEY_T_DURATION
|
||||
override var KEY_U_DOWN: Boolean = other.KEY_U_DOWN
|
||||
override var KEY_U_DURATION: Double = other.KEY_U_DURATION
|
||||
override var KEY_V_DOWN: Boolean = other.KEY_V_DOWN
|
||||
override var KEY_V_DURATION: Double = other.KEY_V_DURATION
|
||||
override var KEY_W_DOWN: Boolean = other.KEY_W_DOWN
|
||||
override var KEY_W_DURATION: Double = other.KEY_W_DURATION
|
||||
override var KEY_X_DOWN: Boolean = other.KEY_X_DOWN
|
||||
override var KEY_X_DURATION: Double = other.KEY_X_DURATION
|
||||
override var KEY_Y_DOWN: Boolean = other.KEY_Y_DOWN
|
||||
override var KEY_Y_DURATION: Double = other.KEY_Y_DURATION
|
||||
override var KEY_Z_DOWN: Boolean = other.KEY_Z_DOWN
|
||||
override var KEY_Z_DURATION: Double = other.KEY_Z_DURATION
|
||||
override var KEY_LEFT_BRACKET_DOWN: Boolean = other.KEY_LEFT_BRACKET_DOWN
|
||||
override var KEY_LEFT_BRACKET_DURATION: Double = other.KEY_LEFT_BRACKET_DURATION
|
||||
override var KEY_BACKSLASH_DOWN: Boolean = other.KEY_BACKSLASH_DOWN
|
||||
override var KEY_BACKSLASH_DURATION: Double = other.KEY_BACKSLASH_DURATION
|
||||
override var KEY_RIGHT_BRACKET_DOWN: Boolean = other.KEY_RIGHT_BRACKET_DOWN
|
||||
override var KEY_RIGHT_BRACKET_DURATION: Double = other.KEY_RIGHT_BRACKET_DURATION
|
||||
override var KEY_GRAVE_ACCENT_DOWN: Boolean = other.KEY_GRAVE_ACCENT_DOWN
|
||||
override var KEY_GRAVE_ACCENT_DURATION: Double = other.KEY_GRAVE_ACCENT_DURATION
|
||||
override var KEY_WORLD_1_DOWN: Boolean = other.KEY_WORLD_1_DOWN
|
||||
override var KEY_WORLD_1_DURATION: Double = other.KEY_WORLD_1_DURATION
|
||||
override var KEY_WORLD_2_DOWN: Boolean = other.KEY_WORLD_2_DOWN
|
||||
override var KEY_WORLD_2_DURATION: Double = other.KEY_WORLD_2_DURATION
|
||||
override var KEY_ESCAPE_DOWN: Boolean = other.KEY_ESCAPE_DOWN
|
||||
override var KEY_ESCAPE_DURATION: Double = other.KEY_ESCAPE_DURATION
|
||||
override var KEY_ENTER_DOWN: Boolean = other.KEY_ENTER_DOWN
|
||||
override var KEY_ENTER_DURATION: Double = other.KEY_ENTER_DURATION
|
||||
override var KEY_TAB_DOWN: Boolean = other.KEY_TAB_DOWN
|
||||
override var KEY_TAB_DURATION: Double = other.KEY_TAB_DURATION
|
||||
override var KEY_BACKSPACE_DOWN: Boolean = other.KEY_BACKSPACE_DOWN
|
||||
override var KEY_BACKSPACE_DURATION: Double = other.KEY_BACKSPACE_DURATION
|
||||
override var KEY_INSERT_DOWN: Boolean = other.KEY_INSERT_DOWN
|
||||
override var KEY_INSERT_DURATION: Double = other.KEY_INSERT_DURATION
|
||||
override var KEY_DELETE_DOWN: Boolean = other.KEY_DELETE_DOWN
|
||||
override var KEY_DELETE_DURATION: Double = other.KEY_DELETE_DURATION
|
||||
override var KEY_RIGHT_DOWN: Boolean = other.KEY_RIGHT_DOWN
|
||||
override var KEY_RIGHT_DURATION: Double = other.KEY_RIGHT_DURATION
|
||||
override var KEY_LEFT_DOWN: Boolean = other.KEY_LEFT_DOWN
|
||||
override var KEY_LEFT_DURATION: Double = other.KEY_LEFT_DURATION
|
||||
override var KEY_DOWN_DOWN: Boolean = other.KEY_DOWN_DOWN
|
||||
override var KEY_DOWN_DURATION: Double = other.KEY_DOWN_DURATION
|
||||
override var KEY_UP_DOWN: Boolean = other.KEY_UP_DOWN
|
||||
override var KEY_UP_DURATION: Double = other.KEY_UP_DURATION
|
||||
override var KEY_PAGE_UP_DOWN: Boolean = other.KEY_PAGE_UP_DOWN
|
||||
override var KEY_PAGE_UP_DURATION: Double = other.KEY_PAGE_UP_DURATION
|
||||
override var KEY_PAGE_DOWN_DOWN: Boolean = other.KEY_PAGE_DOWN_DOWN
|
||||
override var KEY_PAGE_DOWN_DURATION: Double = other.KEY_PAGE_DOWN_DURATION
|
||||
override var KEY_HOME_DOWN: Boolean = other.KEY_HOME_DOWN
|
||||
override var KEY_HOME_DURATION: Double = other.KEY_HOME_DURATION
|
||||
override var KEY_END_DOWN: Boolean = other.KEY_END_DOWN
|
||||
override var KEY_END_DURATION: Double = other.KEY_END_DURATION
|
||||
override var KEY_CAPS_LOCK_DOWN: Boolean = other.KEY_CAPS_LOCK_DOWN
|
||||
override var KEY_CAPS_LOCK_DURATION: Double = other.KEY_CAPS_LOCK_DURATION
|
||||
override var KEY_SCROLL_LOCK_DOWN: Boolean = other.KEY_SCROLL_LOCK_DOWN
|
||||
override var KEY_SCROLL_LOCK_DURATION: Double = other.KEY_SCROLL_LOCK_DURATION
|
||||
override var KEY_NUM_LOCK_DOWN: Boolean = other.KEY_NUM_LOCK_DOWN
|
||||
override var KEY_NUM_LOCK_DURATION: Double = other.KEY_NUM_LOCK_DURATION
|
||||
override var KEY_PRINT_SCREEN_DOWN: Boolean = other.KEY_PRINT_SCREEN_DOWN
|
||||
override var KEY_PRINT_SCREEN_DURATION: Double = other.KEY_PRINT_SCREEN_DURATION
|
||||
override var KEY_PAUSE_DOWN: Boolean = other.KEY_PAUSE_DOWN
|
||||
override var KEY_PAUSE_DURATION: Double = other.KEY_PAUSE_DURATION
|
||||
override var KEY_F1_DOWN: Boolean = other.KEY_F1_DOWN
|
||||
override var KEY_F1_DURATION: Double = other.KEY_F1_DURATION
|
||||
override var KEY_F2_DOWN: Boolean = other.KEY_F2_DOWN
|
||||
override var KEY_F2_DURATION: Double = other.KEY_F2_DURATION
|
||||
override var KEY_F3_DOWN: Boolean = other.KEY_F3_DOWN
|
||||
override var KEY_F3_DURATION: Double = other.KEY_F3_DURATION
|
||||
override var KEY_F4_DOWN: Boolean = other.KEY_F4_DOWN
|
||||
override var KEY_F4_DURATION: Double = other.KEY_F4_DURATION
|
||||
override var KEY_F5_DOWN: Boolean = other.KEY_F5_DOWN
|
||||
override var KEY_F5_DURATION: Double = other.KEY_F5_DURATION
|
||||
override var KEY_F6_DOWN: Boolean = other.KEY_F6_DOWN
|
||||
override var KEY_F6_DURATION: Double = other.KEY_F6_DURATION
|
||||
override var KEY_F7_DOWN: Boolean = other.KEY_F7_DOWN
|
||||
override var KEY_F7_DURATION: Double = other.KEY_F7_DURATION
|
||||
override var KEY_F8_DOWN: Boolean = other.KEY_F8_DOWN
|
||||
override var KEY_F8_DURATION: Double = other.KEY_F8_DURATION
|
||||
override var KEY_F9_DOWN: Boolean = other.KEY_F9_DOWN
|
||||
override var KEY_F9_DURATION: Double = other.KEY_F9_DURATION
|
||||
override var KEY_F10_DOWN: Boolean = other.KEY_F10_DOWN
|
||||
override var KEY_F10_DURATION: Double = other.KEY_F10_DURATION
|
||||
override var KEY_F11_DOWN: Boolean = other.KEY_F11_DOWN
|
||||
override var KEY_F11_DURATION: Double = other.KEY_F11_DURATION
|
||||
override var KEY_F12_DOWN: Boolean = other.KEY_F12_DOWN
|
||||
override var KEY_F12_DURATION: Double = other.KEY_F12_DURATION
|
||||
override var KEY_F13_DOWN: Boolean = other.KEY_F13_DOWN
|
||||
override var KEY_F13_DURATION: Double = other.KEY_F13_DURATION
|
||||
override var KEY_F14_DOWN: Boolean = other.KEY_F14_DOWN
|
||||
override var KEY_F14_DURATION: Double = other.KEY_F14_DURATION
|
||||
override var KEY_F15_DOWN: Boolean = other.KEY_F15_DOWN
|
||||
override var KEY_F15_DURATION: Double = other.KEY_F15_DURATION
|
||||
override var KEY_F16_DOWN: Boolean = other.KEY_F16_DOWN
|
||||
override var KEY_F16_DURATION: Double = other.KEY_F16_DURATION
|
||||
override var KEY_F17_DOWN: Boolean = other.KEY_F17_DOWN
|
||||
override var KEY_F17_DURATION: Double = other.KEY_F17_DURATION
|
||||
override var KEY_F18_DOWN: Boolean = other.KEY_F18_DOWN
|
||||
override var KEY_F18_DURATION: Double = other.KEY_F18_DURATION
|
||||
override var KEY_F19_DOWN: Boolean = other.KEY_F19_DOWN
|
||||
override var KEY_F19_DURATION: Double = other.KEY_F19_DURATION
|
||||
override var KEY_F20_DOWN: Boolean = other.KEY_F20_DOWN
|
||||
override var KEY_F20_DURATION: Double = other.KEY_F20_DURATION
|
||||
override var KEY_F21_DOWN: Boolean = other.KEY_F21_DOWN
|
||||
override var KEY_F21_DURATION: Double = other.KEY_F21_DURATION
|
||||
override var KEY_F22_DOWN: Boolean = other.KEY_F22_DOWN
|
||||
override var KEY_F22_DURATION: Double = other.KEY_F22_DURATION
|
||||
override var KEY_F23_DOWN: Boolean = other.KEY_F23_DOWN
|
||||
override var KEY_F23_DURATION: Double = other.KEY_F23_DURATION
|
||||
override var KEY_F24_DOWN: Boolean = other.KEY_F24_DOWN
|
||||
override var KEY_F24_DURATION: Double = other.KEY_F24_DURATION
|
||||
override var KEY_F25_DOWN: Boolean = other.KEY_F25_DOWN
|
||||
override var KEY_F25_DURATION: Double = other.KEY_F25_DURATION
|
||||
override var KEY_KP_0_DOWN: Boolean = other.KEY_KP_0_DOWN
|
||||
override var KEY_KP_0_DURATION: Double = other.KEY_KP_0_DURATION
|
||||
override var KEY_KP_1_DOWN: Boolean = other.KEY_KP_1_DOWN
|
||||
override var KEY_KP_1_DURATION: Double = other.KEY_KP_1_DURATION
|
||||
override var KEY_KP_2_DOWN: Boolean = other.KEY_KP_2_DOWN
|
||||
override var KEY_KP_2_DURATION: Double = other.KEY_KP_2_DURATION
|
||||
override var KEY_KP_3_DOWN: Boolean = other.KEY_KP_3_DOWN
|
||||
override var KEY_KP_3_DURATION: Double = other.KEY_KP_3_DURATION
|
||||
override var KEY_KP_4_DOWN: Boolean = other.KEY_KP_4_DOWN
|
||||
override var KEY_KP_4_DURATION: Double = other.KEY_KP_4_DURATION
|
||||
override var KEY_KP_5_DOWN: Boolean = other.KEY_KP_5_DOWN
|
||||
override var KEY_KP_5_DURATION: Double = other.KEY_KP_5_DURATION
|
||||
override var KEY_KP_6_DOWN: Boolean = other.KEY_KP_6_DOWN
|
||||
override var KEY_KP_6_DURATION: Double = other.KEY_KP_6_DURATION
|
||||
override var KEY_KP_7_DOWN: Boolean = other.KEY_KP_7_DOWN
|
||||
override var KEY_KP_7_DURATION: Double = other.KEY_KP_7_DURATION
|
||||
override var KEY_KP_8_DOWN: Boolean = other.KEY_KP_8_DOWN
|
||||
override var KEY_KP_8_DURATION: Double = other.KEY_KP_8_DURATION
|
||||
override var KEY_KP_9_DOWN: Boolean = other.KEY_KP_9_DOWN
|
||||
override var KEY_KP_9_DURATION: Double = other.KEY_KP_9_DURATION
|
||||
override var KEY_KP_DECIMAL_DOWN: Boolean = other.KEY_KP_DECIMAL_DOWN
|
||||
override var KEY_KP_DECIMAL_DURATION: Double = other.KEY_KP_DECIMAL_DURATION
|
||||
override var KEY_KP_DIVIDE_DOWN: Boolean = other.KEY_KP_DIVIDE_DOWN
|
||||
override var KEY_KP_DIVIDE_DURATION: Double = other.KEY_KP_DIVIDE_DURATION
|
||||
override var KEY_KP_MULTIPLY_DOWN: Boolean = other.KEY_KP_MULTIPLY_DOWN
|
||||
override var KEY_KP_MULTIPLY_DURATION: Double = other.KEY_KP_MULTIPLY_DURATION
|
||||
override var KEY_KP_SUBTRACT_DOWN: Boolean = other.KEY_KP_SUBTRACT_DOWN
|
||||
override var KEY_KP_SUBTRACT_DURATION: Double = other.KEY_KP_SUBTRACT_DURATION
|
||||
override var KEY_KP_ADD_DOWN: Boolean = other.KEY_KP_ADD_DOWN
|
||||
override var KEY_KP_ADD_DURATION: Double = other.KEY_KP_ADD_DURATION
|
||||
override var KEY_KP_ENTER_DOWN: Boolean = other.KEY_KP_ENTER_DOWN
|
||||
override var KEY_KP_ENTER_DURATION: Double = other.KEY_KP_ENTER_DURATION
|
||||
override var KEY_KP_EQUAL_DOWN: Boolean = other.KEY_KP_EQUAL_DOWN
|
||||
override var KEY_KP_EQUAL_DURATION: Double = other.KEY_KP_EQUAL_DURATION
|
||||
override var KEY_LEFT_SHIFT_DOWN: Boolean = other.KEY_LEFT_SHIFT_DOWN
|
||||
override var KEY_LEFT_SHIFT_DURATION: Double = other.KEY_LEFT_SHIFT_DURATION
|
||||
override var KEY_LEFT_CONTROL_DOWN: Boolean = other.KEY_LEFT_CONTROL_DOWN
|
||||
override var KEY_LEFT_CONTROL_DURATION: Double = other.KEY_LEFT_CONTROL_DURATION
|
||||
override var KEY_LEFT_ALT_DOWN: Boolean = other.KEY_LEFT_ALT_DOWN
|
||||
override var KEY_LEFT_ALT_DURATION: Double = other.KEY_LEFT_ALT_DURATION
|
||||
override var KEY_LEFT_SUPER_DOWN: Boolean = other.KEY_LEFT_SUPER_DOWN
|
||||
override var KEY_LEFT_SUPER_DURATION: Double = other.KEY_LEFT_SUPER_DURATION
|
||||
override var KEY_RIGHT_SHIFT_DOWN: Boolean = other.KEY_RIGHT_SHIFT_DOWN
|
||||
override var KEY_RIGHT_SHIFT_DURATION: Double = other.KEY_RIGHT_SHIFT_DURATION
|
||||
override var KEY_RIGHT_CONTROL_DOWN: Boolean = other.KEY_RIGHT_CONTROL_DOWN
|
||||
override var KEY_RIGHT_CONTROL_DURATION: Double = other.KEY_RIGHT_CONTROL_DURATION
|
||||
override var KEY_RIGHT_ALT_DOWN: Boolean = other.KEY_RIGHT_ALT_DOWN
|
||||
override var KEY_RIGHT_ALT_DURATION: Double = other.KEY_RIGHT_ALT_DURATION
|
||||
override var KEY_RIGHT_SUPER_DOWN: Boolean = other.KEY_RIGHT_SUPER_DOWN
|
||||
override var KEY_RIGHT_SUPER_DURATION: Double = other.KEY_RIGHT_SUPER_DURATION
|
||||
override var KEY_MENU_DOWN: Boolean = other.KEY_MENU_DOWN
|
||||
override var KEY_MENU_DURATION: Double = other.KEY_MENU_DURATION
|
||||
override var KEY_LAST_DOWN: Boolean = other.KEY_LAST_DOWN
|
||||
override var KEY_LAST_DURATION: Double = other.KEY_LAST_DURATION
|
||||
override var MOUSE_BUTTON_1_DOWN: Boolean = other.MOUSE_BUTTON_1_DOWN
|
||||
override var MOUSE_BUTTON_1_DURATION: Double = other.MOUSE_BUTTON_1_DURATION
|
||||
override var MOUSE_BUTTON_2_DOWN: Boolean = other.MOUSE_BUTTON_2_DOWN
|
||||
override var MOUSE_BUTTON_2_DURATION: Double = other.MOUSE_BUTTON_2_DURATION
|
||||
override var MOUSE_BUTTON_3_DOWN: Boolean = other.MOUSE_BUTTON_3_DOWN
|
||||
override var MOUSE_BUTTON_3_DURATION: Double = other.MOUSE_BUTTON_3_DURATION
|
||||
override var MOUSE_BUTTON_4_DOWN: Boolean = other.MOUSE_BUTTON_4_DOWN
|
||||
override var MOUSE_BUTTON_4_DURATION: Double = other.MOUSE_BUTTON_4_DURATION
|
||||
override var MOUSE_BUTTON_5_DOWN: Boolean = other.MOUSE_BUTTON_5_DOWN
|
||||
override var MOUSE_BUTTON_5_DURATION: Double = other.MOUSE_BUTTON_5_DURATION
|
||||
override var MOUSE_BUTTON_6_DOWN: Boolean = other.MOUSE_BUTTON_6_DOWN
|
||||
override var MOUSE_BUTTON_6_DURATION: Double = other.MOUSE_BUTTON_6_DURATION
|
||||
override var MOUSE_BUTTON_7_DOWN: Boolean = other.MOUSE_BUTTON_7_DOWN
|
||||
override var MOUSE_BUTTON_7_DURATION: Double = other.MOUSE_BUTTON_7_DURATION
|
||||
override var MOUSE_BUTTON_8_DOWN: Boolean = other.MOUSE_BUTTON_8_DOWN
|
||||
override var MOUSE_BUTTON_8_DURATION: Double = other.MOUSE_BUTTON_8_DURATION
|
||||
|
||||
|
||||
override var KEY_SPACE_PRESSED: Boolean = other.KEY_SPACE_PRESSED
|
||||
override var KEY_APOSTROPHE_PRESSED: Boolean = other.KEY_APOSTROPHE_PRESSED
|
||||
override var KEY_COMMA_PRESSED: Boolean = other.KEY_COMMA_PRESSED
|
||||
override var KEY_MINUS_PRESSED: Boolean = other.KEY_MINUS_PRESSED
|
||||
override var KEY_PERIOD_PRESSED: Boolean = other.KEY_PERIOD_PRESSED
|
||||
override var KEY_SLASH_PRESSED: Boolean = other.KEY_SLASH_PRESSED
|
||||
override var KEY_0_PRESSED: Boolean = other.KEY_0_PRESSED
|
||||
override var KEY_1_PRESSED: Boolean = other.KEY_1_PRESSED
|
||||
override var KEY_2_PRESSED: Boolean = other.KEY_2_PRESSED
|
||||
override var KEY_3_PRESSED: Boolean = other.KEY_3_PRESSED
|
||||
override var KEY_4_PRESSED: Boolean = other.KEY_4_PRESSED
|
||||
override var KEY_5_PRESSED: Boolean = other.KEY_5_PRESSED
|
||||
override var KEY_6_PRESSED: Boolean = other.KEY_6_PRESSED
|
||||
override var KEY_7_PRESSED: Boolean = other.KEY_7_PRESSED
|
||||
override var KEY_8_PRESSED: Boolean = other.KEY_8_PRESSED
|
||||
override var KEY_9_PRESSED: Boolean = other.KEY_9_PRESSED
|
||||
override var KEY_SEMICOLON_PRESSED: Boolean = other.KEY_SEMICOLON_PRESSED
|
||||
override var KEY_EQUAL_PRESSED: Boolean = other.KEY_EQUAL_PRESSED
|
||||
override var KEY_A_PRESSED: Boolean = other.KEY_A_PRESSED
|
||||
override var KEY_B_PRESSED: Boolean = other.KEY_B_PRESSED
|
||||
override var KEY_C_PRESSED: Boolean = other.KEY_C_PRESSED
|
||||
override var KEY_D_PRESSED: Boolean = other.KEY_D_PRESSED
|
||||
override var KEY_E_PRESSED: Boolean = other.KEY_E_PRESSED
|
||||
override var KEY_F_PRESSED: Boolean = other.KEY_F_PRESSED
|
||||
override var KEY_G_PRESSED: Boolean = other.KEY_G_PRESSED
|
||||
override var KEY_H_PRESSED: Boolean = other.KEY_H_PRESSED
|
||||
override var KEY_I_PRESSED: Boolean = other.KEY_I_PRESSED
|
||||
override var KEY_J_PRESSED: Boolean = other.KEY_J_PRESSED
|
||||
override var KEY_K_PRESSED: Boolean = other.KEY_K_PRESSED
|
||||
override var KEY_L_PRESSED: Boolean = other.KEY_L_PRESSED
|
||||
override var KEY_M_PRESSED: Boolean = other.KEY_M_PRESSED
|
||||
override var KEY_N_PRESSED: Boolean = other.KEY_N_PRESSED
|
||||
override var KEY_O_PRESSED: Boolean = other.KEY_O_PRESSED
|
||||
override var KEY_P_PRESSED: Boolean = other.KEY_P_PRESSED
|
||||
override var KEY_Q_PRESSED: Boolean = other.KEY_Q_PRESSED
|
||||
override var KEY_R_PRESSED: Boolean = other.KEY_R_PRESSED
|
||||
override var KEY_S_PRESSED: Boolean = other.KEY_S_PRESSED
|
||||
override var KEY_T_PRESSED: Boolean = other.KEY_T_PRESSED
|
||||
override var KEY_U_PRESSED: Boolean = other.KEY_U_PRESSED
|
||||
override var KEY_V_PRESSED: Boolean = other.KEY_V_PRESSED
|
||||
override var KEY_W_PRESSED: Boolean = other.KEY_W_PRESSED
|
||||
override var KEY_X_PRESSED: Boolean = other.KEY_X_PRESSED
|
||||
override var KEY_Y_PRESSED: Boolean = other.KEY_Y_PRESSED
|
||||
override var KEY_Z_PRESSED: Boolean = other.KEY_Z_PRESSED
|
||||
override var KEY_LEFT_BRACKET_PRESSED: Boolean = other.KEY_LEFT_BRACKET_PRESSED
|
||||
override var KEY_BACKSLASH_PRESSED: Boolean = other.KEY_BACKSLASH_PRESSED
|
||||
override var KEY_RIGHT_BRACKET_PRESSED: Boolean = other.KEY_RIGHT_BRACKET_PRESSED
|
||||
override var KEY_GRAVE_ACCENT_PRESSED: Boolean = other.KEY_GRAVE_ACCENT_PRESSED
|
||||
override var KEY_WORLD_1_PRESSED: Boolean = other.KEY_WORLD_1_PRESSED
|
||||
override var KEY_WORLD_2_PRESSED: Boolean = other.KEY_WORLD_2_PRESSED
|
||||
|
||||
override var KEY_ESCAPE_PRESSED: Boolean = other.KEY_ESCAPE_PRESSED
|
||||
override var KEY_ENTER_PRESSED: Boolean = other.KEY_ENTER_PRESSED
|
||||
override var KEY_TAB_PRESSED: Boolean = other.KEY_TAB_PRESSED
|
||||
override var KEY_BACKSPACE_PRESSED: Boolean = other.KEY_BACKSPACE_PRESSED
|
||||
override var KEY_INSERT_PRESSED: Boolean = other.KEY_INSERT_PRESSED
|
||||
override var KEY_DELETE_PRESSED: Boolean = other.KEY_DELETE_PRESSED
|
||||
override var KEY_RIGHT_PRESSED: Boolean = other.KEY_RIGHT_PRESSED
|
||||
override var KEY_LEFT_PRESSED: Boolean = other.KEY_LEFT_PRESSED
|
||||
override var KEY_DOWN_PRESSED: Boolean = other.KEY_DOWN_PRESSED
|
||||
override var KEY_UP_PRESSED: Boolean = other.KEY_UP_PRESSED
|
||||
override var KEY_PAGE_UP_PRESSED: Boolean = other.KEY_PAGE_UP_PRESSED
|
||||
override var KEY_PAGE_DOWN_PRESSED: Boolean = other.KEY_PAGE_DOWN_PRESSED
|
||||
override var KEY_HOME_PRESSED: Boolean = other.KEY_HOME_PRESSED
|
||||
override var KEY_END_PRESSED: Boolean = other.KEY_END_PRESSED
|
||||
override var KEY_CAPS_LOCK_PRESSED: Boolean = other.KEY_CAPS_LOCK_PRESSED
|
||||
override var KEY_SCROLL_LOCK_PRESSED: Boolean = other.KEY_SCROLL_LOCK_PRESSED
|
||||
override var KEY_NUM_LOCK_PRESSED: Boolean = other.KEY_NUM_LOCK_PRESSED
|
||||
override var KEY_PRINT_SCREEN_PRESSED: Boolean = other.KEY_PRINT_SCREEN_PRESSED
|
||||
override var KEY_PAUSE_PRESSED: Boolean = other.KEY_PAUSE_PRESSED
|
||||
override var KEY_F1_PRESSED: Boolean = other.KEY_F1_PRESSED
|
||||
override var KEY_F2_PRESSED: Boolean = other.KEY_F2_PRESSED
|
||||
override var KEY_F3_PRESSED: Boolean = other.KEY_F3_PRESSED
|
||||
override var KEY_F4_PRESSED: Boolean = other.KEY_F4_PRESSED
|
||||
override var KEY_F5_PRESSED: Boolean = other.KEY_F5_PRESSED
|
||||
override var KEY_F6_PRESSED: Boolean = other.KEY_F6_PRESSED
|
||||
override var KEY_F7_PRESSED: Boolean = other.KEY_F7_PRESSED
|
||||
override var KEY_F8_PRESSED: Boolean = other.KEY_F8_PRESSED
|
||||
override var KEY_F9_PRESSED: Boolean = other.KEY_F9_PRESSED
|
||||
override var KEY_F10_PRESSED: Boolean = other.KEY_F10_PRESSED
|
||||
override var KEY_F11_PRESSED: Boolean = other.KEY_F11_PRESSED
|
||||
override var KEY_F12_PRESSED: Boolean = other.KEY_F12_PRESSED
|
||||
override var KEY_F13_PRESSED: Boolean = other.KEY_F13_PRESSED
|
||||
override var KEY_F14_PRESSED: Boolean = other.KEY_F14_PRESSED
|
||||
override var KEY_F15_PRESSED: Boolean = other.KEY_F15_PRESSED
|
||||
override var KEY_F16_PRESSED: Boolean = other.KEY_F16_PRESSED
|
||||
override var KEY_F17_PRESSED: Boolean = other.KEY_F17_PRESSED
|
||||
override var KEY_F18_PRESSED: Boolean = other.KEY_F18_PRESSED
|
||||
override var KEY_F19_PRESSED: Boolean = other.KEY_F19_PRESSED
|
||||
override var KEY_F20_PRESSED: Boolean = other.KEY_F20_PRESSED
|
||||
override var KEY_F21_PRESSED: Boolean = other.KEY_F21_PRESSED
|
||||
override var KEY_F22_PRESSED: Boolean = other.KEY_F22_PRESSED
|
||||
override var KEY_F23_PRESSED: Boolean = other.KEY_F23_PRESSED
|
||||
override var KEY_F24_PRESSED: Boolean = other.KEY_F24_PRESSED
|
||||
override var KEY_F25_PRESSED: Boolean = other.KEY_F25_PRESSED
|
||||
override var KEY_KP_0_PRESSED: Boolean = other.KEY_KP_0_PRESSED
|
||||
override var KEY_KP_1_PRESSED: Boolean = other.KEY_KP_1_PRESSED
|
||||
override var KEY_KP_2_PRESSED: Boolean = other.KEY_KP_2_PRESSED
|
||||
override var KEY_KP_3_PRESSED: Boolean = other.KEY_KP_3_PRESSED
|
||||
override var KEY_KP_4_PRESSED: Boolean = other.KEY_KP_4_PRESSED
|
||||
override var KEY_KP_5_PRESSED: Boolean = other.KEY_KP_5_PRESSED
|
||||
override var KEY_KP_6_PRESSED: Boolean = other.KEY_KP_6_PRESSED
|
||||
override var KEY_KP_7_PRESSED: Boolean = other.KEY_KP_7_PRESSED
|
||||
override var KEY_KP_8_PRESSED: Boolean = other.KEY_KP_8_PRESSED
|
||||
override var KEY_KP_9_PRESSED: Boolean = other.KEY_KP_9_PRESSED
|
||||
override var KEY_KP_DECIMAL_PRESSED: Boolean = other.KEY_KP_DECIMAL_PRESSED
|
||||
override var KEY_KP_DIVIDE_PRESSED: Boolean = other.KEY_KP_DIVIDE_PRESSED
|
||||
override var KEY_KP_MULTIPLY_PRESSED: Boolean = other.KEY_KP_MULTIPLY_PRESSED
|
||||
override var KEY_KP_SUBTRACT_PRESSED: Boolean = other.KEY_KP_SUBTRACT_PRESSED
|
||||
override var KEY_KP_ADD_PRESSED: Boolean = other.KEY_KP_ADD_PRESSED
|
||||
override var KEY_KP_ENTER_PRESSED: Boolean = other.KEY_KP_ENTER_PRESSED
|
||||
override var KEY_KP_EQUAL_PRESSED: Boolean = other.KEY_KP_EQUAL_PRESSED
|
||||
override var KEY_LEFT_SHIFT_PRESSED: Boolean = other.KEY_LEFT_SHIFT_PRESSED
|
||||
override var KEY_LEFT_CONTROL_PRESSED: Boolean = other.KEY_LEFT_CONTROL_PRESSED
|
||||
override var KEY_LEFT_ALT_PRESSED: Boolean = other.KEY_LEFT_ALT_PRESSED
|
||||
override var KEY_LEFT_SUPER_PRESSED: Boolean = other.KEY_LEFT_SUPER_PRESSED
|
||||
override var KEY_RIGHT_SHIFT_PRESSED: Boolean = other.KEY_RIGHT_SHIFT_PRESSED
|
||||
override var KEY_RIGHT_CONTROL_PRESSED: Boolean = other.KEY_RIGHT_CONTROL_PRESSED
|
||||
override var KEY_RIGHT_ALT_PRESSED: Boolean = other.KEY_RIGHT_ALT_PRESSED
|
||||
override var KEY_RIGHT_SUPER_PRESSED: Boolean = other.KEY_RIGHT_SUPER_PRESSED
|
||||
override var KEY_MENU_PRESSED: Boolean = other.KEY_MENU_PRESSED
|
||||
override var KEY_LAST_PRESSED: Boolean = other.KEY_LAST_PRESSED
|
||||
|
||||
override var KEY_SPACE_RELEASED: Boolean = other.KEY_SPACE_RELEASED
|
||||
override var KEY_APOSTROPHE_RELEASED: Boolean = other.KEY_APOSTROPHE_RELEASED
|
||||
override var KEY_COMMA_RELEASED: Boolean = other.KEY_COMMA_RELEASED
|
||||
override var KEY_MINUS_RELEASED: Boolean = other.KEY_MINUS_RELEASED
|
||||
override var KEY_PERIOD_RELEASED: Boolean = other.KEY_PERIOD_RELEASED
|
||||
override var KEY_SLASH_RELEASED: Boolean = other.KEY_SLASH_RELEASED
|
||||
override var KEY_0_RELEASED: Boolean = other.KEY_0_RELEASED
|
||||
override var KEY_1_RELEASED: Boolean = other.KEY_1_RELEASED
|
||||
override var KEY_2_RELEASED: Boolean = other.KEY_2_RELEASED
|
||||
override var KEY_3_RELEASED: Boolean = other.KEY_3_RELEASED
|
||||
override var KEY_4_RELEASED: Boolean = other.KEY_4_RELEASED
|
||||
override var KEY_5_RELEASED: Boolean = other.KEY_5_RELEASED
|
||||
override var KEY_6_RELEASED: Boolean = other.KEY_6_RELEASED
|
||||
override var KEY_7_RELEASED: Boolean = other.KEY_7_RELEASED
|
||||
override var KEY_8_RELEASED: Boolean = other.KEY_8_RELEASED
|
||||
override var KEY_9_RELEASED: Boolean = other.KEY_9_RELEASED
|
||||
override var KEY_SEMICOLON_RELEASED: Boolean = other.KEY_SEMICOLON_RELEASED
|
||||
override var KEY_EQUAL_RELEASED: Boolean = other.KEY_EQUAL_RELEASED
|
||||
override var KEY_A_RELEASED: Boolean = other.KEY_A_RELEASED
|
||||
override var KEY_B_RELEASED: Boolean = other.KEY_B_RELEASED
|
||||
override var KEY_C_RELEASED: Boolean = other.KEY_C_RELEASED
|
||||
override var KEY_D_RELEASED: Boolean = other.KEY_D_RELEASED
|
||||
override var KEY_E_RELEASED: Boolean = other.KEY_E_RELEASED
|
||||
override var KEY_F_RELEASED: Boolean = other.KEY_F_RELEASED
|
||||
override var KEY_G_RELEASED: Boolean = other.KEY_G_RELEASED
|
||||
override var KEY_H_RELEASED: Boolean = other.KEY_H_RELEASED
|
||||
override var KEY_I_RELEASED: Boolean = other.KEY_I_RELEASED
|
||||
override var KEY_J_RELEASED: Boolean = other.KEY_J_RELEASED
|
||||
override var KEY_K_RELEASED: Boolean = other.KEY_K_RELEASED
|
||||
override var KEY_L_RELEASED: Boolean = other.KEY_L_RELEASED
|
||||
override var KEY_M_RELEASED: Boolean = other.KEY_M_RELEASED
|
||||
override var KEY_N_RELEASED: Boolean = other.KEY_N_RELEASED
|
||||
override var KEY_O_RELEASED: Boolean = other.KEY_O_RELEASED
|
||||
override var KEY_P_RELEASED: Boolean = other.KEY_P_RELEASED
|
||||
override var KEY_Q_RELEASED: Boolean = other.KEY_Q_RELEASED
|
||||
override var KEY_R_RELEASED: Boolean = other.KEY_R_RELEASED
|
||||
override var KEY_S_RELEASED: Boolean = other.KEY_S_RELEASED
|
||||
override var KEY_T_RELEASED: Boolean = other.KEY_T_RELEASED
|
||||
override var KEY_U_RELEASED: Boolean = other.KEY_U_RELEASED
|
||||
override var KEY_V_RELEASED: Boolean = other.KEY_V_RELEASED
|
||||
override var KEY_W_RELEASED: Boolean = other.KEY_W_RELEASED
|
||||
override var KEY_X_RELEASED: Boolean = other.KEY_X_RELEASED
|
||||
override var KEY_Y_RELEASED: Boolean = other.KEY_Y_RELEASED
|
||||
override var KEY_Z_RELEASED: Boolean = other.KEY_Z_RELEASED
|
||||
override var KEY_LEFT_BRACKET_RELEASED: Boolean = other.KEY_LEFT_BRACKET_RELEASED
|
||||
override var KEY_BACKSLASH_RELEASED: Boolean = other.KEY_BACKSLASH_RELEASED
|
||||
override var KEY_RIGHT_BRACKET_RELEASED: Boolean = other.KEY_RIGHT_BRACKET_RELEASED
|
||||
override var KEY_GRAVE_ACCENT_RELEASED: Boolean = other.KEY_GRAVE_ACCENT_RELEASED
|
||||
override var KEY_WORLD_1_RELEASED: Boolean = other.KEY_WORLD_1_RELEASED
|
||||
override var KEY_WORLD_2_RELEASED: Boolean = other.KEY_WORLD_2_RELEASED
|
||||
|
||||
override var KEY_ESCAPE_RELEASED: Boolean = other.KEY_ESCAPE_RELEASED
|
||||
override var KEY_ENTER_RELEASED: Boolean = other.KEY_ENTER_RELEASED
|
||||
override var KEY_TAB_RELEASED: Boolean = other.KEY_TAB_RELEASED
|
||||
override var KEY_BACKSPACE_RELEASED: Boolean = other.KEY_BACKSPACE_RELEASED
|
||||
override var KEY_INSERT_RELEASED: Boolean = other.KEY_INSERT_RELEASED
|
||||
override var KEY_DELETE_RELEASED: Boolean = other.KEY_DELETE_RELEASED
|
||||
override var KEY_RIGHT_RELEASED: Boolean = other.KEY_RIGHT_RELEASED
|
||||
override var KEY_LEFT_RELEASED: Boolean = other.KEY_LEFT_RELEASED
|
||||
override var KEY_DOWN_RELEASED: Boolean = other.KEY_DOWN_RELEASED
|
||||
override var KEY_UP_RELEASED: Boolean = other.KEY_UP_RELEASED
|
||||
override var KEY_PAGE_UP_RELEASED: Boolean = other.KEY_PAGE_UP_RELEASED
|
||||
override var KEY_PAGE_DOWN_RELEASED: Boolean = other.KEY_PAGE_DOWN_RELEASED
|
||||
override var KEY_HOME_RELEASED: Boolean = other.KEY_HOME_RELEASED
|
||||
override var KEY_END_RELEASED: Boolean = other.KEY_END_RELEASED
|
||||
override var KEY_CAPS_LOCK_RELEASED: Boolean = other.KEY_CAPS_LOCK_RELEASED
|
||||
override var KEY_SCROLL_LOCK_RELEASED: Boolean = other.KEY_SCROLL_LOCK_RELEASED
|
||||
override var KEY_NUM_LOCK_RELEASED: Boolean = other.KEY_NUM_LOCK_RELEASED
|
||||
override var KEY_PRINT_SCREEN_RELEASED: Boolean = other.KEY_PRINT_SCREEN_RELEASED
|
||||
override var KEY_PAUSE_RELEASED: Boolean = other.KEY_PAUSE_RELEASED
|
||||
override var KEY_F1_RELEASED: Boolean = other.KEY_F1_RELEASED
|
||||
override var KEY_F2_RELEASED: Boolean = other.KEY_F2_RELEASED
|
||||
override var KEY_F3_RELEASED: Boolean = other.KEY_F3_RELEASED
|
||||
override var KEY_F4_RELEASED: Boolean = other.KEY_F4_RELEASED
|
||||
override var KEY_F5_RELEASED: Boolean = other.KEY_F5_RELEASED
|
||||
override var KEY_F6_RELEASED: Boolean = other.KEY_F6_RELEASED
|
||||
override var KEY_F7_RELEASED: Boolean = other.KEY_F7_RELEASED
|
||||
override var KEY_F8_RELEASED: Boolean = other.KEY_F8_RELEASED
|
||||
override var KEY_F9_RELEASED: Boolean = other.KEY_F9_RELEASED
|
||||
override var KEY_F10_RELEASED: Boolean = other.KEY_F10_RELEASED
|
||||
override var KEY_F11_RELEASED: Boolean = other.KEY_F11_RELEASED
|
||||
override var KEY_F12_RELEASED: Boolean = other.KEY_F12_RELEASED
|
||||
override var KEY_F13_RELEASED: Boolean = other.KEY_F13_RELEASED
|
||||
override var KEY_F14_RELEASED: Boolean = other.KEY_F14_RELEASED
|
||||
override var KEY_F15_RELEASED: Boolean = other.KEY_F15_RELEASED
|
||||
override var KEY_F16_RELEASED: Boolean = other.KEY_F16_RELEASED
|
||||
override var KEY_F17_RELEASED: Boolean = other.KEY_F17_RELEASED
|
||||
override var KEY_F18_RELEASED: Boolean = other.KEY_F18_RELEASED
|
||||
override var KEY_F19_RELEASED: Boolean = other.KEY_F19_RELEASED
|
||||
override var KEY_F20_RELEASED: Boolean = other.KEY_F20_RELEASED
|
||||
override var KEY_F21_RELEASED: Boolean = other.KEY_F21_RELEASED
|
||||
override var KEY_F22_RELEASED: Boolean = other.KEY_F22_RELEASED
|
||||
override var KEY_F23_RELEASED: Boolean = other.KEY_F23_RELEASED
|
||||
override var KEY_F24_RELEASED: Boolean = other.KEY_F24_RELEASED
|
||||
override var KEY_F25_RELEASED: Boolean = other.KEY_F25_RELEASED
|
||||
override var KEY_KP_0_RELEASED: Boolean = other.KEY_KP_0_RELEASED
|
||||
override var KEY_KP_1_RELEASED: Boolean = other.KEY_KP_1_RELEASED
|
||||
override var KEY_KP_2_RELEASED: Boolean = other.KEY_KP_2_RELEASED
|
||||
override var KEY_KP_3_RELEASED: Boolean = other.KEY_KP_3_RELEASED
|
||||
override var KEY_KP_4_RELEASED: Boolean = other.KEY_KP_4_RELEASED
|
||||
override var KEY_KP_5_RELEASED: Boolean = other.KEY_KP_5_RELEASED
|
||||
override var KEY_KP_6_RELEASED: Boolean = other.KEY_KP_6_RELEASED
|
||||
override var KEY_KP_7_RELEASED: Boolean = other.KEY_KP_7_RELEASED
|
||||
override var KEY_KP_8_RELEASED: Boolean = other.KEY_KP_8_RELEASED
|
||||
override var KEY_KP_9_RELEASED: Boolean = other.KEY_KP_9_RELEASED
|
||||
override var KEY_KP_DECIMAL_RELEASED: Boolean = other.KEY_KP_DECIMAL_RELEASED
|
||||
override var KEY_KP_DIVIDE_RELEASED: Boolean = other.KEY_KP_DIVIDE_RELEASED
|
||||
override var KEY_KP_MULTIPLY_RELEASED: Boolean = other.KEY_KP_MULTIPLY_RELEASED
|
||||
override var KEY_KP_SUBTRACT_RELEASED: Boolean = other.KEY_KP_SUBTRACT_RELEASED
|
||||
override var KEY_KP_ADD_RELEASED: Boolean = other.KEY_KP_ADD_RELEASED
|
||||
override var KEY_KP_ENTER_RELEASED: Boolean = other.KEY_KP_ENTER_RELEASED
|
||||
override var KEY_KP_EQUAL_RELEASED: Boolean = other.KEY_KP_EQUAL_RELEASED
|
||||
override var KEY_LEFT_SHIFT_RELEASED: Boolean = other.KEY_LEFT_SHIFT_RELEASED
|
||||
override var KEY_LEFT_CONTROL_RELEASED: Boolean = other.KEY_LEFT_CONTROL_RELEASED
|
||||
override var KEY_LEFT_ALT_RELEASED: Boolean = other.KEY_LEFT_ALT_RELEASED
|
||||
override var KEY_LEFT_SUPER_RELEASED: Boolean = other.KEY_LEFT_SUPER_RELEASED
|
||||
override var KEY_RIGHT_SHIFT_RELEASED: Boolean = other.KEY_RIGHT_SHIFT_RELEASED
|
||||
override var KEY_RIGHT_CONTROL_RELEASED: Boolean = other.KEY_RIGHT_CONTROL_RELEASED
|
||||
override var KEY_RIGHT_ALT_RELEASED: Boolean = other.KEY_RIGHT_ALT_RELEASED
|
||||
override var KEY_RIGHT_SUPER_RELEASED: Boolean = other.KEY_RIGHT_SUPER_RELEASED
|
||||
override var KEY_MENU_RELEASED: Boolean = other.KEY_MENU_RELEASED
|
||||
override var KEY_LAST_RELEASED: Boolean = other.KEY_LAST_RELEASED
|
||||
|
||||
|
||||
override var MOUSE_BUTTON_1_RELEASED: Boolean = other.MOUSE_BUTTON_1_RELEASED
|
||||
override var MOUSE_BUTTON_2_RELEASED: Boolean = other.MOUSE_BUTTON_2_RELEASED
|
||||
override var MOUSE_BUTTON_3_RELEASED: Boolean = other.MOUSE_BUTTON_3_RELEASED
|
||||
override var MOUSE_BUTTON_4_RELEASED: Boolean = other.MOUSE_BUTTON_4_RELEASED
|
||||
override var MOUSE_BUTTON_5_RELEASED: Boolean = other.MOUSE_BUTTON_5_RELEASED
|
||||
override var MOUSE_BUTTON_6_RELEASED: Boolean = other.MOUSE_BUTTON_6_RELEASED
|
||||
override var MOUSE_BUTTON_7_RELEASED: Boolean = other.MOUSE_BUTTON_7_RELEASED
|
||||
override var MOUSE_BUTTON_8_RELEASED: Boolean = other.MOUSE_BUTTON_8_RELEASED
|
||||
|
||||
override var MOUSE_BUTTON_1_PRESSED: Boolean = other.MOUSE_BUTTON_1_PRESSED
|
||||
override var MOUSE_BUTTON_2_PRESSED: Boolean = other.MOUSE_BUTTON_2_PRESSED
|
||||
override var MOUSE_BUTTON_3_PRESSED: Boolean = other.MOUSE_BUTTON_3_PRESSED
|
||||
override var MOUSE_BUTTON_4_PRESSED: Boolean = other.MOUSE_BUTTON_4_PRESSED
|
||||
override var MOUSE_BUTTON_5_PRESSED: Boolean = other.MOUSE_BUTTON_5_PRESSED
|
||||
override var MOUSE_BUTTON_6_PRESSED: Boolean = other.MOUSE_BUTTON_6_PRESSED
|
||||
override var MOUSE_BUTTON_7_PRESSED: Boolean = other.MOUSE_BUTTON_7_PRESSED
|
||||
override var MOUSE_BUTTON_8_PRESSED: Boolean = other.MOUSE_BUTTON_8_PRESSED
|
||||
}
|
@ -0,0 +1,817 @@
|
||||
package ru.dbotthepony.kstarbound.client.input
|
||||
|
||||
import org.apache.logging.log4j.LogManager
|
||||
import org.lwjgl.glfw.GLFW.*
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
private interface IsHeldDown {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean
|
||||
}
|
||||
|
||||
private interface HowLongHeldDown {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>?): Double
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
class UserInput : IUserInput {
|
||||
fun keyPressed(code: Int) {
|
||||
// println("Key press! $code")
|
||||
}
|
||||
|
||||
fun keyReleased(code: Int, howLongHeldDown: Double) {
|
||||
// println("Key release! $code helt for $howLongHeldDown")
|
||||
}
|
||||
|
||||
fun keyHeldDown(code: Int, delta: Double, howLongHeldDown: Double) {
|
||||
|
||||
}
|
||||
|
||||
private val userKeys = ArrayList<UserKey>()
|
||||
|
||||
private inner class UserKey(val code: Int, val name: String, private val isKeyboard: Boolean = true) {
|
||||
init {
|
||||
userKeys.add(this)
|
||||
}
|
||||
|
||||
private var pressed = false
|
||||
private var pressedRightAway = 0
|
||||
private var depressedRightAway = 0
|
||||
|
||||
private var pressedSince = 0.0
|
||||
private var lastHeldDownCall = 0.0
|
||||
private var counter = 0.0
|
||||
|
||||
val delegatePressed = object : IsHeldDown {
|
||||
override fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean {
|
||||
return pressed
|
||||
}
|
||||
}
|
||||
|
||||
val delegatePressedRightAway = object : IsHeldDown {
|
||||
override fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean {
|
||||
return pressedRightAway > 0
|
||||
}
|
||||
}
|
||||
|
||||
val delegateDepressedRightAway = object : IsHeldDown {
|
||||
override fun getValue(thisRef: Any?, property: KProperty<*>?): Boolean {
|
||||
return depressedRightAway > 0
|
||||
}
|
||||
}
|
||||
|
||||
val delegateHowLong = object : HowLongHeldDown {
|
||||
override fun getValue(thisRef: Any?, property: KProperty<*>?): Double {
|
||||
if (!pressed)
|
||||
return 0.0
|
||||
|
||||
return counter
|
||||
}
|
||||
}
|
||||
|
||||
fun updateState(state: Int) {
|
||||
when (state) {
|
||||
GLFW_PRESS -> updateState(true)
|
||||
GLFW_RELEASE -> updateState(false)
|
||||
GLFW_REPEAT -> {
|
||||
//updateState(false)
|
||||
updateState(true)
|
||||
//println("Repeat! $name")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updateState(state: Boolean) {
|
||||
if (pressed == state)
|
||||
return
|
||||
|
||||
if (state) {
|
||||
pressedRightAway = 2
|
||||
lastHeldDownCall = glfwGetTime()
|
||||
pressedSince = glfwGetTime()
|
||||
counter = 0.0
|
||||
} else {
|
||||
depressedRightAway = 2
|
||||
}
|
||||
|
||||
if (isKeyboard) {
|
||||
if (pressed) {
|
||||
keyReleased(code, glfwGetTime() - pressedSince)
|
||||
} else {
|
||||
keyPressed(code)
|
||||
}
|
||||
}
|
||||
|
||||
pressed = state
|
||||
}
|
||||
|
||||
fun think(delta: Double, thisTime: Double) {
|
||||
pressedRightAway--
|
||||
depressedRightAway--
|
||||
|
||||
if (pressed) {
|
||||
counter += delta
|
||||
|
||||
if (isKeyboard) {
|
||||
keyHeldDown(code, delta, thisTime - pressedSince)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun callChange(key: Int, action: Int) {
|
||||
val mappedKey = keyMap[key]
|
||||
|
||||
if (mappedKey == null) {
|
||||
LOGGER.warn("No key handling registered for $key!")
|
||||
return
|
||||
}
|
||||
|
||||
mappedKey.updateState(action)
|
||||
}
|
||||
|
||||
fun installCallback(window: Long) {
|
||||
glfwSetKeyCallback(window) { _, key, scancode, action, mods ->
|
||||
callChange(key, action)
|
||||
}
|
||||
}
|
||||
|
||||
private var lastTick = 0.0
|
||||
|
||||
fun think() {
|
||||
val thisTime = glfwGetTime()
|
||||
val delta = thisTime - lastTick
|
||||
lastTick = thisTime
|
||||
|
||||
for (key in userKeys) {
|
||||
key.think(delta, thisTime)
|
||||
}
|
||||
}
|
||||
|
||||
private val keyMap = mapOf(
|
||||
GLFW_KEY_SPACE to UserKey(GLFW_KEY_SPACE, "KEY_SPACE"),
|
||||
GLFW_KEY_APOSTROPHE to UserKey(GLFW_KEY_APOSTROPHE, "KEY_APOSTROPHE"),
|
||||
GLFW_KEY_COMMA to UserKey(GLFW_KEY_COMMA, "KEY_COMMA"),
|
||||
GLFW_KEY_MINUS to UserKey(GLFW_KEY_MINUS, "KEY_MINUS"),
|
||||
GLFW_KEY_PERIOD to UserKey(GLFW_KEY_PERIOD, "KEY_PERIOD"),
|
||||
GLFW_KEY_SLASH to UserKey(GLFW_KEY_SLASH, "KEY_SLASH"),
|
||||
GLFW_KEY_0 to UserKey(GLFW_KEY_0, "KEY_0"),
|
||||
GLFW_KEY_1 to UserKey(GLFW_KEY_1, "KEY_1"),
|
||||
GLFW_KEY_2 to UserKey(GLFW_KEY_2, "KEY_2"),
|
||||
GLFW_KEY_3 to UserKey(GLFW_KEY_3, "KEY_3"),
|
||||
GLFW_KEY_4 to UserKey(GLFW_KEY_4, "KEY_4"),
|
||||
GLFW_KEY_5 to UserKey(GLFW_KEY_5, "KEY_5"),
|
||||
GLFW_KEY_6 to UserKey(GLFW_KEY_6, "KEY_6"),
|
||||
GLFW_KEY_7 to UserKey(GLFW_KEY_7, "KEY_7"),
|
||||
GLFW_KEY_8 to UserKey(GLFW_KEY_8, "KEY_8"),
|
||||
GLFW_KEY_9 to UserKey(GLFW_KEY_9, "KEY_9"),
|
||||
GLFW_KEY_SEMICOLON to UserKey(GLFW_KEY_SEMICOLON, "KEY_SEMICOLON"),
|
||||
GLFW_KEY_EQUAL to UserKey(GLFW_KEY_EQUAL, "KEY_EQUAL"),
|
||||
GLFW_KEY_A to UserKey(GLFW_KEY_A, "KEY_A"),
|
||||
GLFW_KEY_B to UserKey(GLFW_KEY_B, "KEY_B"),
|
||||
GLFW_KEY_C to UserKey(GLFW_KEY_C, "KEY_C"),
|
||||
GLFW_KEY_D to UserKey(GLFW_KEY_D, "KEY_D"),
|
||||
GLFW_KEY_E to UserKey(GLFW_KEY_E, "KEY_E"),
|
||||
GLFW_KEY_F to UserKey(GLFW_KEY_F, "KEY_F"),
|
||||
GLFW_KEY_G to UserKey(GLFW_KEY_G, "KEY_G"),
|
||||
GLFW_KEY_H to UserKey(GLFW_KEY_H, "KEY_H"),
|
||||
GLFW_KEY_I to UserKey(GLFW_KEY_I, "KEY_I"),
|
||||
GLFW_KEY_J to UserKey(GLFW_KEY_J, "KEY_J"),
|
||||
GLFW_KEY_K to UserKey(GLFW_KEY_K, "KEY_K"),
|
||||
GLFW_KEY_L to UserKey(GLFW_KEY_L, "KEY_L"),
|
||||
GLFW_KEY_M to UserKey(GLFW_KEY_M, "KEY_M"),
|
||||
GLFW_KEY_N to UserKey(GLFW_KEY_N, "KEY_N"),
|
||||
GLFW_KEY_O to UserKey(GLFW_KEY_O, "KEY_O"),
|
||||
GLFW_KEY_P to UserKey(GLFW_KEY_P, "KEY_P"),
|
||||
GLFW_KEY_Q to UserKey(GLFW_KEY_Q, "KEY_Q"),
|
||||
GLFW_KEY_R to UserKey(GLFW_KEY_R, "KEY_R"),
|
||||
GLFW_KEY_S to UserKey(GLFW_KEY_S, "KEY_S"),
|
||||
GLFW_KEY_T to UserKey(GLFW_KEY_T, "KEY_T"),
|
||||
GLFW_KEY_U to UserKey(GLFW_KEY_U, "KEY_U"),
|
||||
GLFW_KEY_V to UserKey(GLFW_KEY_V, "KEY_V"),
|
||||
GLFW_KEY_W to UserKey(GLFW_KEY_W, "KEY_W"),
|
||||
GLFW_KEY_X to UserKey(GLFW_KEY_X, "KEY_X"),
|
||||
GLFW_KEY_Y to UserKey(GLFW_KEY_Y, "KEY_Y"),
|
||||
GLFW_KEY_Z to UserKey(GLFW_KEY_Z, "KEY_Z"),
|
||||
GLFW_KEY_LEFT_BRACKET to UserKey(GLFW_KEY_LEFT_BRACKET, "KEY_LEFT_BRACKET"),
|
||||
GLFW_KEY_BACKSLASH to UserKey(GLFW_KEY_BACKSLASH, "KEY_BACKSLASH"),
|
||||
GLFW_KEY_RIGHT_BRACKET to UserKey(GLFW_KEY_RIGHT_BRACKET, "KEY_RIGHT_BRACKET"),
|
||||
GLFW_KEY_GRAVE_ACCENT to UserKey(GLFW_KEY_GRAVE_ACCENT, "KEY_GRAVE_ACCENT"),
|
||||
GLFW_KEY_WORLD_1 to UserKey(GLFW_KEY_WORLD_1, "KEY_WORLD_1"),
|
||||
GLFW_KEY_WORLD_2 to UserKey(GLFW_KEY_WORLD_2, "KEY_WORLD_2"),
|
||||
|
||||
GLFW_KEY_ESCAPE to UserKey(GLFW_KEY_ESCAPE, "KEY_ESCAPE"),
|
||||
GLFW_KEY_ENTER to UserKey(GLFW_KEY_ENTER, "KEY_ENTER"),
|
||||
GLFW_KEY_TAB to UserKey(GLFW_KEY_TAB, "KEY_TAB"),
|
||||
GLFW_KEY_BACKSPACE to UserKey(GLFW_KEY_BACKSPACE, "KEY_BACKSPACE"),
|
||||
GLFW_KEY_INSERT to UserKey(GLFW_KEY_INSERT, "KEY_INSERT"),
|
||||
GLFW_KEY_DELETE to UserKey(GLFW_KEY_DELETE, "KEY_DELETE"),
|
||||
GLFW_KEY_RIGHT to UserKey(GLFW_KEY_RIGHT, "KEY_RIGHT"),
|
||||
GLFW_KEY_LEFT to UserKey(GLFW_KEY_LEFT, "KEY_LEFT"),
|
||||
GLFW_KEY_DOWN to UserKey(GLFW_KEY_DOWN, "KEY_DOWN"),
|
||||
GLFW_KEY_UP to UserKey(GLFW_KEY_UP, "KEY_UP"),
|
||||
GLFW_KEY_PAGE_UP to UserKey(GLFW_KEY_PAGE_UP, "KEY_PAGE_UP"),
|
||||
GLFW_KEY_PAGE_DOWN to UserKey(GLFW_KEY_PAGE_DOWN, "KEY_PAGE_DOWN"),
|
||||
GLFW_KEY_HOME to UserKey(GLFW_KEY_HOME, "KEY_HOME"),
|
||||
GLFW_KEY_END to UserKey(GLFW_KEY_END, "KEY_END"),
|
||||
GLFW_KEY_CAPS_LOCK to UserKey(GLFW_KEY_CAPS_LOCK, "KEY_CAPS_LOCK"),
|
||||
GLFW_KEY_SCROLL_LOCK to UserKey(GLFW_KEY_SCROLL_LOCK, "KEY_SCROLL_LOCK"),
|
||||
GLFW_KEY_NUM_LOCK to UserKey(GLFW_KEY_NUM_LOCK, "KEY_NUM_LOCK"),
|
||||
GLFW_KEY_PRINT_SCREEN to UserKey(GLFW_KEY_PRINT_SCREEN, "KEY_PRINT_SCREEN"),
|
||||
GLFW_KEY_PAUSE to UserKey(GLFW_KEY_PAUSE, "KEY_PAUSE"),
|
||||
GLFW_KEY_F1 to UserKey(GLFW_KEY_F1, "KEY_F1"),
|
||||
GLFW_KEY_F2 to UserKey(GLFW_KEY_F2, "KEY_F2"),
|
||||
GLFW_KEY_F3 to UserKey(GLFW_KEY_F3, "KEY_F3"),
|
||||
GLFW_KEY_F4 to UserKey(GLFW_KEY_F4, "KEY_F4"),
|
||||
GLFW_KEY_F5 to UserKey(GLFW_KEY_F5, "KEY_F5"),
|
||||
GLFW_KEY_F6 to UserKey(GLFW_KEY_F6, "KEY_F6"),
|
||||
GLFW_KEY_F7 to UserKey(GLFW_KEY_F7, "KEY_F7"),
|
||||
GLFW_KEY_F8 to UserKey(GLFW_KEY_F8, "KEY_F8"),
|
||||
GLFW_KEY_F9 to UserKey(GLFW_KEY_F9, "KEY_F9"),
|
||||
GLFW_KEY_F10 to UserKey(GLFW_KEY_F10, "KEY_F10"),
|
||||
GLFW_KEY_F11 to UserKey(GLFW_KEY_F11, "KEY_F11"),
|
||||
GLFW_KEY_F12 to UserKey(GLFW_KEY_F12, "KEY_F12"),
|
||||
GLFW_KEY_F13 to UserKey(GLFW_KEY_F13, "KEY_F13"),
|
||||
GLFW_KEY_F14 to UserKey(GLFW_KEY_F14, "KEY_F14"),
|
||||
GLFW_KEY_F15 to UserKey(GLFW_KEY_F15, "KEY_F15"),
|
||||
GLFW_KEY_F16 to UserKey(GLFW_KEY_F16, "KEY_F16"),
|
||||
GLFW_KEY_F17 to UserKey(GLFW_KEY_F17, "KEY_F17"),
|
||||
GLFW_KEY_F18 to UserKey(GLFW_KEY_F18, "KEY_F18"),
|
||||
GLFW_KEY_F19 to UserKey(GLFW_KEY_F19, "KEY_F19"),
|
||||
GLFW_KEY_F20 to UserKey(GLFW_KEY_F20, "KEY_F20"),
|
||||
GLFW_KEY_F21 to UserKey(GLFW_KEY_F21, "KEY_F21"),
|
||||
GLFW_KEY_F22 to UserKey(GLFW_KEY_F22, "KEY_F22"),
|
||||
GLFW_KEY_F23 to UserKey(GLFW_KEY_F23, "KEY_F23"),
|
||||
GLFW_KEY_F24 to UserKey(GLFW_KEY_F24, "KEY_F24"),
|
||||
GLFW_KEY_F25 to UserKey(GLFW_KEY_F25, "KEY_F25"),
|
||||
GLFW_KEY_KP_0 to UserKey(GLFW_KEY_KP_0, "KEY_KP_0"),
|
||||
GLFW_KEY_KP_1 to UserKey(GLFW_KEY_KP_1, "KEY_KP_1"),
|
||||
GLFW_KEY_KP_2 to UserKey(GLFW_KEY_KP_2, "KEY_KP_2"),
|
||||
GLFW_KEY_KP_3 to UserKey(GLFW_KEY_KP_3, "KEY_KP_3"),
|
||||
GLFW_KEY_KP_4 to UserKey(GLFW_KEY_KP_4, "KEY_KP_4"),
|
||||
GLFW_KEY_KP_5 to UserKey(GLFW_KEY_KP_5, "KEY_KP_5"),
|
||||
GLFW_KEY_KP_6 to UserKey(GLFW_KEY_KP_6, "KEY_KP_6"),
|
||||
GLFW_KEY_KP_7 to UserKey(GLFW_KEY_KP_7, "KEY_KP_7"),
|
||||
GLFW_KEY_KP_8 to UserKey(GLFW_KEY_KP_8, "KEY_KP_8"),
|
||||
GLFW_KEY_KP_9 to UserKey(GLFW_KEY_KP_9, "KEY_KP_9"),
|
||||
GLFW_KEY_KP_DECIMAL to UserKey(GLFW_KEY_KP_DECIMAL, "KEY_KP_DECIMAL"),
|
||||
GLFW_KEY_KP_DIVIDE to UserKey(GLFW_KEY_KP_DIVIDE, "KEY_KP_DIVIDE"),
|
||||
GLFW_KEY_KP_MULTIPLY to UserKey(GLFW_KEY_KP_MULTIPLY, "KEY_KP_MULTIPLY"),
|
||||
GLFW_KEY_KP_SUBTRACT to UserKey(GLFW_KEY_KP_SUBTRACT, "KEY_KP_SUBTRACT"),
|
||||
GLFW_KEY_KP_ADD to UserKey(GLFW_KEY_KP_ADD, "KEY_KP_ADD"),
|
||||
GLFW_KEY_KP_ENTER to UserKey(GLFW_KEY_KP_ENTER, "KEY_KP_ENTER"),
|
||||
GLFW_KEY_KP_EQUAL to UserKey(GLFW_KEY_KP_EQUAL, "KEY_KP_EQUAL"),
|
||||
GLFW_KEY_LEFT_SHIFT to UserKey(GLFW_KEY_LEFT_SHIFT, "KEY_LEFT_SHIFT"),
|
||||
GLFW_KEY_LEFT_CONTROL to UserKey(GLFW_KEY_LEFT_CONTROL, "KEY_LEFT_CONTROL"),
|
||||
GLFW_KEY_LEFT_ALT to UserKey(GLFW_KEY_LEFT_ALT, "KEY_LEFT_ALT"),
|
||||
GLFW_KEY_LEFT_SUPER to UserKey(GLFW_KEY_LEFT_SUPER, "KEY_LEFT_SUPER"),
|
||||
GLFW_KEY_RIGHT_SHIFT to UserKey(GLFW_KEY_RIGHT_SHIFT, "KEY_RIGHT_SHIFT"),
|
||||
GLFW_KEY_RIGHT_CONTROL to UserKey(GLFW_KEY_RIGHT_CONTROL, "KEY_RIGHT_CONTROL"),
|
||||
GLFW_KEY_RIGHT_ALT to UserKey(GLFW_KEY_RIGHT_ALT, "KEY_RIGHT_ALT"),
|
||||
GLFW_KEY_RIGHT_SUPER to UserKey(GLFW_KEY_RIGHT_SUPER, "KEY_RIGHT_SUPER"),
|
||||
GLFW_KEY_MENU to UserKey(GLFW_KEY_MENU, "KEY_MENU"),
|
||||
|
||||
GLFW_MOUSE_BUTTON_1 to UserKey(GLFW_MOUSE_BUTTON_1, "MOUSE_BUTTON_1", false),
|
||||
GLFW_MOUSE_BUTTON_2 to UserKey(GLFW_MOUSE_BUTTON_2, "MOUSE_BUTTON_2", false),
|
||||
GLFW_MOUSE_BUTTON_3 to UserKey(GLFW_MOUSE_BUTTON_3, "MOUSE_BUTTON_3", false),
|
||||
GLFW_MOUSE_BUTTON_4 to UserKey(GLFW_MOUSE_BUTTON_4, "MOUSE_BUTTON_4", false),
|
||||
GLFW_MOUSE_BUTTON_5 to UserKey(GLFW_MOUSE_BUTTON_5, "MOUSE_BUTTON_5", false),
|
||||
GLFW_MOUSE_BUTTON_6 to UserKey(GLFW_MOUSE_BUTTON_6, "MOUSE_BUTTON_6", false),
|
||||
GLFW_MOUSE_BUTTON_7 to UserKey(GLFW_MOUSE_BUTTON_7, "MOUSE_BUTTON_7", false),
|
||||
GLFW_MOUSE_BUTTON_8 to UserKey(GLFW_MOUSE_BUTTON_8, "MOUSE_BUTTON_8", false),
|
||||
)
|
||||
|
||||
override val KEY_SPACE_DOWN by keyMap[GLFW_KEY_SPACE]!!.delegatePressed
|
||||
override val KEY_SPACE_DURATION by keyMap[GLFW_KEY_SPACE]!!.delegateHowLong
|
||||
override val KEY_APOSTROPHE_DOWN by keyMap[GLFW_KEY_APOSTROPHE]!!.delegatePressed
|
||||
override val KEY_APOSTROPHE_DURATION by keyMap[GLFW_KEY_APOSTROPHE]!!.delegateHowLong
|
||||
override val KEY_COMMA_DOWN by keyMap[GLFW_KEY_COMMA]!!.delegatePressed
|
||||
override val KEY_COMMA_DURATION by keyMap[GLFW_KEY_COMMA]!!.delegateHowLong
|
||||
override val KEY_MINUS_DOWN by keyMap[GLFW_KEY_MINUS]!!.delegatePressed
|
||||
override val KEY_MINUS_DURATION by keyMap[GLFW_KEY_MINUS]!!.delegateHowLong
|
||||
override val KEY_PERIOD_DOWN by keyMap[GLFW_KEY_PERIOD]!!.delegatePressed
|
||||
override val KEY_PERIOD_DURATION by keyMap[GLFW_KEY_PERIOD]!!.delegateHowLong
|
||||
override val KEY_SLASH_DOWN by keyMap[GLFW_KEY_SLASH]!!.delegatePressed
|
||||
override val KEY_SLASH_DURATION by keyMap[GLFW_KEY_SLASH]!!.delegateHowLong
|
||||
override val KEY_0_DOWN by keyMap[GLFW_KEY_0]!!.delegatePressed
|
||||
override val KEY_0_DURATION by keyMap[GLFW_KEY_0]!!.delegateHowLong
|
||||
override val KEY_1_DOWN by keyMap[GLFW_KEY_1]!!.delegatePressed
|
||||
override val KEY_1_DURATION by keyMap[GLFW_KEY_1]!!.delegateHowLong
|
||||
override val KEY_2_DOWN by keyMap[GLFW_KEY_2]!!.delegatePressed
|
||||
override val KEY_2_DURATION by keyMap[GLFW_KEY_2]!!.delegateHowLong
|
||||
override val KEY_3_DOWN by keyMap[GLFW_KEY_3]!!.delegatePressed
|
||||
override val KEY_3_DURATION by keyMap[GLFW_KEY_3]!!.delegateHowLong
|
||||
override val KEY_4_DOWN by keyMap[GLFW_KEY_4]!!.delegatePressed
|
||||
override val KEY_4_DURATION by keyMap[GLFW_KEY_4]!!.delegateHowLong
|
||||
override val KEY_5_DOWN by keyMap[GLFW_KEY_5]!!.delegatePressed
|
||||
override val KEY_5_DURATION by keyMap[GLFW_KEY_5]!!.delegateHowLong
|
||||
override val KEY_6_DOWN by keyMap[GLFW_KEY_6]!!.delegatePressed
|
||||
override val KEY_6_DURATION by keyMap[GLFW_KEY_6]!!.delegateHowLong
|
||||
override val KEY_7_DOWN by keyMap[GLFW_KEY_7]!!.delegatePressed
|
||||
override val KEY_7_DURATION by keyMap[GLFW_KEY_7]!!.delegateHowLong
|
||||
override val KEY_8_DOWN by keyMap[GLFW_KEY_8]!!.delegatePressed
|
||||
override val KEY_8_DURATION by keyMap[GLFW_KEY_8]!!.delegateHowLong
|
||||
override val KEY_9_DOWN by keyMap[GLFW_KEY_9]!!.delegatePressed
|
||||
override val KEY_9_DURATION by keyMap[GLFW_KEY_9]!!.delegateHowLong
|
||||
override val KEY_SEMICOLON_DOWN by keyMap[GLFW_KEY_SEMICOLON]!!.delegatePressed
|
||||
override val KEY_SEMICOLON_DURATION by keyMap[GLFW_KEY_SEMICOLON]!!.delegateHowLong
|
||||
override val KEY_EQUAL_DOWN by keyMap[GLFW_KEY_EQUAL]!!.delegatePressed
|
||||
override val KEY_EQUAL_DURATION by keyMap[GLFW_KEY_EQUAL]!!.delegateHowLong
|
||||
override val KEY_A_DOWN by keyMap[GLFW_KEY_A]!!.delegatePressed
|
||||
override val KEY_A_DURATION by keyMap[GLFW_KEY_A]!!.delegateHowLong
|
||||
override val KEY_B_DOWN by keyMap[GLFW_KEY_B]!!.delegatePressed
|
||||
override val KEY_B_DURATION by keyMap[GLFW_KEY_B]!!.delegateHowLong
|
||||
override val KEY_C_DOWN by keyMap[GLFW_KEY_C]!!.delegatePressed
|
||||
override val KEY_C_DURATION by keyMap[GLFW_KEY_C]!!.delegateHowLong
|
||||
override val KEY_D_DOWN by keyMap[GLFW_KEY_D]!!.delegatePressed
|
||||
override val KEY_D_DURATION by keyMap[GLFW_KEY_D]!!.delegateHowLong
|
||||
override val KEY_E_DOWN by keyMap[GLFW_KEY_E]!!.delegatePressed
|
||||
override val KEY_E_DURATION by keyMap[GLFW_KEY_E]!!.delegateHowLong
|
||||
override val KEY_F_DOWN by keyMap[GLFW_KEY_F]!!.delegatePressed
|
||||
override val KEY_F_DURATION by keyMap[GLFW_KEY_F]!!.delegateHowLong
|
||||
override val KEY_G_DOWN by keyMap[GLFW_KEY_G]!!.delegatePressed
|
||||
override val KEY_G_DURATION by keyMap[GLFW_KEY_G]!!.delegateHowLong
|
||||
override val KEY_H_DOWN by keyMap[GLFW_KEY_H]!!.delegatePressed
|
||||
override val KEY_H_DURATION by keyMap[GLFW_KEY_H]!!.delegateHowLong
|
||||
override val KEY_I_DOWN by keyMap[GLFW_KEY_I]!!.delegatePressed
|
||||
override val KEY_I_DURATION by keyMap[GLFW_KEY_I]!!.delegateHowLong
|
||||
override val KEY_J_DOWN by keyMap[GLFW_KEY_J]!!.delegatePressed
|
||||
override val KEY_J_DURATION by keyMap[GLFW_KEY_J]!!.delegateHowLong
|
||||
override val KEY_K_DOWN by keyMap[GLFW_KEY_K]!!.delegatePressed
|
||||
override val KEY_K_DURATION by keyMap[GLFW_KEY_K]!!.delegateHowLong
|
||||
override val KEY_L_DOWN by keyMap[GLFW_KEY_L]!!.delegatePressed
|
||||
override val KEY_L_DURATION by keyMap[GLFW_KEY_L]!!.delegateHowLong
|
||||
override val KEY_M_DOWN by keyMap[GLFW_KEY_M]!!.delegatePressed
|
||||
override val KEY_M_DURATION by keyMap[GLFW_KEY_M]!!.delegateHowLong
|
||||
override val KEY_N_DOWN by keyMap[GLFW_KEY_N]!!.delegatePressed
|
||||
override val KEY_N_DURATION by keyMap[GLFW_KEY_N]!!.delegateHowLong
|
||||
override val KEY_O_DOWN by keyMap[GLFW_KEY_O]!!.delegatePressed
|
||||
override val KEY_O_DURATION by keyMap[GLFW_KEY_O]!!.delegateHowLong
|
||||
override val KEY_P_DOWN by keyMap[GLFW_KEY_P]!!.delegatePressed
|
||||
override val KEY_P_DURATION by keyMap[GLFW_KEY_P]!!.delegateHowLong
|
||||
override val KEY_Q_DOWN by keyMap[GLFW_KEY_Q]!!.delegatePressed
|
||||
override val KEY_Q_DURATION by keyMap[GLFW_KEY_Q]!!.delegateHowLong
|
||||
override val KEY_R_DOWN by keyMap[GLFW_KEY_R]!!.delegatePressed
|
||||
override val KEY_R_DURATION by keyMap[GLFW_KEY_R]!!.delegateHowLong
|
||||
override val KEY_S_DOWN by keyMap[GLFW_KEY_S]!!.delegatePressed
|
||||
override val KEY_S_DURATION by keyMap[GLFW_KEY_S]!!.delegateHowLong
|
||||
override val KEY_T_DOWN by keyMap[GLFW_KEY_T]!!.delegatePressed
|
||||
override val KEY_T_DURATION by keyMap[GLFW_KEY_T]!!.delegateHowLong
|
||||
override val KEY_U_DOWN by keyMap[GLFW_KEY_U]!!.delegatePressed
|
||||
override val KEY_U_DURATION by keyMap[GLFW_KEY_U]!!.delegateHowLong
|
||||
override val KEY_V_DOWN by keyMap[GLFW_KEY_V]!!.delegatePressed
|
||||
override val KEY_V_DURATION by keyMap[GLFW_KEY_V]!!.delegateHowLong
|
||||
override val KEY_W_DOWN by keyMap[GLFW_KEY_W]!!.delegatePressed
|
||||
override val KEY_W_DURATION by keyMap[GLFW_KEY_W]!!.delegateHowLong
|
||||
override val KEY_X_DOWN by keyMap[GLFW_KEY_X]!!.delegatePressed
|
||||
override val KEY_X_DURATION by keyMap[GLFW_KEY_X]!!.delegateHowLong
|
||||
override val KEY_Y_DOWN by keyMap[GLFW_KEY_Y]!!.delegatePressed
|
||||
override val KEY_Y_DURATION by keyMap[GLFW_KEY_Y]!!.delegateHowLong
|
||||
override val KEY_Z_DOWN by keyMap[GLFW_KEY_Z]!!.delegatePressed
|
||||
override val KEY_Z_DURATION by keyMap[GLFW_KEY_Z]!!.delegateHowLong
|
||||
override val KEY_LEFT_BRACKET_DOWN by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegatePressed
|
||||
override val KEY_LEFT_BRACKET_DURATION by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegateHowLong
|
||||
override val KEY_BACKSLASH_DOWN by keyMap[GLFW_KEY_BACKSLASH]!!.delegatePressed
|
||||
override val KEY_BACKSLASH_DURATION by keyMap[GLFW_KEY_BACKSLASH]!!.delegateHowLong
|
||||
override val KEY_RIGHT_BRACKET_DOWN by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegatePressed
|
||||
override val KEY_RIGHT_BRACKET_DURATION by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegateHowLong
|
||||
override val KEY_GRAVE_ACCENT_DOWN by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegatePressed
|
||||
override val KEY_GRAVE_ACCENT_DURATION by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegateHowLong
|
||||
override val KEY_WORLD_1_DOWN by keyMap[GLFW_KEY_WORLD_1]!!.delegatePressed
|
||||
override val KEY_WORLD_1_DURATION by keyMap[GLFW_KEY_WORLD_1]!!.delegateHowLong
|
||||
override val KEY_WORLD_2_DOWN by keyMap[GLFW_KEY_WORLD_2]!!.delegatePressed
|
||||
override val KEY_WORLD_2_DURATION by keyMap[GLFW_KEY_WORLD_2]!!.delegateHowLong
|
||||
override val KEY_ESCAPE_DOWN by keyMap[GLFW_KEY_ESCAPE]!!.delegatePressed
|
||||
override val KEY_ESCAPE_DURATION by keyMap[GLFW_KEY_ESCAPE]!!.delegateHowLong
|
||||
override val KEY_ENTER_DOWN by keyMap[GLFW_KEY_ENTER]!!.delegatePressed
|
||||
override val KEY_ENTER_DURATION by keyMap[GLFW_KEY_ENTER]!!.delegateHowLong
|
||||
override val KEY_TAB_DOWN by keyMap[GLFW_KEY_TAB]!!.delegatePressed
|
||||
override val KEY_TAB_DURATION by keyMap[GLFW_KEY_TAB]!!.delegateHowLong
|
||||
override val KEY_BACKSPACE_DOWN by keyMap[GLFW_KEY_BACKSPACE]!!.delegatePressed
|
||||
override val KEY_BACKSPACE_DURATION by keyMap[GLFW_KEY_BACKSPACE]!!.delegateHowLong
|
||||
override val KEY_INSERT_DOWN by keyMap[GLFW_KEY_INSERT]!!.delegatePressed
|
||||
override val KEY_INSERT_DURATION by keyMap[GLFW_KEY_INSERT]!!.delegateHowLong
|
||||
override val KEY_DELETE_DOWN by keyMap[GLFW_KEY_DELETE]!!.delegatePressed
|
||||
override val KEY_DELETE_DURATION by keyMap[GLFW_KEY_DELETE]!!.delegateHowLong
|
||||
override val KEY_RIGHT_DOWN by keyMap[GLFW_KEY_RIGHT]!!.delegatePressed
|
||||
override val KEY_RIGHT_DURATION by keyMap[GLFW_KEY_RIGHT]!!.delegateHowLong
|
||||
override val KEY_LEFT_DOWN by keyMap[GLFW_KEY_LEFT]!!.delegatePressed
|
||||
override val KEY_LEFT_DURATION by keyMap[GLFW_KEY_LEFT]!!.delegateHowLong
|
||||
override val KEY_DOWN_DOWN by keyMap[GLFW_KEY_DOWN]!!.delegatePressed
|
||||
override val KEY_DOWN_DURATION by keyMap[GLFW_KEY_DOWN]!!.delegateHowLong
|
||||
override val KEY_UP_DOWN by keyMap[GLFW_KEY_UP]!!.delegatePressed
|
||||
override val KEY_UP_DURATION by keyMap[GLFW_KEY_UP]!!.delegateHowLong
|
||||
override val KEY_PAGE_UP_DOWN by keyMap[GLFW_KEY_PAGE_UP]!!.delegatePressed
|
||||
override val KEY_PAGE_UP_DURATION by keyMap[GLFW_KEY_PAGE_UP]!!.delegateHowLong
|
||||
override val KEY_PAGE_DOWN_DOWN by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegatePressed
|
||||
override val KEY_PAGE_DOWN_DURATION by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegateHowLong
|
||||
override val KEY_HOME_DOWN by keyMap[GLFW_KEY_HOME]!!.delegatePressed
|
||||
override val KEY_HOME_DURATION by keyMap[GLFW_KEY_HOME]!!.delegateHowLong
|
||||
override val KEY_END_DOWN by keyMap[GLFW_KEY_END]!!.delegatePressed
|
||||
override val KEY_END_DURATION by keyMap[GLFW_KEY_END]!!.delegateHowLong
|
||||
override val KEY_CAPS_LOCK_DOWN by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegatePressed
|
||||
override val KEY_CAPS_LOCK_DURATION by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegateHowLong
|
||||
override val KEY_SCROLL_LOCK_DOWN by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegatePressed
|
||||
override val KEY_SCROLL_LOCK_DURATION by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegateHowLong
|
||||
override val KEY_NUM_LOCK_DOWN by keyMap[GLFW_KEY_NUM_LOCK]!!.delegatePressed
|
||||
override val KEY_NUM_LOCK_DURATION by keyMap[GLFW_KEY_NUM_LOCK]!!.delegateHowLong
|
||||
override val KEY_PRINT_SCREEN_DOWN by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegatePressed
|
||||
override val KEY_PRINT_SCREEN_DURATION by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegateHowLong
|
||||
override val KEY_PAUSE_DOWN by keyMap[GLFW_KEY_PAUSE]!!.delegatePressed
|
||||
override val KEY_PAUSE_DURATION by keyMap[GLFW_KEY_PAUSE]!!.delegateHowLong
|
||||
override val KEY_F1_DOWN by keyMap[GLFW_KEY_F1]!!.delegatePressed
|
||||
override val KEY_F1_DURATION by keyMap[GLFW_KEY_F1]!!.delegateHowLong
|
||||
override val KEY_F2_DOWN by keyMap[GLFW_KEY_F2]!!.delegatePressed
|
||||
override val KEY_F2_DURATION by keyMap[GLFW_KEY_F2]!!.delegateHowLong
|
||||
override val KEY_F3_DOWN by keyMap[GLFW_KEY_F3]!!.delegatePressed
|
||||
override val KEY_F3_DURATION by keyMap[GLFW_KEY_F3]!!.delegateHowLong
|
||||
override val KEY_F4_DOWN by keyMap[GLFW_KEY_F4]!!.delegatePressed
|
||||
override val KEY_F4_DURATION by keyMap[GLFW_KEY_F4]!!.delegateHowLong
|
||||
override val KEY_F5_DOWN by keyMap[GLFW_KEY_F5]!!.delegatePressed
|
||||
override val KEY_F5_DURATION by keyMap[GLFW_KEY_F5]!!.delegateHowLong
|
||||
override val KEY_F6_DOWN by keyMap[GLFW_KEY_F6]!!.delegatePressed
|
||||
override val KEY_F6_DURATION by keyMap[GLFW_KEY_F6]!!.delegateHowLong
|
||||
override val KEY_F7_DOWN by keyMap[GLFW_KEY_F7]!!.delegatePressed
|
||||
override val KEY_F7_DURATION by keyMap[GLFW_KEY_F7]!!.delegateHowLong
|
||||
override val KEY_F8_DOWN by keyMap[GLFW_KEY_F8]!!.delegatePressed
|
||||
override val KEY_F8_DURATION by keyMap[GLFW_KEY_F8]!!.delegateHowLong
|
||||
override val KEY_F9_DOWN by keyMap[GLFW_KEY_F9]!!.delegatePressed
|
||||
override val KEY_F9_DURATION by keyMap[GLFW_KEY_F9]!!.delegateHowLong
|
||||
override val KEY_F10_DOWN by keyMap[GLFW_KEY_F10]!!.delegatePressed
|
||||
override val KEY_F10_DURATION by keyMap[GLFW_KEY_F10]!!.delegateHowLong
|
||||
override val KEY_F11_DOWN by keyMap[GLFW_KEY_F11]!!.delegatePressed
|
||||
override val KEY_F11_DURATION by keyMap[GLFW_KEY_F11]!!.delegateHowLong
|
||||
override val KEY_F12_DOWN by keyMap[GLFW_KEY_F12]!!.delegatePressed
|
||||
override val KEY_F12_DURATION by keyMap[GLFW_KEY_F12]!!.delegateHowLong
|
||||
override val KEY_F13_DOWN by keyMap[GLFW_KEY_F13]!!.delegatePressed
|
||||
override val KEY_F13_DURATION by keyMap[GLFW_KEY_F13]!!.delegateHowLong
|
||||
override val KEY_F14_DOWN by keyMap[GLFW_KEY_F14]!!.delegatePressed
|
||||
override val KEY_F14_DURATION by keyMap[GLFW_KEY_F14]!!.delegateHowLong
|
||||
override val KEY_F15_DOWN by keyMap[GLFW_KEY_F15]!!.delegatePressed
|
||||
override val KEY_F15_DURATION by keyMap[GLFW_KEY_F15]!!.delegateHowLong
|
||||
override val KEY_F16_DOWN by keyMap[GLFW_KEY_F16]!!.delegatePressed
|
||||
override val KEY_F16_DURATION by keyMap[GLFW_KEY_F16]!!.delegateHowLong
|
||||
override val KEY_F17_DOWN by keyMap[GLFW_KEY_F17]!!.delegatePressed
|
||||
override val KEY_F17_DURATION by keyMap[GLFW_KEY_F17]!!.delegateHowLong
|
||||
override val KEY_F18_DOWN by keyMap[GLFW_KEY_F18]!!.delegatePressed
|
||||
override val KEY_F18_DURATION by keyMap[GLFW_KEY_F18]!!.delegateHowLong
|
||||
override val KEY_F19_DOWN by keyMap[GLFW_KEY_F19]!!.delegatePressed
|
||||
override val KEY_F19_DURATION by keyMap[GLFW_KEY_F19]!!.delegateHowLong
|
||||
override val KEY_F20_DOWN by keyMap[GLFW_KEY_F20]!!.delegatePressed
|
||||
override val KEY_F20_DURATION by keyMap[GLFW_KEY_F20]!!.delegateHowLong
|
||||
override val KEY_F21_DOWN by keyMap[GLFW_KEY_F21]!!.delegatePressed
|
||||
override val KEY_F21_DURATION by keyMap[GLFW_KEY_F21]!!.delegateHowLong
|
||||
override val KEY_F22_DOWN by keyMap[GLFW_KEY_F22]!!.delegatePressed
|
||||
override val KEY_F22_DURATION by keyMap[GLFW_KEY_F22]!!.delegateHowLong
|
||||
override val KEY_F23_DOWN by keyMap[GLFW_KEY_F23]!!.delegatePressed
|
||||
override val KEY_F23_DURATION by keyMap[GLFW_KEY_F23]!!.delegateHowLong
|
||||
override val KEY_F24_DOWN by keyMap[GLFW_KEY_F24]!!.delegatePressed
|
||||
override val KEY_F24_DURATION by keyMap[GLFW_KEY_F24]!!.delegateHowLong
|
||||
override val KEY_F25_DOWN by keyMap[GLFW_KEY_F25]!!.delegatePressed
|
||||
override val KEY_F25_DURATION by keyMap[GLFW_KEY_F25]!!.delegateHowLong
|
||||
override val KEY_KP_0_DOWN by keyMap[GLFW_KEY_KP_0]!!.delegatePressed
|
||||
override val KEY_KP_0_DURATION by keyMap[GLFW_KEY_KP_0]!!.delegateHowLong
|
||||
override val KEY_KP_1_DOWN by keyMap[GLFW_KEY_KP_1]!!.delegatePressed
|
||||
override val KEY_KP_1_DURATION by keyMap[GLFW_KEY_KP_1]!!.delegateHowLong
|
||||
override val KEY_KP_2_DOWN by keyMap[GLFW_KEY_KP_2]!!.delegatePressed
|
||||
override val KEY_KP_2_DURATION by keyMap[GLFW_KEY_KP_2]!!.delegateHowLong
|
||||
override val KEY_KP_3_DOWN by keyMap[GLFW_KEY_KP_3]!!.delegatePressed
|
||||
override val KEY_KP_3_DURATION by keyMap[GLFW_KEY_KP_3]!!.delegateHowLong
|
||||
override val KEY_KP_4_DOWN by keyMap[GLFW_KEY_KP_4]!!.delegatePressed
|
||||
override val KEY_KP_4_DURATION by keyMap[GLFW_KEY_KP_4]!!.delegateHowLong
|
||||
override val KEY_KP_5_DOWN by keyMap[GLFW_KEY_KP_5]!!.delegatePressed
|
||||
override val KEY_KP_5_DURATION by keyMap[GLFW_KEY_KP_5]!!.delegateHowLong
|
||||
override val KEY_KP_6_DOWN by keyMap[GLFW_KEY_KP_6]!!.delegatePressed
|
||||
override val KEY_KP_6_DURATION by keyMap[GLFW_KEY_KP_6]!!.delegateHowLong
|
||||
override val KEY_KP_7_DOWN by keyMap[GLFW_KEY_KP_7]!!.delegatePressed
|
||||
override val KEY_KP_7_DURATION by keyMap[GLFW_KEY_KP_7]!!.delegateHowLong
|
||||
override val KEY_KP_8_DOWN by keyMap[GLFW_KEY_KP_8]!!.delegatePressed
|
||||
override val KEY_KP_8_DURATION by keyMap[GLFW_KEY_KP_8]!!.delegateHowLong
|
||||
override val KEY_KP_9_DOWN by keyMap[GLFW_KEY_KP_9]!!.delegatePressed
|
||||
override val KEY_KP_9_DURATION by keyMap[GLFW_KEY_KP_9]!!.delegateHowLong
|
||||
override val KEY_KP_DECIMAL_DOWN by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegatePressed
|
||||
override val KEY_KP_DECIMAL_DURATION by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegateHowLong
|
||||
override val KEY_KP_DIVIDE_DOWN by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegatePressed
|
||||
override val KEY_KP_DIVIDE_DURATION by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegateHowLong
|
||||
override val KEY_KP_MULTIPLY_DOWN by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegatePressed
|
||||
override val KEY_KP_MULTIPLY_DURATION by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegateHowLong
|
||||
override val KEY_KP_SUBTRACT_DOWN by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegatePressed
|
||||
override val KEY_KP_SUBTRACT_DURATION by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegateHowLong
|
||||
override val KEY_KP_ADD_DOWN by keyMap[GLFW_KEY_KP_ADD]!!.delegatePressed
|
||||
override val KEY_KP_ADD_DURATION by keyMap[GLFW_KEY_KP_ADD]!!.delegateHowLong
|
||||
override val KEY_KP_ENTER_DOWN by keyMap[GLFW_KEY_KP_ENTER]!!.delegatePressed
|
||||
override val KEY_KP_ENTER_DURATION by keyMap[GLFW_KEY_KP_ENTER]!!.delegateHowLong
|
||||
override val KEY_KP_EQUAL_DOWN by keyMap[GLFW_KEY_KP_EQUAL]!!.delegatePressed
|
||||
override val KEY_KP_EQUAL_DURATION by keyMap[GLFW_KEY_KP_EQUAL]!!.delegateHowLong
|
||||
override val KEY_LEFT_SHIFT_DOWN by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegatePressed
|
||||
override val KEY_LEFT_SHIFT_DURATION by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegateHowLong
|
||||
override val KEY_LEFT_CONTROL_DOWN by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegatePressed
|
||||
override val KEY_LEFT_CONTROL_DURATION by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegateHowLong
|
||||
override val KEY_LEFT_ALT_DOWN by keyMap[GLFW_KEY_LEFT_ALT]!!.delegatePressed
|
||||
override val KEY_LEFT_ALT_DURATION by keyMap[GLFW_KEY_LEFT_ALT]!!.delegateHowLong
|
||||
override val KEY_LEFT_SUPER_DOWN by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegatePressed
|
||||
override val KEY_LEFT_SUPER_DURATION by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegateHowLong
|
||||
override val KEY_RIGHT_SHIFT_DOWN by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegatePressed
|
||||
override val KEY_RIGHT_SHIFT_DURATION by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegateHowLong
|
||||
override val KEY_RIGHT_CONTROL_DOWN by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegatePressed
|
||||
override val KEY_RIGHT_CONTROL_DURATION by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegateHowLong
|
||||
override val KEY_RIGHT_ALT_DOWN by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegatePressed
|
||||
override val KEY_RIGHT_ALT_DURATION by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegateHowLong
|
||||
override val KEY_RIGHT_SUPER_DOWN by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegatePressed
|
||||
override val KEY_RIGHT_SUPER_DURATION by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegateHowLong
|
||||
override val KEY_MENU_DOWN by keyMap[GLFW_KEY_MENU]!!.delegatePressed
|
||||
override val KEY_MENU_DURATION by keyMap[GLFW_KEY_MENU]!!.delegateHowLong
|
||||
override val KEY_LAST_DOWN by keyMap[GLFW_KEY_LAST]!!.delegatePressed
|
||||
override val KEY_LAST_DURATION by keyMap[GLFW_KEY_LAST]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_1_DOWN by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_1_DURATION by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_2_DOWN by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_2_DURATION by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_3_DOWN by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_3_DURATION by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_4_DOWN by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_4_DURATION by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_5_DOWN by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_5_DURATION by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_6_DOWN by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_6_DURATION by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_7_DOWN by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_7_DURATION by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegateHowLong
|
||||
override val MOUSE_BUTTON_8_DOWN by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegatePressed
|
||||
override val MOUSE_BUTTON_8_DURATION by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegateHowLong
|
||||
|
||||
|
||||
override val KEY_SPACE_PRESSED: Boolean by keyMap[GLFW_KEY_SPACE]!!.delegatePressedRightAway
|
||||
override val KEY_APOSTROPHE_PRESSED: Boolean by keyMap[GLFW_KEY_APOSTROPHE]!!.delegatePressedRightAway
|
||||
override val KEY_COMMA_PRESSED: Boolean by keyMap[GLFW_KEY_COMMA]!!.delegatePressedRightAway
|
||||
override val KEY_MINUS_PRESSED: Boolean by keyMap[GLFW_KEY_MINUS]!!.delegatePressedRightAway
|
||||
override val KEY_PERIOD_PRESSED: Boolean by keyMap[GLFW_KEY_PERIOD]!!.delegatePressedRightAway
|
||||
override val KEY_SLASH_PRESSED: Boolean by keyMap[GLFW_KEY_SLASH]!!.delegatePressedRightAway
|
||||
override val KEY_0_PRESSED: Boolean by keyMap[GLFW_KEY_0]!!.delegatePressedRightAway
|
||||
override val KEY_1_PRESSED: Boolean by keyMap[GLFW_KEY_1]!!.delegatePressedRightAway
|
||||
override val KEY_2_PRESSED: Boolean by keyMap[GLFW_KEY_2]!!.delegatePressedRightAway
|
||||
override val KEY_3_PRESSED: Boolean by keyMap[GLFW_KEY_3]!!.delegatePressedRightAway
|
||||
override val KEY_4_PRESSED: Boolean by keyMap[GLFW_KEY_4]!!.delegatePressedRightAway
|
||||
override val KEY_5_PRESSED: Boolean by keyMap[GLFW_KEY_5]!!.delegatePressedRightAway
|
||||
override val KEY_6_PRESSED: Boolean by keyMap[GLFW_KEY_6]!!.delegatePressedRightAway
|
||||
override val KEY_7_PRESSED: Boolean by keyMap[GLFW_KEY_7]!!.delegatePressedRightAway
|
||||
override val KEY_8_PRESSED: Boolean by keyMap[GLFW_KEY_8]!!.delegatePressedRightAway
|
||||
override val KEY_9_PRESSED: Boolean by keyMap[GLFW_KEY_9]!!.delegatePressedRightAway
|
||||
override val KEY_SEMICOLON_PRESSED: Boolean by keyMap[GLFW_KEY_SEMICOLON]!!.delegatePressedRightAway
|
||||
override val KEY_EQUAL_PRESSED: Boolean by keyMap[GLFW_KEY_EQUAL]!!.delegatePressedRightAway
|
||||
override val KEY_A_PRESSED: Boolean by keyMap[GLFW_KEY_A]!!.delegatePressedRightAway
|
||||
override val KEY_B_PRESSED: Boolean by keyMap[GLFW_KEY_B]!!.delegatePressedRightAway
|
||||
override val KEY_C_PRESSED: Boolean by keyMap[GLFW_KEY_C]!!.delegatePressedRightAway
|
||||
override val KEY_D_PRESSED: Boolean by keyMap[GLFW_KEY_D]!!.delegatePressedRightAway
|
||||
override val KEY_E_PRESSED: Boolean by keyMap[GLFW_KEY_E]!!.delegatePressedRightAway
|
||||
override val KEY_F_PRESSED: Boolean by keyMap[GLFW_KEY_F]!!.delegatePressedRightAway
|
||||
override val KEY_G_PRESSED: Boolean by keyMap[GLFW_KEY_G]!!.delegatePressedRightAway
|
||||
override val KEY_H_PRESSED: Boolean by keyMap[GLFW_KEY_H]!!.delegatePressedRightAway
|
||||
override val KEY_I_PRESSED: Boolean by keyMap[GLFW_KEY_I]!!.delegatePressedRightAway
|
||||
override val KEY_J_PRESSED: Boolean by keyMap[GLFW_KEY_J]!!.delegatePressedRightAway
|
||||
override val KEY_K_PRESSED: Boolean by keyMap[GLFW_KEY_K]!!.delegatePressedRightAway
|
||||
override val KEY_L_PRESSED: Boolean by keyMap[GLFW_KEY_L]!!.delegatePressedRightAway
|
||||
override val KEY_M_PRESSED: Boolean by keyMap[GLFW_KEY_M]!!.delegatePressedRightAway
|
||||
override val KEY_N_PRESSED: Boolean by keyMap[GLFW_KEY_N]!!.delegatePressedRightAway
|
||||
override val KEY_O_PRESSED: Boolean by keyMap[GLFW_KEY_O]!!.delegatePressedRightAway
|
||||
override val KEY_P_PRESSED: Boolean by keyMap[GLFW_KEY_P]!!.delegatePressedRightAway
|
||||
override val KEY_Q_PRESSED: Boolean by keyMap[GLFW_KEY_Q]!!.delegatePressedRightAway
|
||||
override val KEY_R_PRESSED: Boolean by keyMap[GLFW_KEY_R]!!.delegatePressedRightAway
|
||||
override val KEY_S_PRESSED: Boolean by keyMap[GLFW_KEY_S]!!.delegatePressedRightAway
|
||||
override val KEY_T_PRESSED: Boolean by keyMap[GLFW_KEY_T]!!.delegatePressedRightAway
|
||||
override val KEY_U_PRESSED: Boolean by keyMap[GLFW_KEY_U]!!.delegatePressedRightAway
|
||||
override val KEY_V_PRESSED: Boolean by keyMap[GLFW_KEY_V]!!.delegatePressedRightAway
|
||||
override val KEY_W_PRESSED: Boolean by keyMap[GLFW_KEY_W]!!.delegatePressedRightAway
|
||||
override val KEY_X_PRESSED: Boolean by keyMap[GLFW_KEY_X]!!.delegatePressedRightAway
|
||||
override val KEY_Y_PRESSED: Boolean by keyMap[GLFW_KEY_Y]!!.delegatePressedRightAway
|
||||
override val KEY_Z_PRESSED: Boolean by keyMap[GLFW_KEY_Z]!!.delegatePressedRightAway
|
||||
override val KEY_LEFT_BRACKET_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegatePressedRightAway
|
||||
override val KEY_BACKSLASH_PRESSED: Boolean by keyMap[GLFW_KEY_BACKSLASH]!!.delegatePressedRightAway
|
||||
override val KEY_RIGHT_BRACKET_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegatePressedRightAway
|
||||
override val KEY_GRAVE_ACCENT_PRESSED: Boolean by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegatePressedRightAway
|
||||
override val KEY_WORLD_1_PRESSED: Boolean by keyMap[GLFW_KEY_WORLD_1]!!.delegatePressedRightAway
|
||||
override val KEY_WORLD_2_PRESSED: Boolean by keyMap[GLFW_KEY_WORLD_2]!!.delegatePressedRightAway
|
||||
override val KEY_ESCAPE_PRESSED: Boolean by keyMap[GLFW_KEY_ESCAPE]!!.delegatePressedRightAway
|
||||
override val KEY_ENTER_PRESSED: Boolean by keyMap[GLFW_KEY_ENTER]!!.delegatePressedRightAway
|
||||
override val KEY_TAB_PRESSED: Boolean by keyMap[GLFW_KEY_TAB]!!.delegatePressedRightAway
|
||||
override val KEY_BACKSPACE_PRESSED: Boolean by keyMap[GLFW_KEY_BACKSPACE]!!.delegatePressedRightAway
|
||||
override val KEY_INSERT_PRESSED: Boolean by keyMap[GLFW_KEY_INSERT]!!.delegatePressedRightAway
|
||||
override val KEY_DELETE_PRESSED: Boolean by keyMap[GLFW_KEY_DELETE]!!.delegatePressedRightAway
|
||||
override val KEY_RIGHT_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT]!!.delegatePressedRightAway
|
||||
override val KEY_LEFT_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT]!!.delegatePressedRightAway
|
||||
override val KEY_DOWN_PRESSED: Boolean by keyMap[GLFW_KEY_DOWN]!!.delegatePressedRightAway
|
||||
override val KEY_UP_PRESSED: Boolean by keyMap[GLFW_KEY_UP]!!.delegatePressedRightAway
|
||||
override val KEY_PAGE_UP_PRESSED: Boolean by keyMap[GLFW_KEY_PAGE_UP]!!.delegatePressedRightAway
|
||||
override val KEY_PAGE_DOWN_PRESSED: Boolean by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegatePressedRightAway
|
||||
override val KEY_HOME_PRESSED: Boolean by keyMap[GLFW_KEY_HOME]!!.delegatePressedRightAway
|
||||
override val KEY_END_PRESSED: Boolean by keyMap[GLFW_KEY_END]!!.delegatePressedRightAway
|
||||
override val KEY_CAPS_LOCK_PRESSED: Boolean by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegatePressedRightAway
|
||||
override val KEY_SCROLL_LOCK_PRESSED: Boolean by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegatePressedRightAway
|
||||
override val KEY_NUM_LOCK_PRESSED: Boolean by keyMap[GLFW_KEY_NUM_LOCK]!!.delegatePressedRightAway
|
||||
override val KEY_PRINT_SCREEN_PRESSED: Boolean by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegatePressedRightAway
|
||||
override val KEY_PAUSE_PRESSED: Boolean by keyMap[GLFW_KEY_PAUSE]!!.delegatePressedRightAway
|
||||
override val KEY_F1_PRESSED: Boolean by keyMap[GLFW_KEY_F1]!!.delegatePressedRightAway
|
||||
override val KEY_F2_PRESSED: Boolean by keyMap[GLFW_KEY_F2]!!.delegatePressedRightAway
|
||||
override val KEY_F3_PRESSED: Boolean by keyMap[GLFW_KEY_F3]!!.delegatePressedRightAway
|
||||
override val KEY_F4_PRESSED: Boolean by keyMap[GLFW_KEY_F4]!!.delegatePressedRightAway
|
||||
override val KEY_F5_PRESSED: Boolean by keyMap[GLFW_KEY_F5]!!.delegatePressedRightAway
|
||||
override val KEY_F6_PRESSED: Boolean by keyMap[GLFW_KEY_F6]!!.delegatePressedRightAway
|
||||
override val KEY_F7_PRESSED: Boolean by keyMap[GLFW_KEY_F7]!!.delegatePressedRightAway
|
||||
override val KEY_F8_PRESSED: Boolean by keyMap[GLFW_KEY_F8]!!.delegatePressedRightAway
|
||||
override val KEY_F9_PRESSED: Boolean by keyMap[GLFW_KEY_F9]!!.delegatePressedRightAway
|
||||
override val KEY_F10_PRESSED: Boolean by keyMap[GLFW_KEY_F10]!!.delegatePressedRightAway
|
||||
override val KEY_F11_PRESSED: Boolean by keyMap[GLFW_KEY_F11]!!.delegatePressedRightAway
|
||||
override val KEY_F12_PRESSED: Boolean by keyMap[GLFW_KEY_F12]!!.delegatePressedRightAway
|
||||
override val KEY_F13_PRESSED: Boolean by keyMap[GLFW_KEY_F13]!!.delegatePressedRightAway
|
||||
override val KEY_F14_PRESSED: Boolean by keyMap[GLFW_KEY_F14]!!.delegatePressedRightAway
|
||||
override val KEY_F15_PRESSED: Boolean by keyMap[GLFW_KEY_F15]!!.delegatePressedRightAway
|
||||
override val KEY_F16_PRESSED: Boolean by keyMap[GLFW_KEY_F16]!!.delegatePressedRightAway
|
||||
override val KEY_F17_PRESSED: Boolean by keyMap[GLFW_KEY_F17]!!.delegatePressedRightAway
|
||||
override val KEY_F18_PRESSED: Boolean by keyMap[GLFW_KEY_F18]!!.delegatePressedRightAway
|
||||
override val KEY_F19_PRESSED: Boolean by keyMap[GLFW_KEY_F19]!!.delegatePressedRightAway
|
||||
override val KEY_F20_PRESSED: Boolean by keyMap[GLFW_KEY_F20]!!.delegatePressedRightAway
|
||||
override val KEY_F21_PRESSED: Boolean by keyMap[GLFW_KEY_F21]!!.delegatePressedRightAway
|
||||
override val KEY_F22_PRESSED: Boolean by keyMap[GLFW_KEY_F22]!!.delegatePressedRightAway
|
||||
override val KEY_F23_PRESSED: Boolean by keyMap[GLFW_KEY_F23]!!.delegatePressedRightAway
|
||||
override val KEY_F24_PRESSED: Boolean by keyMap[GLFW_KEY_F24]!!.delegatePressedRightAway
|
||||
override val KEY_F25_PRESSED: Boolean by keyMap[GLFW_KEY_F25]!!.delegatePressedRightAway
|
||||
override val KEY_KP_0_PRESSED: Boolean by keyMap[GLFW_KEY_KP_0]!!.delegatePressedRightAway
|
||||
override val KEY_KP_1_PRESSED: Boolean by keyMap[GLFW_KEY_KP_1]!!.delegatePressedRightAway
|
||||
override val KEY_KP_2_PRESSED: Boolean by keyMap[GLFW_KEY_KP_2]!!.delegatePressedRightAway
|
||||
override val KEY_KP_3_PRESSED: Boolean by keyMap[GLFW_KEY_KP_3]!!.delegatePressedRightAway
|
||||
override val KEY_KP_4_PRESSED: Boolean by keyMap[GLFW_KEY_KP_4]!!.delegatePressedRightAway
|
||||
override val KEY_KP_5_PRESSED: Boolean by keyMap[GLFW_KEY_KP_5]!!.delegatePressedRightAway
|
||||
override val KEY_KP_6_PRESSED: Boolean by keyMap[GLFW_KEY_KP_6]!!.delegatePressedRightAway
|
||||
override val KEY_KP_7_PRESSED: Boolean by keyMap[GLFW_KEY_KP_7]!!.delegatePressedRightAway
|
||||
override val KEY_KP_8_PRESSED: Boolean by keyMap[GLFW_KEY_KP_8]!!.delegatePressedRightAway
|
||||
override val KEY_KP_9_PRESSED: Boolean by keyMap[GLFW_KEY_KP_9]!!.delegatePressedRightAway
|
||||
override val KEY_KP_DECIMAL_PRESSED: Boolean by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegatePressedRightAway
|
||||
override val KEY_KP_DIVIDE_PRESSED: Boolean by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegatePressedRightAway
|
||||
override val KEY_KP_MULTIPLY_PRESSED: Boolean by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegatePressedRightAway
|
||||
override val KEY_KP_SUBTRACT_PRESSED: Boolean by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegatePressedRightAway
|
||||
override val KEY_KP_ADD_PRESSED: Boolean by keyMap[GLFW_KEY_KP_ADD]!!.delegatePressedRightAway
|
||||
override val KEY_KP_ENTER_PRESSED: Boolean by keyMap[GLFW_KEY_KP_ENTER]!!.delegatePressedRightAway
|
||||
override val KEY_KP_EQUAL_PRESSED: Boolean by keyMap[GLFW_KEY_KP_EQUAL]!!.delegatePressedRightAway
|
||||
override val KEY_LEFT_SHIFT_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegatePressedRightAway
|
||||
override val KEY_LEFT_CONTROL_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegatePressedRightAway
|
||||
override val KEY_LEFT_ALT_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_ALT]!!.delegatePressedRightAway
|
||||
override val KEY_LEFT_SUPER_PRESSED: Boolean by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegatePressedRightAway
|
||||
override val KEY_RIGHT_SHIFT_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegatePressedRightAway
|
||||
override val KEY_RIGHT_CONTROL_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegatePressedRightAway
|
||||
override val KEY_RIGHT_ALT_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegatePressedRightAway
|
||||
override val KEY_RIGHT_SUPER_PRESSED: Boolean by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegatePressedRightAway
|
||||
override val KEY_MENU_PRESSED: Boolean by keyMap[GLFW_KEY_MENU]!!.delegatePressedRightAway
|
||||
override val KEY_LAST_PRESSED: Boolean by keyMap[GLFW_KEY_LAST]!!.delegatePressedRightAway
|
||||
|
||||
override val KEY_SPACE_RELEASED: Boolean by keyMap[GLFW_KEY_SPACE]!!.delegateDepressedRightAway
|
||||
override val KEY_APOSTROPHE_RELEASED: Boolean by keyMap[GLFW_KEY_APOSTROPHE]!!.delegateDepressedRightAway
|
||||
override val KEY_COMMA_RELEASED: Boolean by keyMap[GLFW_KEY_COMMA]!!.delegateDepressedRightAway
|
||||
override val KEY_MINUS_RELEASED: Boolean by keyMap[GLFW_KEY_MINUS]!!.delegateDepressedRightAway
|
||||
override val KEY_PERIOD_RELEASED: Boolean by keyMap[GLFW_KEY_PERIOD]!!.delegateDepressedRightAway
|
||||
override val KEY_SLASH_RELEASED: Boolean by keyMap[GLFW_KEY_SLASH]!!.delegateDepressedRightAway
|
||||
override val KEY_0_RELEASED: Boolean by keyMap[GLFW_KEY_0]!!.delegateDepressedRightAway
|
||||
override val KEY_1_RELEASED: Boolean by keyMap[GLFW_KEY_1]!!.delegateDepressedRightAway
|
||||
override val KEY_2_RELEASED: Boolean by keyMap[GLFW_KEY_2]!!.delegateDepressedRightAway
|
||||
override val KEY_3_RELEASED: Boolean by keyMap[GLFW_KEY_3]!!.delegateDepressedRightAway
|
||||
override val KEY_4_RELEASED: Boolean by keyMap[GLFW_KEY_4]!!.delegateDepressedRightAway
|
||||
override val KEY_5_RELEASED: Boolean by keyMap[GLFW_KEY_5]!!.delegateDepressedRightAway
|
||||
override val KEY_6_RELEASED: Boolean by keyMap[GLFW_KEY_6]!!.delegateDepressedRightAway
|
||||
override val KEY_7_RELEASED: Boolean by keyMap[GLFW_KEY_7]!!.delegateDepressedRightAway
|
||||
override val KEY_8_RELEASED: Boolean by keyMap[GLFW_KEY_8]!!.delegateDepressedRightAway
|
||||
override val KEY_9_RELEASED: Boolean by keyMap[GLFW_KEY_9]!!.delegateDepressedRightAway
|
||||
override val KEY_SEMICOLON_RELEASED: Boolean by keyMap[GLFW_KEY_SEMICOLON]!!.delegateDepressedRightAway
|
||||
override val KEY_EQUAL_RELEASED: Boolean by keyMap[GLFW_KEY_EQUAL]!!.delegateDepressedRightAway
|
||||
override val KEY_A_RELEASED: Boolean by keyMap[GLFW_KEY_A]!!.delegateDepressedRightAway
|
||||
override val KEY_B_RELEASED: Boolean by keyMap[GLFW_KEY_B]!!.delegateDepressedRightAway
|
||||
override val KEY_C_RELEASED: Boolean by keyMap[GLFW_KEY_C]!!.delegateDepressedRightAway
|
||||
override val KEY_D_RELEASED: Boolean by keyMap[GLFW_KEY_D]!!.delegateDepressedRightAway
|
||||
override val KEY_E_RELEASED: Boolean by keyMap[GLFW_KEY_E]!!.delegateDepressedRightAway
|
||||
override val KEY_F_RELEASED: Boolean by keyMap[GLFW_KEY_F]!!.delegateDepressedRightAway
|
||||
override val KEY_G_RELEASED: Boolean by keyMap[GLFW_KEY_G]!!.delegateDepressedRightAway
|
||||
override val KEY_H_RELEASED: Boolean by keyMap[GLFW_KEY_H]!!.delegateDepressedRightAway
|
||||
override val KEY_I_RELEASED: Boolean by keyMap[GLFW_KEY_I]!!.delegateDepressedRightAway
|
||||
override val KEY_J_RELEASED: Boolean by keyMap[GLFW_KEY_J]!!.delegateDepressedRightAway
|
||||
override val KEY_K_RELEASED: Boolean by keyMap[GLFW_KEY_K]!!.delegateDepressedRightAway
|
||||
override val KEY_L_RELEASED: Boolean by keyMap[GLFW_KEY_L]!!.delegateDepressedRightAway
|
||||
override val KEY_M_RELEASED: Boolean by keyMap[GLFW_KEY_M]!!.delegateDepressedRightAway
|
||||
override val KEY_N_RELEASED: Boolean by keyMap[GLFW_KEY_N]!!.delegateDepressedRightAway
|
||||
override val KEY_O_RELEASED: Boolean by keyMap[GLFW_KEY_O]!!.delegateDepressedRightAway
|
||||
override val KEY_P_RELEASED: Boolean by keyMap[GLFW_KEY_P]!!.delegateDepressedRightAway
|
||||
override val KEY_Q_RELEASED: Boolean by keyMap[GLFW_KEY_Q]!!.delegateDepressedRightAway
|
||||
override val KEY_R_RELEASED: Boolean by keyMap[GLFW_KEY_R]!!.delegateDepressedRightAway
|
||||
override val KEY_S_RELEASED: Boolean by keyMap[GLFW_KEY_S]!!.delegateDepressedRightAway
|
||||
override val KEY_T_RELEASED: Boolean by keyMap[GLFW_KEY_T]!!.delegateDepressedRightAway
|
||||
override val KEY_U_RELEASED: Boolean by keyMap[GLFW_KEY_U]!!.delegateDepressedRightAway
|
||||
override val KEY_V_RELEASED: Boolean by keyMap[GLFW_KEY_V]!!.delegateDepressedRightAway
|
||||
override val KEY_W_RELEASED: Boolean by keyMap[GLFW_KEY_W]!!.delegateDepressedRightAway
|
||||
override val KEY_X_RELEASED: Boolean by keyMap[GLFW_KEY_X]!!.delegateDepressedRightAway
|
||||
override val KEY_Y_RELEASED: Boolean by keyMap[GLFW_KEY_Y]!!.delegateDepressedRightAway
|
||||
override val KEY_Z_RELEASED: Boolean by keyMap[GLFW_KEY_Z]!!.delegateDepressedRightAway
|
||||
override val KEY_LEFT_BRACKET_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_BRACKET]!!.delegateDepressedRightAway
|
||||
override val KEY_BACKSLASH_RELEASED: Boolean by keyMap[GLFW_KEY_BACKSLASH]!!.delegateDepressedRightAway
|
||||
override val KEY_RIGHT_BRACKET_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_BRACKET]!!.delegateDepressedRightAway
|
||||
override val KEY_GRAVE_ACCENT_RELEASED: Boolean by keyMap[GLFW_KEY_GRAVE_ACCENT]!!.delegateDepressedRightAway
|
||||
override val KEY_WORLD_1_RELEASED: Boolean by keyMap[GLFW_KEY_WORLD_1]!!.delegateDepressedRightAway
|
||||
override val KEY_WORLD_2_RELEASED: Boolean by keyMap[GLFW_KEY_WORLD_2]!!.delegateDepressedRightAway
|
||||
override val KEY_ESCAPE_RELEASED: Boolean by keyMap[GLFW_KEY_ESCAPE]!!.delegateDepressedRightAway
|
||||
override val KEY_ENTER_RELEASED: Boolean by keyMap[GLFW_KEY_ENTER]!!.delegateDepressedRightAway
|
||||
override val KEY_TAB_RELEASED: Boolean by keyMap[GLFW_KEY_TAB]!!.delegateDepressedRightAway
|
||||
override val KEY_BACKSPACE_RELEASED: Boolean by keyMap[GLFW_KEY_BACKSPACE]!!.delegateDepressedRightAway
|
||||
override val KEY_INSERT_RELEASED: Boolean by keyMap[GLFW_KEY_INSERT]!!.delegateDepressedRightAway
|
||||
override val KEY_DELETE_RELEASED: Boolean by keyMap[GLFW_KEY_DELETE]!!.delegateDepressedRightAway
|
||||
override val KEY_RIGHT_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT]!!.delegateDepressedRightAway
|
||||
override val KEY_LEFT_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT]!!.delegateDepressedRightAway
|
||||
override val KEY_DOWN_RELEASED: Boolean by keyMap[GLFW_KEY_DOWN]!!.delegateDepressedRightAway
|
||||
override val KEY_UP_RELEASED: Boolean by keyMap[GLFW_KEY_UP]!!.delegateDepressedRightAway
|
||||
override val KEY_PAGE_UP_RELEASED: Boolean by keyMap[GLFW_KEY_PAGE_UP]!!.delegateDepressedRightAway
|
||||
override val KEY_PAGE_DOWN_RELEASED: Boolean by keyMap[GLFW_KEY_PAGE_DOWN]!!.delegateDepressedRightAway
|
||||
override val KEY_HOME_RELEASED: Boolean by keyMap[GLFW_KEY_HOME]!!.delegateDepressedRightAway
|
||||
override val KEY_END_RELEASED: Boolean by keyMap[GLFW_KEY_END]!!.delegateDepressedRightAway
|
||||
override val KEY_CAPS_LOCK_RELEASED: Boolean by keyMap[GLFW_KEY_CAPS_LOCK]!!.delegateDepressedRightAway
|
||||
override val KEY_SCROLL_LOCK_RELEASED: Boolean by keyMap[GLFW_KEY_SCROLL_LOCK]!!.delegateDepressedRightAway
|
||||
override val KEY_NUM_LOCK_RELEASED: Boolean by keyMap[GLFW_KEY_NUM_LOCK]!!.delegateDepressedRightAway
|
||||
override val KEY_PRINT_SCREEN_RELEASED: Boolean by keyMap[GLFW_KEY_PRINT_SCREEN]!!.delegateDepressedRightAway
|
||||
override val KEY_PAUSE_RELEASED: Boolean by keyMap[GLFW_KEY_PAUSE]!!.delegateDepressedRightAway
|
||||
override val KEY_F1_RELEASED: Boolean by keyMap[GLFW_KEY_F1]!!.delegateDepressedRightAway
|
||||
override val KEY_F2_RELEASED: Boolean by keyMap[GLFW_KEY_F2]!!.delegateDepressedRightAway
|
||||
override val KEY_F3_RELEASED: Boolean by keyMap[GLFW_KEY_F3]!!.delegateDepressedRightAway
|
||||
override val KEY_F4_RELEASED: Boolean by keyMap[GLFW_KEY_F4]!!.delegateDepressedRightAway
|
||||
override val KEY_F5_RELEASED: Boolean by keyMap[GLFW_KEY_F5]!!.delegateDepressedRightAway
|
||||
override val KEY_F6_RELEASED: Boolean by keyMap[GLFW_KEY_F6]!!.delegateDepressedRightAway
|
||||
override val KEY_F7_RELEASED: Boolean by keyMap[GLFW_KEY_F7]!!.delegateDepressedRightAway
|
||||
override val KEY_F8_RELEASED: Boolean by keyMap[GLFW_KEY_F8]!!.delegateDepressedRightAway
|
||||
override val KEY_F9_RELEASED: Boolean by keyMap[GLFW_KEY_F9]!!.delegateDepressedRightAway
|
||||
override val KEY_F10_RELEASED: Boolean by keyMap[GLFW_KEY_F10]!!.delegateDepressedRightAway
|
||||
override val KEY_F11_RELEASED: Boolean by keyMap[GLFW_KEY_F11]!!.delegateDepressedRightAway
|
||||
override val KEY_F12_RELEASED: Boolean by keyMap[GLFW_KEY_F12]!!.delegateDepressedRightAway
|
||||
override val KEY_F13_RELEASED: Boolean by keyMap[GLFW_KEY_F13]!!.delegateDepressedRightAway
|
||||
override val KEY_F14_RELEASED: Boolean by keyMap[GLFW_KEY_F14]!!.delegateDepressedRightAway
|
||||
override val KEY_F15_RELEASED: Boolean by keyMap[GLFW_KEY_F15]!!.delegateDepressedRightAway
|
||||
override val KEY_F16_RELEASED: Boolean by keyMap[GLFW_KEY_F16]!!.delegateDepressedRightAway
|
||||
override val KEY_F17_RELEASED: Boolean by keyMap[GLFW_KEY_F17]!!.delegateDepressedRightAway
|
||||
override val KEY_F18_RELEASED: Boolean by keyMap[GLFW_KEY_F18]!!.delegateDepressedRightAway
|
||||
override val KEY_F19_RELEASED: Boolean by keyMap[GLFW_KEY_F19]!!.delegateDepressedRightAway
|
||||
override val KEY_F20_RELEASED: Boolean by keyMap[GLFW_KEY_F20]!!.delegateDepressedRightAway
|
||||
override val KEY_F21_RELEASED: Boolean by keyMap[GLFW_KEY_F21]!!.delegateDepressedRightAway
|
||||
override val KEY_F22_RELEASED: Boolean by keyMap[GLFW_KEY_F22]!!.delegateDepressedRightAway
|
||||
override val KEY_F23_RELEASED: Boolean by keyMap[GLFW_KEY_F23]!!.delegateDepressedRightAway
|
||||
override val KEY_F24_RELEASED: Boolean by keyMap[GLFW_KEY_F24]!!.delegateDepressedRightAway
|
||||
override val KEY_F25_RELEASED: Boolean by keyMap[GLFW_KEY_F25]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_0_RELEASED: Boolean by keyMap[GLFW_KEY_KP_0]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_1_RELEASED: Boolean by keyMap[GLFW_KEY_KP_1]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_2_RELEASED: Boolean by keyMap[GLFW_KEY_KP_2]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_3_RELEASED: Boolean by keyMap[GLFW_KEY_KP_3]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_4_RELEASED: Boolean by keyMap[GLFW_KEY_KP_4]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_5_RELEASED: Boolean by keyMap[GLFW_KEY_KP_5]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_6_RELEASED: Boolean by keyMap[GLFW_KEY_KP_6]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_7_RELEASED: Boolean by keyMap[GLFW_KEY_KP_7]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_8_RELEASED: Boolean by keyMap[GLFW_KEY_KP_8]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_9_RELEASED: Boolean by keyMap[GLFW_KEY_KP_9]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_DECIMAL_RELEASED: Boolean by keyMap[GLFW_KEY_KP_DECIMAL]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_DIVIDE_RELEASED: Boolean by keyMap[GLFW_KEY_KP_DIVIDE]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_MULTIPLY_RELEASED: Boolean by keyMap[GLFW_KEY_KP_MULTIPLY]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_SUBTRACT_RELEASED: Boolean by keyMap[GLFW_KEY_KP_SUBTRACT]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_ADD_RELEASED: Boolean by keyMap[GLFW_KEY_KP_ADD]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_ENTER_RELEASED: Boolean by keyMap[GLFW_KEY_KP_ENTER]!!.delegateDepressedRightAway
|
||||
override val KEY_KP_EQUAL_RELEASED: Boolean by keyMap[GLFW_KEY_KP_EQUAL]!!.delegateDepressedRightAway
|
||||
override val KEY_LEFT_SHIFT_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_SHIFT]!!.delegateDepressedRightAway
|
||||
override val KEY_LEFT_CONTROL_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_CONTROL]!!.delegateDepressedRightAway
|
||||
override val KEY_LEFT_ALT_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_ALT]!!.delegateDepressedRightAway
|
||||
override val KEY_LEFT_SUPER_RELEASED: Boolean by keyMap[GLFW_KEY_LEFT_SUPER]!!.delegateDepressedRightAway
|
||||
override val KEY_RIGHT_SHIFT_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_SHIFT]!!.delegateDepressedRightAway
|
||||
override val KEY_RIGHT_CONTROL_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_CONTROL]!!.delegateDepressedRightAway
|
||||
override val KEY_RIGHT_ALT_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_ALT]!!.delegateDepressedRightAway
|
||||
override val KEY_RIGHT_SUPER_RELEASED: Boolean by keyMap[GLFW_KEY_RIGHT_SUPER]!!.delegateDepressedRightAway
|
||||
override val KEY_MENU_RELEASED: Boolean by keyMap[GLFW_KEY_MENU]!!.delegateDepressedRightAway
|
||||
override val KEY_LAST_RELEASED: Boolean by keyMap[GLFW_KEY_LAST]!!.delegateDepressedRightAway
|
||||
|
||||
|
||||
override val MOUSE_BUTTON_1_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_2_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_3_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_4_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_5_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_6_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_7_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegatePressedRightAway
|
||||
override val MOUSE_BUTTON_8_PRESSED: Boolean by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegatePressedRightAway
|
||||
|
||||
override val MOUSE_BUTTON_1_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_1]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_2_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_2]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_3_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_3]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_4_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_4]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_5_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_5]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_6_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_6]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_7_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_7]!!.delegateDepressedRightAway
|
||||
override val MOUSE_BUTTON_8_RELEASED: Boolean by keyMap[GLFW_MOUSE_BUTTON_8]!!.delegateDepressedRightAway
|
||||
|
||||
fun makeSnapshot(): UserInputSnapshot {
|
||||
return UserInputSnapshot(this)
|
||||
}
|
||||
|
||||
fun makeMutableSnapshot(): MutableUserInputSnapshot {
|
||||
return MutableUserInputSnapshot(this)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val LOGGER = LogManager.getLogger(UserInput::class.java)
|
||||
}
|
||||
}
|
@ -0,0 +1,526 @@
|
||||
package ru.dbotthepony.kstarbound.client.input
|
||||
|
||||
class UserInputSnapshot(
|
||||
other: IUserInput
|
||||
) : IUserInput {
|
||||
override val KEY_SPACE_DOWN: Boolean = other.KEY_SPACE_DOWN
|
||||
override val KEY_SPACE_DURATION: Double = other.KEY_SPACE_DURATION
|
||||
override val KEY_APOSTROPHE_DOWN: Boolean = other.KEY_APOSTROPHE_DOWN
|
||||
override val KEY_APOSTROPHE_DURATION: Double = other.KEY_APOSTROPHE_DURATION
|
||||
override val KEY_COMMA_DOWN: Boolean = other.KEY_COMMA_DOWN
|
||||
override val KEY_COMMA_DURATION: Double = other.KEY_COMMA_DURATION
|
||||
override val KEY_MINUS_DOWN: Boolean = other.KEY_MINUS_DOWN
|
||||
override val KEY_MINUS_DURATION: Double = other.KEY_MINUS_DURATION
|
||||
override val KEY_PERIOD_DOWN: Boolean = other.KEY_PERIOD_DOWN
|
||||
override val KEY_PERIOD_DURATION: Double = other.KEY_PERIOD_DURATION
|
||||
override val KEY_SLASH_DOWN: Boolean = other.KEY_SLASH_DOWN
|
||||
override val KEY_SLASH_DURATION: Double = other.KEY_SLASH_DURATION
|
||||
override val KEY_0_DOWN: Boolean = other.KEY_0_DOWN
|
||||
override val KEY_0_DURATION: Double = other.KEY_0_DURATION
|
||||
override val KEY_1_DOWN: Boolean = other.KEY_1_DOWN
|
||||
override val KEY_1_DURATION: Double = other.KEY_1_DURATION
|
||||
override val KEY_2_DOWN: Boolean = other.KEY_2_DOWN
|
||||
override val KEY_2_DURATION: Double = other.KEY_2_DURATION
|
||||
override val KEY_3_DOWN: Boolean = other.KEY_3_DOWN
|
||||
override val KEY_3_DURATION: Double = other.KEY_3_DURATION
|
||||
override val KEY_4_DOWN: Boolean = other.KEY_4_DOWN
|
||||
override val KEY_4_DURATION: Double = other.KEY_4_DURATION
|
||||
override val KEY_5_DOWN: Boolean = other.KEY_5_DOWN
|
||||
override val KEY_5_DURATION: Double = other.KEY_5_DURATION
|
||||
override val KEY_6_DOWN: Boolean = other.KEY_6_DOWN
|
||||
override val KEY_6_DURATION: Double = other.KEY_6_DURATION
|
||||
override val KEY_7_DOWN: Boolean = other.KEY_7_DOWN
|
||||
override val KEY_7_DURATION: Double = other.KEY_7_DURATION
|
||||
override val KEY_8_DOWN: Boolean = other.KEY_8_DOWN
|
||||
override val KEY_8_DURATION: Double = other.KEY_8_DURATION
|
||||
override val KEY_9_DOWN: Boolean = other.KEY_9_DOWN
|
||||
override val KEY_9_DURATION: Double = other.KEY_9_DURATION
|
||||
override val KEY_SEMICOLON_DOWN: Boolean = other.KEY_SEMICOLON_DOWN
|
||||
override val KEY_SEMICOLON_DURATION: Double = other.KEY_SEMICOLON_DURATION
|
||||
override val KEY_EQUAL_DOWN: Boolean = other.KEY_EQUAL_DOWN
|
||||
override val KEY_EQUAL_DURATION: Double = other.KEY_EQUAL_DURATION
|
||||
override val KEY_A_DOWN: Boolean = other.KEY_A_DOWN
|
||||
override val KEY_A_DURATION: Double = other.KEY_A_DURATION
|
||||
override val KEY_B_DOWN: Boolean = other.KEY_B_DOWN
|
||||
override val KEY_B_DURATION: Double = other.KEY_B_DURATION
|
||||
override val KEY_C_DOWN: Boolean = other.KEY_C_DOWN
|
||||
override val KEY_C_DURATION: Double = other.KEY_C_DURATION
|
||||
override val KEY_D_DOWN: Boolean = other.KEY_D_DOWN
|
||||
override val KEY_D_DURATION: Double = other.KEY_D_DURATION
|
||||
override val KEY_E_DOWN: Boolean = other.KEY_E_DOWN
|
||||
override val KEY_E_DURATION: Double = other.KEY_E_DURATION
|
||||
override val KEY_F_DOWN: Boolean = other.KEY_F_DOWN
|
||||
override val KEY_F_DURATION: Double = other.KEY_F_DURATION
|
||||
override val KEY_G_DOWN: Boolean = other.KEY_G_DOWN
|
||||
override val KEY_G_DURATION: Double = other.KEY_G_DURATION
|
||||
override val KEY_H_DOWN: Boolean = other.KEY_H_DOWN
|
||||
override val KEY_H_DURATION: Double = other.KEY_H_DURATION
|
||||
override val KEY_I_DOWN: Boolean = other.KEY_I_DOWN
|
||||
override val KEY_I_DURATION: Double = other.KEY_I_DURATION
|
||||
override val KEY_J_DOWN: Boolean = other.KEY_J_DOWN
|
||||
override val KEY_J_DURATION: Double = other.KEY_J_DURATION
|
||||
override val KEY_K_DOWN: Boolean = other.KEY_K_DOWN
|
||||
override val KEY_K_DURATION: Double = other.KEY_K_DURATION
|
||||
override val KEY_L_DOWN: Boolean = other.KEY_L_DOWN
|
||||
override val KEY_L_DURATION: Double = other.KEY_L_DURATION
|
||||
override val KEY_M_DOWN: Boolean = other.KEY_M_DOWN
|
||||
override val KEY_M_DURATION: Double = other.KEY_M_DURATION
|
||||
override val KEY_N_DOWN: Boolean = other.KEY_N_DOWN
|
||||
override val KEY_N_DURATION: Double = other.KEY_N_DURATION
|
||||
override val KEY_O_DOWN: Boolean = other.KEY_O_DOWN
|
||||
override val KEY_O_DURATION: Double = other.KEY_O_DURATION
|
||||
override val KEY_P_DOWN: Boolean = other.KEY_P_DOWN
|
||||
override val KEY_P_DURATION: Double = other.KEY_P_DURATION
|
||||
override val KEY_Q_DOWN: Boolean = other.KEY_Q_DOWN
|
||||
override val KEY_Q_DURATION: Double = other.KEY_Q_DURATION
|
||||
override val KEY_R_DOWN: Boolean = other.KEY_R_DOWN
|
||||
override val KEY_R_DURATION: Double = other.KEY_R_DURATION
|
||||
override val KEY_S_DOWN: Boolean = other.KEY_S_DOWN
|
||||
override val KEY_S_DURATION: Double = other.KEY_S_DURATION
|
||||
override val KEY_T_DOWN: Boolean = other.KEY_T_DOWN
|
||||
override val KEY_T_DURATION: Double = other.KEY_T_DURATION
|
||||
override val KEY_U_DOWN: Boolean = other.KEY_U_DOWN
|
||||
override val KEY_U_DURATION: Double = other.KEY_U_DURATION
|
||||
override val KEY_V_DOWN: Boolean = other.KEY_V_DOWN
|
||||
override val KEY_V_DURATION: Double = other.KEY_V_DURATION
|
||||
override val KEY_W_DOWN: Boolean = other.KEY_W_DOWN
|
||||
override val KEY_W_DURATION: Double = other.KEY_W_DURATION
|
||||
override val KEY_X_DOWN: Boolean = other.KEY_X_DOWN
|
||||
override val KEY_X_DURATION: Double = other.KEY_X_DURATION
|
||||
override val KEY_Y_DOWN: Boolean = other.KEY_Y_DOWN
|
||||
override val KEY_Y_DURATION: Double = other.KEY_Y_DURATION
|
||||
override val KEY_Z_DOWN: Boolean = other.KEY_Z_DOWN
|
||||
override val KEY_Z_DURATION: Double = other.KEY_Z_DURATION
|
||||
override val KEY_LEFT_BRACKET_DOWN: Boolean = other.KEY_LEFT_BRACKET_DOWN
|
||||
override val KEY_LEFT_BRACKET_DURATION: Double = other.KEY_LEFT_BRACKET_DURATION
|
||||
override val KEY_BACKSLASH_DOWN: Boolean = other.KEY_BACKSLASH_DOWN
|
||||
override val KEY_BACKSLASH_DURATION: Double = other.KEY_BACKSLASH_DURATION
|
||||
override val KEY_RIGHT_BRACKET_DOWN: Boolean = other.KEY_RIGHT_BRACKET_DOWN
|
||||
override val KEY_RIGHT_BRACKET_DURATION: Double = other.KEY_RIGHT_BRACKET_DURATION
|
||||
override val KEY_GRAVE_ACCENT_DOWN: Boolean = other.KEY_GRAVE_ACCENT_DOWN
|
||||
override val KEY_GRAVE_ACCENT_DURATION: Double = other.KEY_GRAVE_ACCENT_DURATION
|
||||
override val KEY_WORLD_1_DOWN: Boolean = other.KEY_WORLD_1_DOWN
|
||||
override val KEY_WORLD_1_DURATION: Double = other.KEY_WORLD_1_DURATION
|
||||
override val KEY_WORLD_2_DOWN: Boolean = other.KEY_WORLD_2_DOWN
|
||||
override val KEY_WORLD_2_DURATION: Double = other.KEY_WORLD_2_DURATION
|
||||
override val KEY_ESCAPE_DOWN: Boolean = other.KEY_ESCAPE_DOWN
|
||||
override val KEY_ESCAPE_DURATION: Double = other.KEY_ESCAPE_DURATION
|
||||
override val KEY_ENTER_DOWN: Boolean = other.KEY_ENTER_DOWN
|
||||
override val KEY_ENTER_DURATION: Double = other.KEY_ENTER_DURATION
|
||||
override val KEY_TAB_DOWN: Boolean = other.KEY_TAB_DOWN
|
||||
override val KEY_TAB_DURATION: Double = other.KEY_TAB_DURATION
|
||||
override val KEY_BACKSPACE_DOWN: Boolean = other.KEY_BACKSPACE_DOWN
|
||||
override val KEY_BACKSPACE_DURATION: Double = other.KEY_BACKSPACE_DURATION
|
||||
override val KEY_INSERT_DOWN: Boolean = other.KEY_INSERT_DOWN
|
||||
override val KEY_INSERT_DURATION: Double = other.KEY_INSERT_DURATION
|
||||
override val KEY_DELETE_DOWN: Boolean = other.KEY_DELETE_DOWN
|
||||
override val KEY_DELETE_DURATION: Double = other.KEY_DELETE_DURATION
|
||||
override val KEY_RIGHT_DOWN: Boolean = other.KEY_RIGHT_DOWN
|
||||
override val KEY_RIGHT_DURATION: Double = other.KEY_RIGHT_DURATION
|
||||
override val KEY_LEFT_DOWN: Boolean = other.KEY_LEFT_DOWN
|
||||
override val KEY_LEFT_DURATION: Double = other.KEY_LEFT_DURATION
|
||||
override val KEY_DOWN_DOWN: Boolean = other.KEY_DOWN_DOWN
|
||||
override val KEY_DOWN_DURATION: Double = other.KEY_DOWN_DURATION
|
||||
override val KEY_UP_DOWN: Boolean = other.KEY_UP_DOWN
|
||||
override val KEY_UP_DURATION: Double = other.KEY_UP_DURATION
|
||||
override val KEY_PAGE_UP_DOWN: Boolean = other.KEY_PAGE_UP_DOWN
|
||||
override val KEY_PAGE_UP_DURATION: Double = other.KEY_PAGE_UP_DURATION
|
||||
override val KEY_PAGE_DOWN_DOWN: Boolean = other.KEY_PAGE_DOWN_DOWN
|
||||
override val KEY_PAGE_DOWN_DURATION: Double = other.KEY_PAGE_DOWN_DURATION
|
||||
override val KEY_HOME_DOWN: Boolean = other.KEY_HOME_DOWN
|
||||
override val KEY_HOME_DURATION: Double = other.KEY_HOME_DURATION
|
||||
override val KEY_END_DOWN: Boolean = other.KEY_END_DOWN
|
||||
override val KEY_END_DURATION: Double = other.KEY_END_DURATION
|
||||
override val KEY_CAPS_LOCK_DOWN: Boolean = other.KEY_CAPS_LOCK_DOWN
|
||||
override val KEY_CAPS_LOCK_DURATION: Double = other.KEY_CAPS_LOCK_DURATION
|
||||
override val KEY_SCROLL_LOCK_DOWN: Boolean = other.KEY_SCROLL_LOCK_DOWN
|
||||
override val KEY_SCROLL_LOCK_DURATION: Double = other.KEY_SCROLL_LOCK_DURATION
|
||||
override val KEY_NUM_LOCK_DOWN: Boolean = other.KEY_NUM_LOCK_DOWN
|
||||
override val KEY_NUM_LOCK_DURATION: Double = other.KEY_NUM_LOCK_DURATION
|
||||
override val KEY_PRINT_SCREEN_DOWN: Boolean = other.KEY_PRINT_SCREEN_DOWN
|
||||
override val KEY_PRINT_SCREEN_DURATION: Double = other.KEY_PRINT_SCREEN_DURATION
|
||||
override val KEY_PAUSE_DOWN: Boolean = other.KEY_PAUSE_DOWN
|
||||
override val KEY_PAUSE_DURATION: Double = other.KEY_PAUSE_DURATION
|
||||
override val KEY_F1_DOWN: Boolean = other.KEY_F1_DOWN
|
||||
override val KEY_F1_DURATION: Double = other.KEY_F1_DURATION
|
||||
override val KEY_F2_DOWN: Boolean = other.KEY_F2_DOWN
|
||||
override val KEY_F2_DURATION: Double = other.KEY_F2_DURATION
|
||||
override val KEY_F3_DOWN: Boolean = other.KEY_F3_DOWN
|
||||
override val KEY_F3_DURATION: Double = other.KEY_F3_DURATION
|
||||
override val KEY_F4_DOWN: Boolean = other.KEY_F4_DOWN
|
||||
override val KEY_F4_DURATION: Double = other.KEY_F4_DURATION
|
||||
override val KEY_F5_DOWN: Boolean = other.KEY_F5_DOWN
|
||||
override val KEY_F5_DURATION: Double = other.KEY_F5_DURATION
|
||||
override val KEY_F6_DOWN: Boolean = other.KEY_F6_DOWN
|
||||
override val KEY_F6_DURATION: Double = other.KEY_F6_DURATION
|
||||
override val KEY_F7_DOWN: Boolean = other.KEY_F7_DOWN
|
||||
override val KEY_F7_DURATION: Double = other.KEY_F7_DURATION
|
||||
override val KEY_F8_DOWN: Boolean = other.KEY_F8_DOWN
|
||||
override val KEY_F8_DURATION: Double = other.KEY_F8_DURATION
|
||||
override val KEY_F9_DOWN: Boolean = other.KEY_F9_DOWN
|
||||
override val KEY_F9_DURATION: Double = other.KEY_F9_DURATION
|
||||
override val KEY_F10_DOWN: Boolean = other.KEY_F10_DOWN
|
||||
override val KEY_F10_DURATION: Double = other.KEY_F10_DURATION
|
||||
override val KEY_F11_DOWN: Boolean = other.KEY_F11_DOWN
|
||||
override val KEY_F11_DURATION: Double = other.KEY_F11_DURATION
|
||||
override val KEY_F12_DOWN: Boolean = other.KEY_F12_DOWN
|
||||
override val KEY_F12_DURATION: Double = other.KEY_F12_DURATION
|
||||
override val KEY_F13_DOWN: Boolean = other.KEY_F13_DOWN
|
||||
override val KEY_F13_DURATION: Double = other.KEY_F13_DURATION
|
||||
override val KEY_F14_DOWN: Boolean = other.KEY_F14_DOWN
|
||||
override val KEY_F14_DURATION: Double = other.KEY_F14_DURATION
|
||||
override val KEY_F15_DOWN: Boolean = other.KEY_F15_DOWN
|
||||
override val KEY_F15_DURATION: Double = other.KEY_F15_DURATION
|
||||
override val KEY_F16_DOWN: Boolean = other.KEY_F16_DOWN
|
||||
override val KEY_F16_DURATION: Double = other.KEY_F16_DURATION
|
||||
override val KEY_F17_DOWN: Boolean = other.KEY_F17_DOWN
|
||||
override val KEY_F17_DURATION: Double = other.KEY_F17_DURATION
|
||||
override val KEY_F18_DOWN: Boolean = other.KEY_F18_DOWN
|
||||
override val KEY_F18_DURATION: Double = other.KEY_F18_DURATION
|
||||
override val KEY_F19_DOWN: Boolean = other.KEY_F19_DOWN
|
||||
override val KEY_F19_DURATION: Double = other.KEY_F19_DURATION
|
||||
override val KEY_F20_DOWN: Boolean = other.KEY_F20_DOWN
|
||||
override val KEY_F20_DURATION: Double = other.KEY_F20_DURATION
|
||||
override val KEY_F21_DOWN: Boolean = other.KEY_F21_DOWN
|
||||
override val KEY_F21_DURATION: Double = other.KEY_F21_DURATION
|
||||
override val KEY_F22_DOWN: Boolean = other.KEY_F22_DOWN
|
||||
override val KEY_F22_DURATION: Double = other.KEY_F22_DURATION
|
||||
override val KEY_F23_DOWN: Boolean = other.KEY_F23_DOWN
|
||||
override val KEY_F23_DURATION: Double = other.KEY_F23_DURATION
|
||||
override val KEY_F24_DOWN: Boolean = other.KEY_F24_DOWN
|
||||
override val KEY_F24_DURATION: Double = other.KEY_F24_DURATION
|
||||
override val KEY_F25_DOWN: Boolean = other.KEY_F25_DOWN
|
||||
override val KEY_F25_DURATION: Double = other.KEY_F25_DURATION
|
||||
override val KEY_KP_0_DOWN: Boolean = other.KEY_KP_0_DOWN
|
||||
override val KEY_KP_0_DURATION: Double = other.KEY_KP_0_DURATION
|
||||
override val KEY_KP_1_DOWN: Boolean = other.KEY_KP_1_DOWN
|
||||
override val KEY_KP_1_DURATION: Double = other.KEY_KP_1_DURATION
|
||||
override val KEY_KP_2_DOWN: Boolean = other.KEY_KP_2_DOWN
|
||||
override val KEY_KP_2_DURATION: Double = other.KEY_KP_2_DURATION
|
||||
override val KEY_KP_3_DOWN: Boolean = other.KEY_KP_3_DOWN
|
||||
override val KEY_KP_3_DURATION: Double = other.KEY_KP_3_DURATION
|
||||
override val KEY_KP_4_DOWN: Boolean = other.KEY_KP_4_DOWN
|
||||
override val KEY_KP_4_DURATION: Double = other.KEY_KP_4_DURATION
|
||||
override val KEY_KP_5_DOWN: Boolean = other.KEY_KP_5_DOWN
|
||||
override val KEY_KP_5_DURATION: Double = other.KEY_KP_5_DURATION
|
||||
override val KEY_KP_6_DOWN: Boolean = other.KEY_KP_6_DOWN
|
||||
override val KEY_KP_6_DURATION: Double = other.KEY_KP_6_DURATION
|
||||
override val KEY_KP_7_DOWN: Boolean = other.KEY_KP_7_DOWN
|
||||
override val KEY_KP_7_DURATION: Double = other.KEY_KP_7_DURATION
|
||||
override val KEY_KP_8_DOWN: Boolean = other.KEY_KP_8_DOWN
|
||||
override val KEY_KP_8_DURATION: Double = other.KEY_KP_8_DURATION
|
||||
override val KEY_KP_9_DOWN: Boolean = other.KEY_KP_9_DOWN
|
||||
override val KEY_KP_9_DURATION: Double = other.KEY_KP_9_DURATION
|
||||
override val KEY_KP_DECIMAL_DOWN: Boolean = other.KEY_KP_DECIMAL_DOWN
|
||||
override val KEY_KP_DECIMAL_DURATION: Double = other.KEY_KP_DECIMAL_DURATION
|
||||
override val KEY_KP_DIVIDE_DOWN: Boolean = other.KEY_KP_DIVIDE_DOWN
|
||||
override val KEY_KP_DIVIDE_DURATION: Double = other.KEY_KP_DIVIDE_DURATION
|
||||
override val KEY_KP_MULTIPLY_DOWN: Boolean = other.KEY_KP_MULTIPLY_DOWN
|
||||
override val KEY_KP_MULTIPLY_DURATION: Double = other.KEY_KP_MULTIPLY_DURATION
|
||||
override val KEY_KP_SUBTRACT_DOWN: Boolean = other.KEY_KP_SUBTRACT_DOWN
|
||||
override val KEY_KP_SUBTRACT_DURATION: Double = other.KEY_KP_SUBTRACT_DURATION
|
||||
override val KEY_KP_ADD_DOWN: Boolean = other.KEY_KP_ADD_DOWN
|
||||
override val KEY_KP_ADD_DURATION: Double = other.KEY_KP_ADD_DURATION
|
||||
override val KEY_KP_ENTER_DOWN: Boolean = other.KEY_KP_ENTER_DOWN
|
||||
override val KEY_KP_ENTER_DURATION: Double = other.KEY_KP_ENTER_DURATION
|
||||
override val KEY_KP_EQUAL_DOWN: Boolean = other.KEY_KP_EQUAL_DOWN
|
||||
override val KEY_KP_EQUAL_DURATION: Double = other.KEY_KP_EQUAL_DURATION
|
||||
override val KEY_LEFT_SHIFT_DOWN: Boolean = other.KEY_LEFT_SHIFT_DOWN
|
||||
override val KEY_LEFT_SHIFT_DURATION: Double = other.KEY_LEFT_SHIFT_DURATION
|
||||
override val KEY_LEFT_CONTROL_DOWN: Boolean = other.KEY_LEFT_CONTROL_DOWN
|
||||
override val KEY_LEFT_CONTROL_DURATION: Double = other.KEY_LEFT_CONTROL_DURATION
|
||||
override val KEY_LEFT_ALT_DOWN: Boolean = other.KEY_LEFT_ALT_DOWN
|
||||
override val KEY_LEFT_ALT_DURATION: Double = other.KEY_LEFT_ALT_DURATION
|
||||
override val KEY_LEFT_SUPER_DOWN: Boolean = other.KEY_LEFT_SUPER_DOWN
|
||||
override val KEY_LEFT_SUPER_DURATION: Double = other.KEY_LEFT_SUPER_DURATION
|
||||
override val KEY_RIGHT_SHIFT_DOWN: Boolean = other.KEY_RIGHT_SHIFT_DOWN
|
||||
override val KEY_RIGHT_SHIFT_DURATION: Double = other.KEY_RIGHT_SHIFT_DURATION
|
||||
override val KEY_RIGHT_CONTROL_DOWN: Boolean = other.KEY_RIGHT_CONTROL_DOWN
|
||||
override val KEY_RIGHT_CONTROL_DURATION: Double = other.KEY_RIGHT_CONTROL_DURATION
|
||||
override val KEY_RIGHT_ALT_DOWN: Boolean = other.KEY_RIGHT_ALT_DOWN
|
||||
override val KEY_RIGHT_ALT_DURATION: Double = other.KEY_RIGHT_ALT_DURATION
|
||||
override val KEY_RIGHT_SUPER_DOWN: Boolean = other.KEY_RIGHT_SUPER_DOWN
|
||||
override val KEY_RIGHT_SUPER_DURATION: Double = other.KEY_RIGHT_SUPER_DURATION
|
||||
override val KEY_MENU_DOWN: Boolean = other.KEY_MENU_DOWN
|
||||
override val KEY_MENU_DURATION: Double = other.KEY_MENU_DURATION
|
||||
override val KEY_LAST_DOWN: Boolean = other.KEY_LAST_DOWN
|
||||
override val KEY_LAST_DURATION: Double = other.KEY_LAST_DURATION
|
||||
override val MOUSE_BUTTON_1_DOWN: Boolean = other.MOUSE_BUTTON_1_DOWN
|
||||
override val MOUSE_BUTTON_1_DURATION: Double = other.MOUSE_BUTTON_1_DURATION
|
||||
override val MOUSE_BUTTON_2_DOWN: Boolean = other.MOUSE_BUTTON_2_DOWN
|
||||
override val MOUSE_BUTTON_2_DURATION: Double = other.MOUSE_BUTTON_2_DURATION
|
||||
override val MOUSE_BUTTON_3_DOWN: Boolean = other.MOUSE_BUTTON_3_DOWN
|
||||
override val MOUSE_BUTTON_3_DURATION: Double = other.MOUSE_BUTTON_3_DURATION
|
||||
override val MOUSE_BUTTON_4_DOWN: Boolean = other.MOUSE_BUTTON_4_DOWN
|
||||
override val MOUSE_BUTTON_4_DURATION: Double = other.MOUSE_BUTTON_4_DURATION
|
||||
override val MOUSE_BUTTON_5_DOWN: Boolean = other.MOUSE_BUTTON_5_DOWN
|
||||
override val MOUSE_BUTTON_5_DURATION: Double = other.MOUSE_BUTTON_5_DURATION
|
||||
override val MOUSE_BUTTON_6_DOWN: Boolean = other.MOUSE_BUTTON_6_DOWN
|
||||
override val MOUSE_BUTTON_6_DURATION: Double = other.MOUSE_BUTTON_6_DURATION
|
||||
override val MOUSE_BUTTON_7_DOWN: Boolean = other.MOUSE_BUTTON_7_DOWN
|
||||
override val MOUSE_BUTTON_7_DURATION: Double = other.MOUSE_BUTTON_7_DURATION
|
||||
override val MOUSE_BUTTON_8_DOWN: Boolean = other.MOUSE_BUTTON_8_DOWN
|
||||
override val MOUSE_BUTTON_8_DURATION: Double = other.MOUSE_BUTTON_8_DURATION
|
||||
|
||||
override val KEY_SPACE_PRESSED: Boolean = other.KEY_SPACE_PRESSED
|
||||
override val KEY_APOSTROPHE_PRESSED: Boolean = other.KEY_APOSTROPHE_PRESSED
|
||||
override val KEY_COMMA_PRESSED: Boolean = other.KEY_COMMA_PRESSED
|
||||
override val KEY_MINUS_PRESSED: Boolean = other.KEY_MINUS_PRESSED
|
||||
override val KEY_PERIOD_PRESSED: Boolean = other.KEY_PERIOD_PRESSED
|
||||
override val KEY_SLASH_PRESSED: Boolean = other.KEY_SLASH_PRESSED
|
||||
override val KEY_0_PRESSED: Boolean = other.KEY_0_PRESSED
|
||||
override val KEY_1_PRESSED: Boolean = other.KEY_1_PRESSED
|
||||
override val KEY_2_PRESSED: Boolean = other.KEY_2_PRESSED
|
||||
override val KEY_3_PRESSED: Boolean = other.KEY_3_PRESSED
|
||||
override val KEY_4_PRESSED: Boolean = other.KEY_4_PRESSED
|
||||
override val KEY_5_PRESSED: Boolean = other.KEY_5_PRESSED
|
||||
override val KEY_6_PRESSED: Boolean = other.KEY_6_PRESSED
|
||||
override val KEY_7_PRESSED: Boolean = other.KEY_7_PRESSED
|
||||
override val KEY_8_PRESSED: Boolean = other.KEY_8_PRESSED
|
||||
override val KEY_9_PRESSED: Boolean = other.KEY_9_PRESSED
|
||||
override val KEY_SEMICOLON_PRESSED: Boolean = other.KEY_SEMICOLON_PRESSED
|
||||
override val KEY_EQUAL_PRESSED: Boolean = other.KEY_EQUAL_PRESSED
|
||||
override val KEY_A_PRESSED: Boolean = other.KEY_A_PRESSED
|
||||
override val KEY_B_PRESSED: Boolean = other.KEY_B_PRESSED
|
||||
override val KEY_C_PRESSED: Boolean = other.KEY_C_PRESSED
|
||||
override val KEY_D_PRESSED: Boolean = other.KEY_D_PRESSED
|
||||
override val KEY_E_PRESSED: Boolean = other.KEY_E_PRESSED
|
||||
override val KEY_F_PRESSED: Boolean = other.KEY_F_PRESSED
|
||||
override val KEY_G_PRESSED: Boolean = other.KEY_G_PRESSED
|
||||
override val KEY_H_PRESSED: Boolean = other.KEY_H_PRESSED
|
||||
override val KEY_I_PRESSED: Boolean = other.KEY_I_PRESSED
|
||||
override val KEY_J_PRESSED: Boolean = other.KEY_J_PRESSED
|
||||
override val KEY_K_PRESSED: Boolean = other.KEY_K_PRESSED
|
||||
override val KEY_L_PRESSED: Boolean = other.KEY_L_PRESSED
|
||||
override val KEY_M_PRESSED: Boolean = other.KEY_M_PRESSED
|
||||
override val KEY_N_PRESSED: Boolean = other.KEY_N_PRESSED
|
||||
override val KEY_O_PRESSED: Boolean = other.KEY_O_PRESSED
|
||||
override val KEY_P_PRESSED: Boolean = other.KEY_P_PRESSED
|
||||
override val KEY_Q_PRESSED: Boolean = other.KEY_Q_PRESSED
|
||||
override val KEY_R_PRESSED: Boolean = other.KEY_R_PRESSED
|
||||
override val KEY_S_PRESSED: Boolean = other.KEY_S_PRESSED
|
||||
override val KEY_T_PRESSED: Boolean = other.KEY_T_PRESSED
|
||||
override val KEY_U_PRESSED: Boolean = other.KEY_U_PRESSED
|
||||
override val KEY_V_PRESSED: Boolean = other.KEY_V_PRESSED
|
||||
override val KEY_W_PRESSED: Boolean = other.KEY_W_PRESSED
|
||||
override val KEY_X_PRESSED: Boolean = other.KEY_X_PRESSED
|
||||
override val KEY_Y_PRESSED: Boolean = other.KEY_Y_PRESSED
|
||||
override val KEY_Z_PRESSED: Boolean = other.KEY_Z_PRESSED
|
||||
override val KEY_LEFT_BRACKET_PRESSED: Boolean = other.KEY_LEFT_BRACKET_PRESSED
|
||||
override val KEY_BACKSLASH_PRESSED: Boolean = other.KEY_BACKSLASH_PRESSED
|
||||
override val KEY_RIGHT_BRACKET_PRESSED: Boolean = other.KEY_RIGHT_BRACKET_PRESSED
|
||||
override val KEY_GRAVE_ACCENT_PRESSED: Boolean = other.KEY_GRAVE_ACCENT_PRESSED
|
||||
override val KEY_WORLD_1_PRESSED: Boolean = other.KEY_WORLD_1_PRESSED
|
||||
override val KEY_WORLD_2_PRESSED: Boolean = other.KEY_WORLD_2_PRESSED
|
||||
override val KEY_ESCAPE_PRESSED: Boolean = other.KEY_ESCAPE_PRESSED
|
||||
override val KEY_ENTER_PRESSED: Boolean = other.KEY_ENTER_PRESSED
|
||||
override val KEY_TAB_PRESSED: Boolean = other.KEY_TAB_PRESSED
|
||||
override val KEY_BACKSPACE_PRESSED: Boolean = other.KEY_BACKSPACE_PRESSED
|
||||
override val KEY_INSERT_PRESSED: Boolean = other.KEY_INSERT_PRESSED
|
||||
override val KEY_DELETE_PRESSED: Boolean = other.KEY_DELETE_PRESSED
|
||||
override val KEY_RIGHT_PRESSED: Boolean = other.KEY_RIGHT_PRESSED
|
||||
override val KEY_LEFT_PRESSED: Boolean = other.KEY_LEFT_PRESSED
|
||||
override val KEY_DOWN_PRESSED: Boolean = other.KEY_DOWN_PRESSED
|
||||
override val KEY_UP_PRESSED: Boolean = other.KEY_UP_PRESSED
|
||||
override val KEY_PAGE_UP_PRESSED: Boolean = other.KEY_PAGE_UP_PRESSED
|
||||
override val KEY_PAGE_DOWN_PRESSED: Boolean = other.KEY_PAGE_DOWN_PRESSED
|
||||
override val KEY_HOME_PRESSED: Boolean = other.KEY_HOME_PRESSED
|
||||
override val KEY_END_PRESSED: Boolean = other.KEY_END_PRESSED
|
||||
override val KEY_CAPS_LOCK_PRESSED: Boolean = other.KEY_CAPS_LOCK_PRESSED
|
||||
override val KEY_SCROLL_LOCK_PRESSED: Boolean = other.KEY_SCROLL_LOCK_PRESSED
|
||||
override val KEY_NUM_LOCK_PRESSED: Boolean = other.KEY_NUM_LOCK_PRESSED
|
||||
override val KEY_PRINT_SCREEN_PRESSED: Boolean = other.KEY_PRINT_SCREEN_PRESSED
|
||||
override val KEY_PAUSE_PRESSED: Boolean = other.KEY_PAUSE_PRESSED
|
||||
override val KEY_F1_PRESSED: Boolean = other.KEY_F1_PRESSED
|
||||
override val KEY_F2_PRESSED: Boolean = other.KEY_F2_PRESSED
|
||||
override val KEY_F3_PRESSED: Boolean = other.KEY_F3_PRESSED
|
||||
override val KEY_F4_PRESSED: Boolean = other.KEY_F4_PRESSED
|
||||
override val KEY_F5_PRESSED: Boolean = other.KEY_F5_PRESSED
|
||||
override val KEY_F6_PRESSED: Boolean = other.KEY_F6_PRESSED
|
||||
override val KEY_F7_PRESSED: Boolean = other.KEY_F7_PRESSED
|
||||
override val KEY_F8_PRESSED: Boolean = other.KEY_F8_PRESSED
|
||||
override val KEY_F9_PRESSED: Boolean = other.KEY_F9_PRESSED
|
||||
override val KEY_F10_PRESSED: Boolean = other.KEY_F10_PRESSED
|
||||
override val KEY_F11_PRESSED: Boolean = other.KEY_F11_PRESSED
|
||||
override val KEY_F12_PRESSED: Boolean = other.KEY_F12_PRESSED
|
||||
override val KEY_F13_PRESSED: Boolean = other.KEY_F13_PRESSED
|
||||
override val KEY_F14_PRESSED: Boolean = other.KEY_F14_PRESSED
|
||||
override val KEY_F15_PRESSED: Boolean = other.KEY_F15_PRESSED
|
||||
override val KEY_F16_PRESSED: Boolean = other.KEY_F16_PRESSED
|
||||
override val KEY_F17_PRESSED: Boolean = other.KEY_F17_PRESSED
|
||||
override val KEY_F18_PRESSED: Boolean = other.KEY_F18_PRESSED
|
||||
override val KEY_F19_PRESSED: Boolean = other.KEY_F19_PRESSED
|
||||
override val KEY_F20_PRESSED: Boolean = other.KEY_F20_PRESSED
|
||||
override val KEY_F21_PRESSED: Boolean = other.KEY_F21_PRESSED
|
||||
override val KEY_F22_PRESSED: Boolean = other.KEY_F22_PRESSED
|
||||
override val KEY_F23_PRESSED: Boolean = other.KEY_F23_PRESSED
|
||||
override val KEY_F24_PRESSED: Boolean = other.KEY_F24_PRESSED
|
||||
override val KEY_F25_PRESSED: Boolean = other.KEY_F25_PRESSED
|
||||
override val KEY_KP_0_PRESSED: Boolean = other.KEY_KP_0_PRESSED
|
||||
override val KEY_KP_1_PRESSED: Boolean = other.KEY_KP_1_PRESSED
|
||||
override val KEY_KP_2_PRESSED: Boolean = other.KEY_KP_2_PRESSED
|
||||
override val KEY_KP_3_PRESSED: Boolean = other.KEY_KP_3_PRESSED
|
||||
override val KEY_KP_4_PRESSED: Boolean = other.KEY_KP_4_PRESSED
|
||||
override val KEY_KP_5_PRESSED: Boolean = other.KEY_KP_5_PRESSED
|
||||
override val KEY_KP_6_PRESSED: Boolean = other.KEY_KP_6_PRESSED
|
||||
override val KEY_KP_7_PRESSED: Boolean = other.KEY_KP_7_PRESSED
|
||||
override val KEY_KP_8_PRESSED: Boolean = other.KEY_KP_8_PRESSED
|
||||
override val KEY_KP_9_PRESSED: Boolean = other.KEY_KP_9_PRESSED
|
||||
override val KEY_KP_DECIMAL_PRESSED: Boolean = other.KEY_KP_DECIMAL_PRESSED
|
||||
override val KEY_KP_DIVIDE_PRESSED: Boolean = other.KEY_KP_DIVIDE_PRESSED
|
||||
override val KEY_KP_MULTIPLY_PRESSED: Boolean = other.KEY_KP_MULTIPLY_PRESSED
|
||||
override val KEY_KP_SUBTRACT_PRESSED: Boolean = other.KEY_KP_SUBTRACT_PRESSED
|
||||
override val KEY_KP_ADD_PRESSED: Boolean = other.KEY_KP_ADD_PRESSED
|
||||
override val KEY_KP_ENTER_PRESSED: Boolean = other.KEY_KP_ENTER_PRESSED
|
||||
override val KEY_KP_EQUAL_PRESSED: Boolean = other.KEY_KP_EQUAL_PRESSED
|
||||
override val KEY_LEFT_SHIFT_PRESSED: Boolean = other.KEY_LEFT_SHIFT_PRESSED
|
||||
override val KEY_LEFT_CONTROL_PRESSED: Boolean = other.KEY_LEFT_CONTROL_PRESSED
|
||||
override val KEY_LEFT_ALT_PRESSED: Boolean = other.KEY_LEFT_ALT_PRESSED
|
||||
override val KEY_LEFT_SUPER_PRESSED: Boolean = other.KEY_LEFT_SUPER_PRESSED
|
||||
override val KEY_RIGHT_SHIFT_PRESSED: Boolean = other.KEY_RIGHT_SHIFT_PRESSED
|
||||
override val KEY_RIGHT_CONTROL_PRESSED: Boolean = other.KEY_RIGHT_CONTROL_PRESSED
|
||||
override val KEY_RIGHT_ALT_PRESSED: Boolean = other.KEY_RIGHT_ALT_PRESSED
|
||||
override val KEY_RIGHT_SUPER_PRESSED: Boolean = other.KEY_RIGHT_SUPER_PRESSED
|
||||
override val KEY_MENU_PRESSED: Boolean = other.KEY_MENU_PRESSED
|
||||
override val KEY_LAST_PRESSED: Boolean = other.KEY_LAST_PRESSED
|
||||
override val KEY_SPACE_RELEASED: Boolean = other.KEY_SPACE_RELEASED
|
||||
override val KEY_APOSTROPHE_RELEASED: Boolean = other.KEY_APOSTROPHE_RELEASED
|
||||
override val KEY_COMMA_RELEASED: Boolean = other.KEY_COMMA_RELEASED
|
||||
override val KEY_MINUS_RELEASED: Boolean = other.KEY_MINUS_RELEASED
|
||||
override val KEY_PERIOD_RELEASED: Boolean = other.KEY_PERIOD_RELEASED
|
||||
override val KEY_SLASH_RELEASED: Boolean = other.KEY_SLASH_RELEASED
|
||||
override val KEY_0_RELEASED: Boolean = other.KEY_0_RELEASED
|
||||
override val KEY_1_RELEASED: Boolean = other.KEY_1_RELEASED
|
||||
override val KEY_2_RELEASED: Boolean = other.KEY_2_RELEASED
|
||||
override val KEY_3_RELEASED: Boolean = other.KEY_3_RELEASED
|
||||
override val KEY_4_RELEASED: Boolean = other.KEY_4_RELEASED
|
||||
override val KEY_5_RELEASED: Boolean = other.KEY_5_RELEASED
|
||||
override val KEY_6_RELEASED: Boolean = other.KEY_6_RELEASED
|
||||
override val KEY_7_RELEASED: Boolean = other.KEY_7_RELEASED
|
||||
override val KEY_8_RELEASED: Boolean = other.KEY_8_RELEASED
|
||||
override val KEY_9_RELEASED: Boolean = other.KEY_9_RELEASED
|
||||
override val KEY_SEMICOLON_RELEASED: Boolean = other.KEY_SEMICOLON_RELEASED
|
||||
override val KEY_EQUAL_RELEASED: Boolean = other.KEY_EQUAL_RELEASED
|
||||
override val KEY_A_RELEASED: Boolean = other.KEY_A_RELEASED
|
||||
override val KEY_B_RELEASED: Boolean = other.KEY_B_RELEASED
|
||||
override val KEY_C_RELEASED: Boolean = other.KEY_C_RELEASED
|
||||
override val KEY_D_RELEASED: Boolean = other.KEY_D_RELEASED
|
||||
override val KEY_E_RELEASED: Boolean = other.KEY_E_RELEASED
|
||||
override val KEY_F_RELEASED: Boolean = other.KEY_F_RELEASED
|
||||
override val KEY_G_RELEASED: Boolean = other.KEY_G_RELEASED
|
||||
override val KEY_H_RELEASED: Boolean = other.KEY_H_RELEASED
|
||||
override val KEY_I_RELEASED: Boolean = other.KEY_I_RELEASED
|
||||
override val KEY_J_RELEASED: Boolean = other.KEY_J_RELEASED
|
||||
override val KEY_K_RELEASED: Boolean = other.KEY_K_RELEASED
|
||||
override val KEY_L_RELEASED: Boolean = other.KEY_L_RELEASED
|
||||
override val KEY_M_RELEASED: Boolean = other.KEY_M_RELEASED
|
||||
override val KEY_N_RELEASED: Boolean = other.KEY_N_RELEASED
|
||||
override val KEY_O_RELEASED: Boolean = other.KEY_O_RELEASED
|
||||
override val KEY_P_RELEASED: Boolean = other.KEY_P_RELEASED
|
||||
override val KEY_Q_RELEASED: Boolean = other.KEY_Q_RELEASED
|
||||
override val KEY_R_RELEASED: Boolean = other.KEY_R_RELEASED
|
||||
override val KEY_S_RELEASED: Boolean = other.KEY_S_RELEASED
|
||||
override val KEY_T_RELEASED: Boolean = other.KEY_T_RELEASED
|
||||
override val KEY_U_RELEASED: Boolean = other.KEY_U_RELEASED
|
||||
override val KEY_V_RELEASED: Boolean = other.KEY_V_RELEASED
|
||||
override val KEY_W_RELEASED: Boolean = other.KEY_W_RELEASED
|
||||
override val KEY_X_RELEASED: Boolean = other.KEY_X_RELEASED
|
||||
override val KEY_Y_RELEASED: Boolean = other.KEY_Y_RELEASED
|
||||
override val KEY_Z_RELEASED: Boolean = other.KEY_Z_RELEASED
|
||||
override val KEY_LEFT_BRACKET_RELEASED: Boolean = other.KEY_LEFT_BRACKET_RELEASED
|
||||
override val KEY_BACKSLASH_RELEASED: Boolean = other.KEY_BACKSLASH_RELEASED
|
||||
override val KEY_RIGHT_BRACKET_RELEASED: Boolean = other.KEY_RIGHT_BRACKET_RELEASED
|
||||
override val KEY_GRAVE_ACCENT_RELEASED: Boolean = other.KEY_GRAVE_ACCENT_RELEASED
|
||||
override val KEY_WORLD_1_RELEASED: Boolean = other.KEY_WORLD_1_RELEASED
|
||||
override val KEY_WORLD_2_RELEASED: Boolean = other.KEY_WORLD_2_RELEASED
|
||||
override val KEY_ESCAPE_RELEASED: Boolean = other.KEY_ESCAPE_RELEASED
|
||||
override val KEY_ENTER_RELEASED: Boolean = other.KEY_ENTER_RELEASED
|
||||
override val KEY_TAB_RELEASED: Boolean = other.KEY_TAB_RELEASED
|
||||
override val KEY_BACKSPACE_RELEASED: Boolean = other.KEY_BACKSPACE_RELEASED
|
||||
override val KEY_INSERT_RELEASED: Boolean = other.KEY_INSERT_RELEASED
|
||||
override val KEY_DELETE_RELEASED: Boolean = other.KEY_DELETE_RELEASED
|
||||
override val KEY_RIGHT_RELEASED: Boolean = other.KEY_RIGHT_RELEASED
|
||||
override val KEY_LEFT_RELEASED: Boolean = other.KEY_LEFT_RELEASED
|
||||
override val KEY_DOWN_RELEASED: Boolean = other.KEY_DOWN_RELEASED
|
||||
override val KEY_UP_RELEASED: Boolean = other.KEY_UP_RELEASED
|
||||
override val KEY_PAGE_UP_RELEASED: Boolean = other.KEY_PAGE_UP_RELEASED
|
||||
override val KEY_PAGE_DOWN_RELEASED: Boolean = other.KEY_PAGE_DOWN_RELEASED
|
||||
override val KEY_HOME_RELEASED: Boolean = other.KEY_HOME_RELEASED
|
||||
override val KEY_END_RELEASED: Boolean = other.KEY_END_RELEASED
|
||||
override val KEY_CAPS_LOCK_RELEASED: Boolean = other.KEY_CAPS_LOCK_RELEASED
|
||||
override val KEY_SCROLL_LOCK_RELEASED: Boolean = other.KEY_SCROLL_LOCK_RELEASED
|
||||
override val KEY_NUM_LOCK_RELEASED: Boolean = other.KEY_NUM_LOCK_RELEASED
|
||||
override val KEY_PRINT_SCREEN_RELEASED: Boolean = other.KEY_PRINT_SCREEN_RELEASED
|
||||
override val KEY_PAUSE_RELEASED: Boolean = other.KEY_PAUSE_RELEASED
|
||||
override val KEY_F1_RELEASED: Boolean = other.KEY_F1_RELEASED
|
||||
override val KEY_F2_RELEASED: Boolean = other.KEY_F2_RELEASED
|
||||
override val KEY_F3_RELEASED: Boolean = other.KEY_F3_RELEASED
|
||||
override val KEY_F4_RELEASED: Boolean = other.KEY_F4_RELEASED
|
||||
override val KEY_F5_RELEASED: Boolean = other.KEY_F5_RELEASED
|
||||
override val KEY_F6_RELEASED: Boolean = other.KEY_F6_RELEASED
|
||||
override val KEY_F7_RELEASED: Boolean = other.KEY_F7_RELEASED
|
||||
override val KEY_F8_RELEASED: Boolean = other.KEY_F8_RELEASED
|
||||
override val KEY_F9_RELEASED: Boolean = other.KEY_F9_RELEASED
|
||||
override val KEY_F10_RELEASED: Boolean = other.KEY_F10_RELEASED
|
||||
override val KEY_F11_RELEASED: Boolean = other.KEY_F11_RELEASED
|
||||
override val KEY_F12_RELEASED: Boolean = other.KEY_F12_RELEASED
|
||||
override val KEY_F13_RELEASED: Boolean = other.KEY_F13_RELEASED
|
||||
override val KEY_F14_RELEASED: Boolean = other.KEY_F14_RELEASED
|
||||
override val KEY_F15_RELEASED: Boolean = other.KEY_F15_RELEASED
|
||||
override val KEY_F16_RELEASED: Boolean = other.KEY_F16_RELEASED
|
||||
override val KEY_F17_RELEASED: Boolean = other.KEY_F17_RELEASED
|
||||
override val KEY_F18_RELEASED: Boolean = other.KEY_F18_RELEASED
|
||||
override val KEY_F19_RELEASED: Boolean = other.KEY_F19_RELEASED
|
||||
override val KEY_F20_RELEASED: Boolean = other.KEY_F20_RELEASED
|
||||
override val KEY_F21_RELEASED: Boolean = other.KEY_F21_RELEASED
|
||||
override val KEY_F22_RELEASED: Boolean = other.KEY_F22_RELEASED
|
||||
override val KEY_F23_RELEASED: Boolean = other.KEY_F23_RELEASED
|
||||
override val KEY_F24_RELEASED: Boolean = other.KEY_F24_RELEASED
|
||||
override val KEY_F25_RELEASED: Boolean = other.KEY_F25_RELEASED
|
||||
override val KEY_KP_0_RELEASED: Boolean = other.KEY_KP_0_RELEASED
|
||||
override val KEY_KP_1_RELEASED: Boolean = other.KEY_KP_1_RELEASED
|
||||
override val KEY_KP_2_RELEASED: Boolean = other.KEY_KP_2_RELEASED
|
||||
override val KEY_KP_3_RELEASED: Boolean = other.KEY_KP_3_RELEASED
|
||||
override val KEY_KP_4_RELEASED: Boolean = other.KEY_KP_4_RELEASED
|
||||
override val KEY_KP_5_RELEASED: Boolean = other.KEY_KP_5_RELEASED
|
||||
override val KEY_KP_6_RELEASED: Boolean = other.KEY_KP_6_RELEASED
|
||||
override val KEY_KP_7_RELEASED: Boolean = other.KEY_KP_7_RELEASED
|
||||
override val KEY_KP_8_RELEASED: Boolean = other.KEY_KP_8_RELEASED
|
||||
override val KEY_KP_9_RELEASED: Boolean = other.KEY_KP_9_RELEASED
|
||||
override val KEY_KP_DECIMAL_RELEASED: Boolean = other.KEY_KP_DECIMAL_RELEASED
|
||||
override val KEY_KP_DIVIDE_RELEASED: Boolean = other.KEY_KP_DIVIDE_RELEASED
|
||||
override val KEY_KP_MULTIPLY_RELEASED: Boolean = other.KEY_KP_MULTIPLY_RELEASED
|
||||
override val KEY_KP_SUBTRACT_RELEASED: Boolean = other.KEY_KP_SUBTRACT_RELEASED
|
||||
override val KEY_KP_ADD_RELEASED: Boolean = other.KEY_KP_ADD_RELEASED
|
||||
override val KEY_KP_ENTER_RELEASED: Boolean = other.KEY_KP_ENTER_RELEASED
|
||||
override val KEY_KP_EQUAL_RELEASED: Boolean = other.KEY_KP_EQUAL_RELEASED
|
||||
override val KEY_LEFT_SHIFT_RELEASED: Boolean = other.KEY_LEFT_SHIFT_RELEASED
|
||||
override val KEY_LEFT_CONTROL_RELEASED: Boolean = other.KEY_LEFT_CONTROL_RELEASED
|
||||
override val KEY_LEFT_ALT_RELEASED: Boolean = other.KEY_LEFT_ALT_RELEASED
|
||||
override val KEY_LEFT_SUPER_RELEASED: Boolean = other.KEY_LEFT_SUPER_RELEASED
|
||||
override val KEY_RIGHT_SHIFT_RELEASED: Boolean = other.KEY_RIGHT_SHIFT_RELEASED
|
||||
override val KEY_RIGHT_CONTROL_RELEASED: Boolean = other.KEY_RIGHT_CONTROL_RELEASED
|
||||
override val KEY_RIGHT_ALT_RELEASED: Boolean = other.KEY_RIGHT_ALT_RELEASED
|
||||
override val KEY_RIGHT_SUPER_RELEASED: Boolean = other.KEY_RIGHT_SUPER_RELEASED
|
||||
override val KEY_MENU_RELEASED: Boolean = other.KEY_MENU_RELEASED
|
||||
override val KEY_LAST_RELEASED: Boolean = other.KEY_LAST_RELEASED
|
||||
|
||||
|
||||
override val MOUSE_BUTTON_1_RELEASED: Boolean = other.MOUSE_BUTTON_1_RELEASED
|
||||
override val MOUSE_BUTTON_2_RELEASED: Boolean = other.MOUSE_BUTTON_2_RELEASED
|
||||
override val MOUSE_BUTTON_3_RELEASED: Boolean = other.MOUSE_BUTTON_3_RELEASED
|
||||
override val MOUSE_BUTTON_4_RELEASED: Boolean = other.MOUSE_BUTTON_4_RELEASED
|
||||
override val MOUSE_BUTTON_5_RELEASED: Boolean = other.MOUSE_BUTTON_5_RELEASED
|
||||
override val MOUSE_BUTTON_6_RELEASED: Boolean = other.MOUSE_BUTTON_6_RELEASED
|
||||
override val MOUSE_BUTTON_7_RELEASED: Boolean = other.MOUSE_BUTTON_7_RELEASED
|
||||
override val MOUSE_BUTTON_8_RELEASED: Boolean = other.MOUSE_BUTTON_8_RELEASED
|
||||
|
||||
override val MOUSE_BUTTON_1_PRESSED: Boolean = other.MOUSE_BUTTON_1_PRESSED
|
||||
override val MOUSE_BUTTON_2_PRESSED: Boolean = other.MOUSE_BUTTON_2_PRESSED
|
||||
override val MOUSE_BUTTON_3_PRESSED: Boolean = other.MOUSE_BUTTON_3_PRESSED
|
||||
override val MOUSE_BUTTON_4_PRESSED: Boolean = other.MOUSE_BUTTON_4_PRESSED
|
||||
override val MOUSE_BUTTON_5_PRESSED: Boolean = other.MOUSE_BUTTON_5_PRESSED
|
||||
override val MOUSE_BUTTON_6_PRESSED: Boolean = other.MOUSE_BUTTON_6_PRESSED
|
||||
override val MOUSE_BUTTON_7_PRESSED: Boolean = other.MOUSE_BUTTON_7_PRESSED
|
||||
override val MOUSE_BUTTON_8_PRESSED: Boolean = other.MOUSE_BUTTON_8_PRESSED
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
package ru.dbotthepony.kstarbound.client.render
|
||||
|
||||
import org.lwjgl.glfw.GLFW.*
|
||||
import ru.dbotthepony.kstarbound.client.StarboundClient
|
||||
import ru.dbotthepony.kstarbound.math.*
|
||||
|
||||
class Camera {
|
||||
class Camera(val client: StarboundClient) {
|
||||
/**
|
||||
* Позиция этой камеры в Starbound Unit'ах
|
||||
*/
|
||||
@ -27,6 +28,18 @@ class Camera {
|
||||
GLFW_KEY_RIGHT -> pressedRight = action > 0
|
||||
GLFW_KEY_UP -> pressedUp = action > 0
|
||||
GLFW_KEY_DOWN -> pressedDown = action > 0
|
||||
|
||||
GLFW_KEY_C -> {
|
||||
if (action > 0) {
|
||||
client.settings.debugCollisions = !client.settings.debugCollisions
|
||||
|
||||
if (client.settings.debugCollisions) {
|
||||
client.putDebugLog("Enable collsion draw")
|
||||
} else {
|
||||
client.putDebugLog("Disable collsion draw")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +65,7 @@ class Camera {
|
||||
return vec
|
||||
}
|
||||
|
||||
fun tick(delta: Double) {
|
||||
fun think(delta: Double) {
|
||||
pos + velocity * delta.toFloat()
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,31 @@ data class AABB(val mins: Vector2d, val maxs: Vector2d) {
|
||||
return Vector2d(xDepth, yDepth)
|
||||
}
|
||||
|
||||
fun distance(other: AABB): Double {
|
||||
val intersectX: Boolean
|
||||
val intersectY: Boolean
|
||||
|
||||
if (ySpan <= other.ySpan)
|
||||
intersectY = mins.y in other.mins.y .. other.maxs.y || maxs.y in other.mins.y .. other.maxs.y
|
||||
else
|
||||
intersectY = other.mins.y in mins.y .. maxs.y || other.maxs.y in mins.y .. maxs.y
|
||||
|
||||
if (xSpan <= other.xSpan)
|
||||
intersectX = mins.x in other.mins.x .. other.maxs.x || maxs.x in other.mins.x .. other.maxs.x
|
||||
else
|
||||
intersectX = other.mins.x in mins.x .. maxs.x || other.maxs.x in mins.x .. maxs.x
|
||||
|
||||
if (intersectY && intersectX) {
|
||||
return 0.0
|
||||
}
|
||||
|
||||
if (intersectX) {
|
||||
return (mins.y - other.maxs.y).absoluteValue.coerceAtMost((maxs.y - other.mins.y).absoluteValue)
|
||||
} else {
|
||||
return (mins.x - other.maxs.x).absoluteValue.coerceAtMost((maxs.x - other.mins.x).absoluteValue)
|
||||
}
|
||||
}
|
||||
|
||||
fun pushOutFrom(other: AABB): Vector2d {
|
||||
if (!intersect(other))
|
||||
return Vector2d.ZERO
|
||||
@ -271,13 +296,13 @@ data class AABB(val mins: Vector2d, val maxs: Vector2d) {
|
||||
val normal: Vector2d
|
||||
|
||||
if (xEntry > yEntry) {
|
||||
if (xInvEntry < 0.0) {
|
||||
if (xInvEntry <= 0.0) { // исправление от меня: <= для тех случаев, когда мы уже на той же оси
|
||||
normal = Vector2d.RIGHT
|
||||
} else {
|
||||
normal = Vector2d.LEFT
|
||||
}
|
||||
} else {
|
||||
if (yInvEntry < 0.0) {
|
||||
if (yInvEntry <= 0.0) { // исправление от меня: <= для тех случаев, когда мы уже на той же оси
|
||||
normal = Vector2d.UP
|
||||
} else {
|
||||
normal = Vector2d.DOWN
|
||||
@ -313,8 +338,8 @@ data class AABB(val mins: Vector2d, val maxs: Vector2d) {
|
||||
|
||||
fun encasingChunkPosAABB(): AABBi {
|
||||
return AABBi(
|
||||
Vector2i(ChunkPos.tileToChunkComponent(roundByAbsoluteValue(mins.x)), ChunkPos.tileToChunkComponent(roundByAbsoluteValue(mins.y))),
|
||||
Vector2i(ChunkPos.tileToChunkComponent(roundByAbsoluteValue(maxs.x)), ChunkPos.tileToChunkComponent(roundByAbsoluteValue(maxs.y))),
|
||||
Vector2i(ChunkPos.tileToChunkComponent(roundTowardsNegativeInfinity(mins.x)), ChunkPos.tileToChunkComponent(roundTowardsNegativeInfinity(mins.y))),
|
||||
Vector2i(ChunkPos.tileToChunkComponent(roundTowardsPositiveInfinity(maxs.x)), ChunkPos.tileToChunkComponent(roundTowardsPositiveInfinity(maxs.y))),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package ru.dbotthepony.kstarbound.math
|
||||
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
fun lerp(t: Double, a: Double, b: Double): Double {
|
||||
return a * (1.0 - t) + b * t
|
||||
}
|
||||
@ -15,7 +17,7 @@ fun roundByAbsoluteValue(value: Double): Int {
|
||||
}
|
||||
|
||||
return value.toInt()
|
||||
} else if (value == -0.0 || value == 0.0) {
|
||||
} else if (value == 0.0) {
|
||||
return 0
|
||||
} else {
|
||||
if (value % 1.0 != -0.0) {
|
||||
@ -25,3 +27,53 @@ fun roundByAbsoluteValue(value: Double): Int {
|
||||
return value.toInt()
|
||||
}
|
||||
}
|
||||
|
||||
fun roundTowardsNegativeInfinity(value: Double): Int {
|
||||
if (value == 0.0)
|
||||
return 0
|
||||
|
||||
if (value > 0.0) {
|
||||
return value.toInt()
|
||||
}
|
||||
|
||||
if (value % 1.0 != -0.0) {
|
||||
return value.toInt() - 1
|
||||
}
|
||||
|
||||
return value.toInt()
|
||||
}
|
||||
|
||||
fun roundTowardsPositiveInfinity(value: Double): Int {
|
||||
if (value == 0.0)
|
||||
return 0
|
||||
|
||||
if (value < 0.0) {
|
||||
return value.toInt()
|
||||
}
|
||||
|
||||
if (value % 1.0 != 0.0) {
|
||||
return value.toInt() + 1
|
||||
}
|
||||
|
||||
return value.toInt()
|
||||
}
|
||||
|
||||
private const val EPSILON = 0.00000001
|
||||
|
||||
fun weakCompare(a: Double, b: Double, epsilon: Double = EPSILON): Int {
|
||||
if (a == b || (a - b).absoluteValue < epsilon) {
|
||||
return 0
|
||||
}
|
||||
|
||||
if (a > b)
|
||||
return 1
|
||||
|
||||
return -1
|
||||
}
|
||||
|
||||
fun weakDoubleZeroing(value: Double, epsilon: Double = EPSILON): Double {
|
||||
if (weakCompare(value, 0.0, epsilon) == 0)
|
||||
return 0.0
|
||||
|
||||
return value
|
||||
}
|
||||
|
@ -361,6 +361,8 @@ data class Vector2d(override val x: Double = 0.0, override val y: Double = 0.0)
|
||||
val INVERT_X = Vector2d(-1.0, 1.0)
|
||||
val INVERT_Y = Vector2d(1.0, -1.0)
|
||||
val INVERT_XY = Vector2d(-1.0, -1.0)
|
||||
|
||||
val DROP_TO_FLOOR = Vector2d(y = -1_000.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,11 @@ data class Color(val red: Float, val green: Float, val blue: Float, val alpha: F
|
||||
|
||||
companion object {
|
||||
val WHITE = Color(1f, 1f, 1f)
|
||||
|
||||
val RED = Color(1f, 0f, 0f)
|
||||
val GREEN = Color(0f, 1f, 0f)
|
||||
val BLUE = Color(0f, 0f, 1f)
|
||||
|
||||
val SLATE_GREY = Color(0.2f, 0.2f, 0.2f)
|
||||
|
||||
val SHADES_OF_GRAY = ArrayList<Color>().let {
|
||||
|
@ -1,13 +1,12 @@
|
||||
package ru.dbotthepony.kstarbound.world
|
||||
|
||||
import ru.dbotthepony.kstarbound.api.IStruct2d
|
||||
import ru.dbotthepony.kstarbound.api.IStruct2i
|
||||
import ru.dbotthepony.kstarbound.defs.TileDefinition
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.IVector2i
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.math.Vector2i
|
||||
import ru.dbotthepony.kstarbound.math.*
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
/**
|
||||
* Представляет из себя класс, который содержит состояние тайла на заданной позиции
|
||||
@ -163,15 +162,26 @@ data class ChunkPos(override val x: Int, override val y: Int) : IVector2i<ChunkP
|
||||
val lastBlock get() = Vector2i(((x + 1) shl CHUNK_SHIFT) - 1, ((y + 1) shl CHUNK_SHIFT) - 1)
|
||||
|
||||
companion object {
|
||||
val ZERO = ChunkPos(0, 0)
|
||||
|
||||
fun fromTilePosition(input: IStruct2i): ChunkPos {
|
||||
val (x, y) = input
|
||||
return ChunkPos(tileToChunkComponent(x), tileToChunkComponent(y))
|
||||
}
|
||||
|
||||
fun fromTilePosition(input: IStruct2d): ChunkPos {
|
||||
val (x, y) = input
|
||||
return fromTilePosition(x, y)
|
||||
}
|
||||
|
||||
fun fromTilePosition(x: Int, y: Int): ChunkPos {
|
||||
return ChunkPos(tileToChunkComponent(x), tileToChunkComponent(y))
|
||||
}
|
||||
|
||||
fun fromTilePosition(x: Double, y: Double): ChunkPos {
|
||||
return ChunkPos(tileToChunkComponent(roundByAbsoluteValue(x)), tileToChunkComponent(roundByAbsoluteValue(y)))
|
||||
}
|
||||
|
||||
fun normalizeCoordinate(input: Int): Int {
|
||||
val band = input and CHUNK_SIZE_FF
|
||||
|
||||
@ -183,6 +193,10 @@ data class ChunkPos(override val x: Int, override val y: Int) : IVector2i<ChunkP
|
||||
}
|
||||
|
||||
fun tileToChunkComponent(comp: Int): Int {
|
||||
if (comp < 0) {
|
||||
return -(comp.absoluteValue shr CHUNK_SHIFT) - 1
|
||||
}
|
||||
|
||||
return comp shr CHUNK_SHIFT
|
||||
}
|
||||
}
|
||||
@ -337,6 +351,8 @@ open class Chunk(val world: World<*>?, val pos: ChunkPos) {
|
||||
private val collisionCacheView = Collections.unmodifiableCollection(collisionCache)
|
||||
private var collisionChangeset = -1
|
||||
|
||||
// максимально грубое комбинирование тайлов в бруски для коллизии
|
||||
// TODO: https://ru.wikipedia.org/wiki/R-дерево_(структура_данных)
|
||||
private fun bakeCollisions() {
|
||||
collisionChangeset = changeset
|
||||
val seen = BooleanArray(tiles.size)
|
||||
|
@ -2,9 +2,10 @@ package ru.dbotthepony.kstarbound.world
|
||||
|
||||
import ru.dbotthepony.kstarbound.METRES_IN_STARBOUND_UNIT
|
||||
import ru.dbotthepony.kstarbound.defs.TileDefinition
|
||||
import ru.dbotthepony.kstarbound.math.AABBi
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.math.Vector2i
|
||||
import ru.dbotthepony.kstarbound.math.*
|
||||
import ru.dbotthepony.kstarbound.world.entities.CollisionResolution
|
||||
import ru.dbotthepony.kstarbound.world.entities.Entity
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
/**
|
||||
* Возвращает кортеж чанка, который содержит родителя (мир) и соседей (кортежи чанков)
|
||||
@ -45,10 +46,59 @@ open class MutableWorldChunkTuple(
|
||||
|
||||
const val EARTH_FREEFALL_ACCELERATION = 9.8312 / METRES_IN_STARBOUND_UNIT
|
||||
|
||||
data class WorldSweepResult(
|
||||
val hitPosition: Vector2d,
|
||||
val collisionTime: Double,
|
||||
val hitAnything: Boolean,
|
||||
val hitNormal: Vector2d
|
||||
)
|
||||
|
||||
private const val EPSILON = 0.00001
|
||||
|
||||
abstract class World<T : IMutableWorldChunkTuple>(val seed: Long = 0L) {
|
||||
protected val chunkMap = HashMap<ChunkPos, T>()
|
||||
protected var lastAccessedChunk: T? = null
|
||||
|
||||
/**
|
||||
* Таймер этого мира, в секундах.
|
||||
*
|
||||
* Условия:
|
||||
* * Это значение МОЖЕТ уменьшаться, в том числе в силу того, что клиент
|
||||
* обсчитывает мир быстрее, чем сервер, и наоборот.
|
||||
* * Точка отсчёта не имеет смысла (по умолчанию отсчитывается от нуля).
|
||||
* * Все сущности обязаны использовать этот таймер для определения времени своих событий
|
||||
* * Таймер НЕ МОЖЕТ возвращать разные значения в пределах одного тика.
|
||||
* т.е. таймер должен быть обновлён только после или перед тиком всех потомков
|
||||
* * НЕ ОБЯЗАН соответствовать течению реального времени, но как правило, соответствует ему
|
||||
* (если позволяет скорость обсчёта потомков).
|
||||
* * ОБЯЗАН быть сохранён при сохранении мира, и выставляться при его загрузке.
|
||||
*/
|
||||
var timer: Double = 0.0
|
||||
protected set
|
||||
|
||||
/**
|
||||
* Заставляет этот мир "думать" на заданное количество секунд.
|
||||
* Вызывает все необходимые методы у потомков, обновляя игровое состояние.
|
||||
*/
|
||||
fun think(delta: Double) {
|
||||
require(delta > 0.0) { "Tried to update $this by $delta seconds" }
|
||||
|
||||
timer += delta
|
||||
thinkInner(delta)
|
||||
}
|
||||
|
||||
protected abstract fun thinkInner(delta: Double)
|
||||
|
||||
/**
|
||||
* Сущности, у которых нет чанка, но они находятся в этом мире
|
||||
*/
|
||||
val orphanedEntities = HashSet<Entity>()
|
||||
|
||||
/**
|
||||
* Сущности, находящиеся в этом мире
|
||||
*/
|
||||
val entities = HashSet<Entity>()
|
||||
|
||||
/**
|
||||
* Стандартное ускорение свободного падения в Starbound Units/секунда^2
|
||||
*
|
||||
@ -116,6 +166,20 @@ abstract class World<T : IMutableWorldChunkTuple>(val seed: Long = 0L) {
|
||||
|
||||
lastAccessedChunk = tuple
|
||||
|
||||
val orphanedInThisChunk = ArrayList<Entity>()
|
||||
|
||||
for (ent in orphanedEntities) {
|
||||
val cPos = ChunkPos.fromTilePosition(ent.pos)
|
||||
|
||||
if (cPos == pos) {
|
||||
orphanedInThisChunk.add(ent)
|
||||
}
|
||||
}
|
||||
|
||||
for (ent in orphanedInThisChunk) {
|
||||
ent.chunk = chunk
|
||||
}
|
||||
|
||||
return@lazy tuple
|
||||
}
|
||||
}
|
||||
@ -218,4 +282,201 @@ abstract class World<T : IMutableWorldChunkTuple>(val seed: Long = 0L) {
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
/**
|
||||
* Производит проверку на пересечение [worldaabb] с геометрией мира при попытке пройти в [_deltaMovement]
|
||||
*/
|
||||
fun sweep(
|
||||
worldaabb: AABB,
|
||||
_deltaMovement: Vector2d,
|
||||
collisionResolution: CollisionResolution,
|
||||
delta: Double
|
||||
): WorldSweepResult {
|
||||
var deltaMovement = _deltaMovement
|
||||
|
||||
var potentialAABB = worldaabb + deltaMovement
|
||||
var combined = worldaabb.combine(potentialAABB)
|
||||
|
||||
val collected = collectInternal((combined).encasingChunkPosAABB())
|
||||
.map { it.chunk.foreground.collisionLayers() }
|
||||
.flatten()
|
||||
.sortedWith { o1, o2 ->
|
||||
val a = o1.distance(worldaabb)
|
||||
val b = o2.distance(worldaabb)
|
||||
|
||||
if (a == b)
|
||||
return@sortedWith 0
|
||||
|
||||
if (a > b)
|
||||
return@sortedWith 1
|
||||
|
||||
return@sortedWith -1
|
||||
}
|
||||
|
||||
var hitAnything = false
|
||||
var hitNormal = Vector2d.ZERO
|
||||
|
||||
if (collected.isNotEmpty()) {
|
||||
for (iteration in 0 .. 100) {
|
||||
var collided = false
|
||||
|
||||
for (aabb in collected) {
|
||||
// залез в блоки?
|
||||
/*if (potentialAABB.intersectWeak(aabb)) {
|
||||
val push = worldaabb.pushOutFrom(aabb)
|
||||
println("into tiles")
|
||||
|
||||
if (push.length > 0.0) {
|
||||
if (iteration == 0) {
|
||||
collided = true
|
||||
continue
|
||||
} else {
|
||||
hitAnything = true
|
||||
deltaMovement -= push * delta * 5.0
|
||||
potentialAABB = worldaabb + deltaMovement
|
||||
combined = worldaabb.combine(potentialAABB)
|
||||
|
||||
collided = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// ранний тест (отсечение заведомо не пересекаемой геометрии)
|
||||
if (!aabb.intersect(combined)) {
|
||||
continue
|
||||
}
|
||||
|
||||
// обычный тест коллизии
|
||||
val (normal, collisionTime) = worldaabb.sweep(aabb, deltaMovement)
|
||||
|
||||
if (collisionTime != 1.0) {
|
||||
hitAnything = true
|
||||
collided = true
|
||||
hitNormal = normal
|
||||
|
||||
if (weakDoubleZeroing(collisionTime) == 0.0) {
|
||||
// Мы ВПЛОТНУЮ стоим к другой геометрии (пересекаемся одной из осей)
|
||||
deltaMovement = Vector2d.ZERO
|
||||
} else {
|
||||
val remainingTime = 1.0 - collisionTime
|
||||
|
||||
when (collisionResolution) {
|
||||
CollisionResolution.STOP -> {
|
||||
// val weak = weakDoubleZeroing(collisionTime, epsilon = EPSILON)
|
||||
|
||||
for (i in 100 downTo 1) {
|
||||
val move = deltaMovement * collisionTime * (i / 100.0)
|
||||
|
||||
// сегодня, в программе
|
||||
// погрешность плавающей запятой
|
||||
if (!(worldaabb + move).intersect(aabb)) {
|
||||
deltaMovement = move
|
||||
break
|
||||
} // ЭтО чО вАщЕ ТакОе?
|
||||
}
|
||||
}
|
||||
|
||||
CollisionResolution.PUSH -> {
|
||||
var dot = deltaMovement.invDotProduct(normal)
|
||||
val magnitude = deltaMovement.length * weakDoubleZeroing(remainingTime, epsilon = EPSILON)
|
||||
|
||||
if (dot > 0.0) {
|
||||
dot = 1.0
|
||||
} else {
|
||||
dot = -1.0
|
||||
}
|
||||
|
||||
deltaMovement = Vector2d(dot * normal.y * magnitude, dot * normal.x * magnitude)
|
||||
}
|
||||
|
||||
CollisionResolution.SLIDE -> {
|
||||
val dot = deltaMovement.invDotProduct(normal) * remainingTime
|
||||
|
||||
if (weakDoubleZeroing(dot) != 0.0) {
|
||||
deltaMovement = Vector2d(dot * normal.y, dot * normal.x)
|
||||
} else {
|
||||
// Граничный случай: Направления идеально противоположны.
|
||||
// Обрабатываем как CollisionResolution.STOP
|
||||
|
||||
// val weak = weakDoubleZeroing(collisionTime, epsilon = EPSILON)
|
||||
|
||||
for (i in 100 downTo 1) {
|
||||
val move = deltaMovement * collisionTime * (i / 100.0)
|
||||
|
||||
// сегодня, в программе
|
||||
// погрешность плавающей запятой
|
||||
if (!(worldaabb + move).intersect(aabb)) {
|
||||
deltaMovement = move
|
||||
break
|
||||
} // ЭтО чО вАщЕ ТакОе?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CollisionResolution.BOUNCE -> {
|
||||
deltaMovement *= weakDoubleZeroing(remainingTime, epsilon = EPSILON)
|
||||
|
||||
if (normal.x.absoluteValue > 0.00001 && normal.y.absoluteValue > 0.00001) {
|
||||
deltaMovement *= Vector2d.INVERT_XY
|
||||
} else if (normal.x.absoluteValue > 0.00001) {
|
||||
deltaMovement *= Vector2d.INVERT_X
|
||||
} else if (normal.y.absoluteValue > 0.00001) {
|
||||
deltaMovement *= Vector2d.INVERT_Y
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
potentialAABB = worldaabb + deltaMovement
|
||||
}
|
||||
}
|
||||
|
||||
if (!collided) {
|
||||
//println("resolved in $iteration")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return WorldSweepResult(
|
||||
hitAnything = hitAnything,
|
||||
hitNormal = hitNormal,
|
||||
collisionTime = worldaabb.centre.distance(deltaMovement) / worldaabb.centre.distance(_deltaMovement),
|
||||
hitPosition = deltaMovement,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает, застрянет ли сущность будет с коллизией [worldaabb]
|
||||
*/
|
||||
fun isSpaceEmptyFromTiles(worldaabb: AABB): Boolean {
|
||||
val collected = collectInternal(worldaabb.encasingChunkPosAABB())
|
||||
.map { it.chunk.foreground.collisionLayers() }
|
||||
.flatten()
|
||||
.sortedWith { o1, o2 ->
|
||||
val a = o1.distance(worldaabb)
|
||||
val b = o2.distance(worldaabb)
|
||||
|
||||
if (a == b)
|
||||
return@sortedWith 0
|
||||
|
||||
if (a > b)
|
||||
return@sortedWith 1
|
||||
|
||||
return@sortedWith -1
|
||||
}
|
||||
|
||||
if (collected.isEmpty()) {
|
||||
return true
|
||||
}
|
||||
|
||||
for (aabb in collected) {
|
||||
if (aabb.intersectWeak(worldaabb)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,218 @@
|
||||
package ru.dbotthepony.kstarbound.world.entities
|
||||
|
||||
import ru.dbotthepony.kstarbound.client.ClientWorld
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.util.Color
|
||||
import ru.dbotthepony.kstarbound.world.World
|
||||
|
||||
open class AliveEntity(world: World<*>) : Entity(world) {
|
||||
var maxHealth = 10.0
|
||||
var health = 10.0
|
||||
enum class Move {
|
||||
STAND_STILL,
|
||||
MOVE_LEFT,
|
||||
MOVE_RIGHT
|
||||
}
|
||||
|
||||
open class AliveEntity(world: World<*>) : Entity(world) {
|
||||
open var maxHealth = 10.0
|
||||
open var health = 10.0
|
||||
open val moveDirection = Move.STAND_STILL
|
||||
override val collisionResolution = CollisionResolution.SLIDE
|
||||
|
||||
open val aabbDucked get() = aabb
|
||||
|
||||
override val worldaabb: AABB get() {
|
||||
if (isDucked) {
|
||||
return aabbDucked + pos
|
||||
}
|
||||
|
||||
return super.worldaabb
|
||||
}
|
||||
|
||||
var wantsToDuck = false
|
||||
var isDucked = false
|
||||
protected set
|
||||
|
||||
/**
|
||||
* Максимальная скорость передвижения этого существа в Starbound Units/секунда
|
||||
*
|
||||
* Скорость передвижения: Это скорость вдоль земли (или в воздухе, если парит) при ходьбе.
|
||||
*
|
||||
* Если вектор скорости вдоль поверхности (или в воздухе, если парит) больше заданного значения,
|
||||
* то сущность быстро тормозит (учитывая силу трения)
|
||||
*/
|
||||
open val topSpeed = 20.0
|
||||
|
||||
/**
|
||||
* Скорость ускорения сущности в Starbound Units/секунда^2
|
||||
*
|
||||
* Если сущность хочет двигаться вправо или влево (а также вверх или вниз, если парит),
|
||||
* то она разгоняется с данной скоростью.
|
||||
*/
|
||||
open val moveSpeed = 64.0
|
||||
|
||||
/**
|
||||
* То, как сущность может влиять на свою скорость в Starbound Units/секунда^2
|
||||
* когда находится в свободном падении или в состоянии невесомости.
|
||||
*
|
||||
* Позволяет в т.ч. игрокам изменять свою траекторию полёта в стиле Quake.
|
||||
*/
|
||||
open val freeFallMoveSpeed = 8.0
|
||||
|
||||
/**
|
||||
* "Сила", с которой сущность останавливается, если не хочет двигаться.
|
||||
*
|
||||
* Зависит от текущего трения, так как технически является множителем трения поверхности,
|
||||
* на которой стоит сущность. Если сущность парит, то сила трения является константой и не зависит от её окружения.
|
||||
*/
|
||||
open val brakeForce = 32.0
|
||||
|
||||
/**
|
||||
* Импульс прыжка данной сущности. Если сущность парит, то данное значение не несёт никакой
|
||||
* полезной нагрузки.
|
||||
*/
|
||||
open val jumpForce = 20.0
|
||||
|
||||
/**
|
||||
* Высота шага данной сущности. Данное значение отвечает за то, на сколько блоков
|
||||
* сможет подняться сущность просто двигаясь в одном направлении без необходимости прыгнуть.
|
||||
*/
|
||||
open val stepSize = 1.1
|
||||
|
||||
override fun thinkPhysics(delta: Double) {
|
||||
super.thinkPhysics(delta)
|
||||
thinkMovement(delta)
|
||||
}
|
||||
|
||||
protected var jumpRequested = false
|
||||
protected var nextJump = 0.0
|
||||
|
||||
open fun requestJump() {
|
||||
if (jumpRequested || nextJump > world.timer)
|
||||
return
|
||||
|
||||
jumpRequested = true
|
||||
nextJump = world.timer + 0.1
|
||||
}
|
||||
|
||||
open fun recallJump() {
|
||||
if (jumpRequested) {
|
||||
jumpRequested = false
|
||||
nextJump = 0.0
|
||||
}
|
||||
}
|
||||
|
||||
open fun thinkMovement(delta: Double) {
|
||||
if (onGround || !affectedByGravity) {
|
||||
var add: Vector2d
|
||||
|
||||
if (isDucked) {
|
||||
thinkFriction(delta * brakeForce)
|
||||
add = Vector2d.ZERO
|
||||
} else {
|
||||
when (moveDirection) {
|
||||
Move.STAND_STILL -> {
|
||||
thinkFriction(delta * brakeForce)
|
||||
add = Vector2d.ZERO
|
||||
}
|
||||
|
||||
Move.MOVE_LEFT -> {
|
||||
if (velocity.x > 0.0) {
|
||||
thinkFriction(delta * brakeForce)
|
||||
}
|
||||
|
||||
add = Vector2d(x = -delta * moveSpeed)
|
||||
}
|
||||
|
||||
Move.MOVE_RIGHT -> {
|
||||
if (velocity.x < 0.0) {
|
||||
thinkFriction(delta * brakeForce)
|
||||
}
|
||||
|
||||
add = Vector2d(x = delta * moveSpeed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (add != Vector2d.ZERO) {
|
||||
if (isSpaceOpen(add, delta)) {
|
||||
velocity += add
|
||||
|
||||
// спускание с "лестницы"
|
||||
val sweep = sweepAbsolute(pos + velocity * delta * 4.0, Vector2d(y = -stepSize), delta)
|
||||
|
||||
if (sweep.hitAnything && sweep.hitPosition.y < -0.1) {
|
||||
dropToFloor()
|
||||
thinkFriction(delta * 6.0)
|
||||
}
|
||||
|
||||
if (world is ClientWorld && world.client.settings.debugCollisions) {
|
||||
world.client.onPostDrawWorldOnce {
|
||||
world.client.gl.quadWireframe(worldaabb + velocity * delta * 4.0 + sweep.hitPosition, Color.RED)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// подъем по "лестнице"
|
||||
val sweep = sweepRelative(Vector2d(y = stepSize), delta)
|
||||
|
||||
if (!sweep.hitAnything) {
|
||||
val sweep2 = sweepAbsolute(pos + sweep.hitPosition, Vector2d(x = -0.1 + add.x), delta)
|
||||
|
||||
if (!sweep2.hitAnything) {
|
||||
pos += sweep.hitPosition + sweep2.hitPosition
|
||||
thinkFriction(delta * 64.0)
|
||||
dropToFloor()
|
||||
}
|
||||
|
||||
if (world is ClientWorld && world.client.settings.debugCollisions) {
|
||||
world.client.onPostDrawWorldOnce {
|
||||
world.client.gl.quadWireframe(worldaabb + sweep.hitPosition + sweep2.hitPosition, Color.GREEN)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (world is ClientWorld && world.client.settings.debugCollisions) {
|
||||
world.client.onPostDrawWorldOnce {
|
||||
world.client.gl.quadWireframe(worldaabb + sweep.hitPosition, Color.BLUE)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (velocity.length > topSpeed) {
|
||||
thinkFriction(delta * (velocity.length - topSpeed))
|
||||
}
|
||||
|
||||
if (jumpRequested) {
|
||||
jumpRequested = false
|
||||
velocity += groundNormal * jumpForce
|
||||
onGround = false
|
||||
}
|
||||
} else if (!onGround && affectedByGravity) {
|
||||
when (moveDirection) {
|
||||
Move.STAND_STILL -> {}
|
||||
|
||||
Move.MOVE_LEFT -> {
|
||||
val add = Vector2d(x = -delta * freeFallMoveSpeed)
|
||||
|
||||
if (isSpaceOpen(add, delta))
|
||||
velocity += add
|
||||
}
|
||||
|
||||
Move.MOVE_RIGHT -> {
|
||||
val add = Vector2d(x = delta * freeFallMoveSpeed)
|
||||
|
||||
if (isSpaceOpen(add, delta))
|
||||
velocity += add
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (wantsToDuck && onGround) {
|
||||
isDucked = true
|
||||
} else if (isDucked) {
|
||||
if (world.isSpaceEmptyFromTiles(aabb + pos)) {
|
||||
isDucked = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.math.lerp
|
||||
import ru.dbotthepony.kstarbound.world.Chunk
|
||||
import ru.dbotthepony.kstarbound.world.ChunkPos
|
||||
import ru.dbotthepony.kstarbound.world.World
|
||||
import kotlin.math.absoluteValue
|
||||
|
||||
enum class CollisionResolution {
|
||||
STOP,
|
||||
@ -20,11 +20,66 @@ enum class CollisionResolution {
|
||||
*/
|
||||
open class Entity(val world: World<*>) {
|
||||
var chunk: Chunk? = null
|
||||
protected set
|
||||
set(value) {
|
||||
if (!spawned) {
|
||||
throw IllegalStateException("Trying to set chunk this entity belong to before spawning in world")
|
||||
}
|
||||
|
||||
if (value == field) {
|
||||
return
|
||||
}
|
||||
|
||||
val chunkPos = ChunkPos.fromTilePosition(pos)
|
||||
|
||||
if (value != null && chunkPos != value.pos) {
|
||||
throw IllegalStateException("Set proper position before setting chunk this Entity belongs to")
|
||||
}
|
||||
|
||||
val oldChunk = chunk
|
||||
field = value
|
||||
|
||||
if (oldChunk == null && value != null) {
|
||||
world.orphanedEntities.remove(this)
|
||||
} else if (oldChunk != null && value == null) {
|
||||
world.orphanedEntities.add(this)
|
||||
}
|
||||
}
|
||||
|
||||
open val worldaabb: AABB get() = aabb + pos
|
||||
|
||||
val worldaabb get() = aabb + pos
|
||||
var pos = Vector2d()
|
||||
set(value) {
|
||||
if (field == value)
|
||||
return
|
||||
|
||||
val old = field
|
||||
field = value
|
||||
|
||||
if (spawned) {
|
||||
val oldChunkPos = ChunkPos.fromTilePosition(old)
|
||||
val newChunkPos = ChunkPos.fromTilePosition(value)
|
||||
|
||||
if (oldChunkPos != newChunkPos) {
|
||||
chunk = world.getChunk(newChunkPos)?.chunk
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var velocity = Vector2d()
|
||||
private var spawned = false
|
||||
|
||||
fun spawn() {
|
||||
if (spawned)
|
||||
throw IllegalStateException("Already spawned")
|
||||
|
||||
spawned = true
|
||||
world.entities.add(this)
|
||||
chunk = world.getChunk(ChunkPos.ZERO)?.chunk
|
||||
|
||||
if (chunk == null) {
|
||||
world.orphanedEntities.add(this)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Касается ли сущность земли
|
||||
@ -37,8 +92,18 @@ open class Entity(val world: World<*>) {
|
||||
* Если сущность касается земли, то на неё не действует гравитация
|
||||
*/
|
||||
var onGround = false
|
||||
protected set(value) {
|
||||
field = value
|
||||
nextOnGroundUpdate = world.timer + 0.1
|
||||
}
|
||||
|
||||
protected var nextOnGroundUpdate = 0.0
|
||||
|
||||
var groundNormal = Vector2d.ZERO
|
||||
protected set
|
||||
|
||||
protected var isHuggingAWall = false
|
||||
|
||||
// наследуемые свойства
|
||||
open val aabb = AABB.rectangle(Vector2d.ZERO, 0.9, 0.9)
|
||||
open val affectedByGravity = true
|
||||
@ -48,129 +113,73 @@ open class Entity(val world: World<*>) {
|
||||
|
||||
}
|
||||
|
||||
open fun propagateVelocity(delta: Double) {
|
||||
protected fun sweepRelative(velocity: Vector2d, delta: Double, collisionResolution: CollisionResolution = this.collisionResolution) = world.sweep(worldaabb, velocity, collisionResolution, delta)
|
||||
protected fun sweepAbsolute(from: Vector2d, velocity: Vector2d, delta: Double, collisionResolution: CollisionResolution = this.collisionResolution) = world.sweep(aabb + from, velocity, collisionResolution, delta)
|
||||
protected fun isSpaceOpen(relative: Vector2d, delta: Double) = !sweepRelative(relative, delta).hitAnything
|
||||
|
||||
fun dropToFloor() {
|
||||
val sweep = sweepRelative(Vector2d.DROP_TO_FLOOR, 1.0, CollisionResolution.STOP)
|
||||
|
||||
if (!sweep.hitAnything)
|
||||
return
|
||||
|
||||
pos += sweep.hitPosition
|
||||
}
|
||||
|
||||
protected open fun propagateVelocity(delta: Double) {
|
||||
if (velocity.length == 0.0)
|
||||
return
|
||||
|
||||
var deltaMovement = velocity * delta
|
||||
val sweep = sweepRelative(velocity * delta, delta)
|
||||
this.velocity = sweep.hitPosition / delta
|
||||
this.pos += this.velocity * delta
|
||||
|
||||
var potentialAABB = worldaabb + deltaMovement
|
||||
var combined = worldaabb.combine(potentialAABB)
|
||||
val collected = world.collect((combined).encasingChunkPosAABB()).map { it.chunk.foreground.collisionLayers() }
|
||||
if (nextOnGroundUpdate <= world.timer || !onGround) {
|
||||
onGround = sweep.hitNormal.dotProduct(world.gravity.normalized) <= -0.98
|
||||
groundNormal = sweep.hitNormal
|
||||
|
||||
if (collected.isNotEmpty()) {
|
||||
var newOnGround = false
|
||||
|
||||
for (iteration in 0 .. 100) {
|
||||
var collided = false
|
||||
|
||||
for (aabbList in collected) {
|
||||
for (aabb in aabbList) {
|
||||
if (!newOnGround && iteration == 0) {
|
||||
if (worldaabb.sweep(aabb, world.gravity * delta).collisionTime < 1.0) {
|
||||
newOnGround = true
|
||||
}
|
||||
}
|
||||
|
||||
// залез в блоки?
|
||||
if (potentialAABB.intersectWeak(aabb)) {
|
||||
val push = worldaabb.pushOutFrom(aabb)
|
||||
|
||||
if (push.length > 0.0) {
|
||||
velocity -= push * delta * 100.0
|
||||
deltaMovement = velocity * delta
|
||||
potentialAABB = worldaabb + deltaMovement
|
||||
combined = worldaabb.combine(potentialAABB)
|
||||
|
||||
onGround = true
|
||||
collided = true
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// ранний тест (отсечение заведомо не пересекаемой геометрии)
|
||||
if (!aabb.intersect(combined)) {
|
||||
continue
|
||||
}
|
||||
|
||||
// обычный тест коллизии
|
||||
val (normal, collisionTime) = worldaabb.sweep(aabb, deltaMovement)
|
||||
|
||||
if (collisionTime != 1.0) {
|
||||
val remainingTime = 1.0 - collisionTime
|
||||
val oldVelocity = velocity
|
||||
|
||||
when (collisionResolution) {
|
||||
CollisionResolution.STOP -> {
|
||||
velocity *= remainingTime
|
||||
}
|
||||
|
||||
CollisionResolution.PUSH -> {
|
||||
var dot = deltaMovement.invDotProduct(normal)
|
||||
val magnitude = deltaMovement.length * remainingTime
|
||||
|
||||
if (dot > 0.0) {
|
||||
dot = 1.0
|
||||
} else {
|
||||
dot = -1.0
|
||||
}
|
||||
|
||||
velocity = Vector2d(dot * normal.y * magnitude, dot * normal.x * magnitude) / delta
|
||||
}
|
||||
|
||||
CollisionResolution.SLIDE -> {
|
||||
val dot = deltaMovement.invDotProduct(normal) * remainingTime
|
||||
velocity = Vector2d(dot * normal.y, dot * normal.x) / delta
|
||||
}
|
||||
|
||||
CollisionResolution.BOUNCE -> {
|
||||
velocity *= remainingTime
|
||||
|
||||
if (normal.x.absoluteValue > 0.00001 && normal.y.absoluteValue > 0.00001) {
|
||||
velocity *= Vector2d.INVERT_XY
|
||||
} else if (normal.x.absoluteValue > 0.00001) {
|
||||
velocity *= Vector2d.INVERT_X
|
||||
} else if (normal.y.absoluteValue > 0.00001) {
|
||||
velocity *= Vector2d.INVERT_Y
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
collided = true
|
||||
|
||||
if (!newOnGround) {
|
||||
newOnGround = normal.dotProduct(world.gravity) <= -0.98
|
||||
}
|
||||
|
||||
deltaMovement = velocity * delta
|
||||
potentialAABB = worldaabb + deltaMovement
|
||||
onTouchGround(oldVelocity, normal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!collided) {
|
||||
//println("Resolved collision on $iteration")
|
||||
break
|
||||
}
|
||||
if (!onGround) {
|
||||
val sweepGround = sweepRelative(world.gravity * delta, delta)
|
||||
onGround = sweepGround.hitAnything && sweepGround.hitNormal.dotProduct(world.gravity.normalized) <= -0.98
|
||||
groundNormal = sweepGround.hitNormal
|
||||
}
|
||||
|
||||
onGround = newOnGround
|
||||
//println(newOnGround)
|
||||
} else {
|
||||
onGround = false
|
||||
}
|
||||
|
||||
pos += velocity * delta
|
||||
}
|
||||
|
||||
open fun moveAndCollide(delta: Double) {
|
||||
protected open fun thinkGravity(delta: Double) {
|
||||
velocity += world.gravity * delta
|
||||
}
|
||||
|
||||
protected open fun thinkFriction(delta: Double) {
|
||||
velocity *= Vector2d(lerp(delta, 1.0, 0.01), 1.0)
|
||||
}
|
||||
|
||||
protected open fun thinkPhysics(delta: Double) {
|
||||
if (!onGround && affectedByGravity)
|
||||
velocity += world.gravity * delta
|
||||
else if (affectedByGravity)
|
||||
velocity *= Vector2d(lerp(delta, 1.0, 0.01), 1.0)
|
||||
thinkGravity(delta)
|
||||
|
||||
propagateVelocity(delta)
|
||||
|
||||
if (affectedByGravity && onGround)
|
||||
thinkFriction(delta)
|
||||
|
||||
//dropToFloor()
|
||||
}
|
||||
|
||||
/**
|
||||
* Заставляет сущность "думать".
|
||||
*/
|
||||
fun think(delta: Double) {
|
||||
if (!spawned) {
|
||||
throw IllegalStateException("Tried to think before spawning in world")
|
||||
}
|
||||
|
||||
thinkPhysics(delta)
|
||||
thinkAI(delta)
|
||||
}
|
||||
|
||||
protected open fun thinkAI(delta: Double) {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -1,10 +0,0 @@
|
||||
package ru.dbotthepony.kstarbound.world.entities
|
||||
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.world.World
|
||||
|
||||
open class Humanoid(world: World<*>) : AliveEntity(world) {
|
||||
override val aabb = AABB.rectangle(Vector2d.ZERO, 1.8, 3.7)
|
||||
override val collisionResolution = CollisionResolution.SLIDE
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ru.dbotthepony.kstarbound.world.entities
|
||||
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.world.World
|
||||
|
||||
/**
|
||||
* Физический аватар игрока в мире
|
||||
*/
|
||||
open class PlayerEntity(world: World<*>) : AliveEntity(world) {
|
||||
override val aabb = AABB.rectangle(Vector2d.ZERO, 1.8, 3.7)
|
||||
override val aabbDucked: AABB = AABB.rectangle(Vector2d.ZERO, 1.8, 1.8) + Vector2d(y = -0.9)
|
||||
override var moveDirection = Move.STAND_STILL
|
||||
}
|
@ -2,9 +2,11 @@ package ru.dbotthepony.kstarbound.test
|
||||
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.Test
|
||||
import ru.dbotthepony.kstarbound.math.AABB
|
||||
import ru.dbotthepony.kstarbound.math.Vector2d
|
||||
import ru.dbotthepony.kstarbound.math.roundByAbsoluteValue
|
||||
import ru.dbotthepony.kstarbound.math.*
|
||||
import ru.dbotthepony.kstarbound.world.CHUNK_SIZE
|
||||
import ru.dbotthepony.kstarbound.world.CHUNK_SIZE_FF
|
||||
import ru.dbotthepony.kstarbound.world.CHUNK_SIZEd
|
||||
import ru.dbotthepony.kstarbound.world.ChunkPos
|
||||
|
||||
object MathTests {
|
||||
@Test
|
||||
@ -19,6 +21,34 @@ object MathTests {
|
||||
check(roundByAbsoluteValue(-1.1) == -2)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("roundTowardsNegativeInfinity test")
|
||||
fun roundTowardsNegativeInfinityTest() {
|
||||
check(roundTowardsNegativeInfinity(0.0) == 0)
|
||||
check(roundTowardsNegativeInfinity(0.1) == 0)
|
||||
check(roundTowardsNegativeInfinity(0.6) == 0)
|
||||
check(roundTowardsNegativeInfinity(1.1) == 1)
|
||||
check(roundTowardsNegativeInfinity(-0.1) == -1)
|
||||
check(roundTowardsNegativeInfinity(-0.0) == 0)
|
||||
check(roundTowardsNegativeInfinity(-1.0) == -1)
|
||||
check(roundTowardsNegativeInfinity(-1.1) == -2)
|
||||
check(roundTowardsNegativeInfinity(-1.6) == -2)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("roundTowardsPositiveInfinity test")
|
||||
fun roundTowardsPositiveInfinityTest() {
|
||||
check(roundTowardsPositiveInfinity(0.0) == 0)
|
||||
check(roundTowardsPositiveInfinity(0.1) == 1)
|
||||
check(roundTowardsPositiveInfinity(0.6) == 1)
|
||||
check(roundTowardsPositiveInfinity(1.1) == 2)
|
||||
check(roundTowardsPositiveInfinity(-0.1) == 0)
|
||||
check(roundTowardsPositiveInfinity(-0.0) == 0)
|
||||
check(roundTowardsPositiveInfinity(-1.0) == -1)
|
||||
check(roundTowardsPositiveInfinity(-1.1) == -1)
|
||||
check(roundTowardsPositiveInfinity(-1.6) == -1)
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("AABB Basic Math")
|
||||
fun basicAABB() {
|
||||
@ -48,4 +78,35 @@ object MathTests {
|
||||
|
||||
check(combineA.combine(combineB) == AABB(Vector2d(0.0, 0.0), Vector2d(4.0, 6.0))) { combineA.combine(combineB).toString() }
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("AABB transformation to AABBi")
|
||||
fun transformAABB() {
|
||||
check(AABB.rectangle(Vector2d.ZERO, 2.0, 2.0).encasingIntAABB() == AABBi(Vector2i(-1, -1), Vector2i(1, 1)))
|
||||
check(AABB.rectangle(Vector2d.ZERO, 2.0, 2.0).encasingChunkPosAABB() == AABBi(Vector2i(-1, -1), Vector2i(0, 0))) { AABB.rectangle(Vector2d.ZERO, 2.0, 2.0).encasingChunkPosAABB()}
|
||||
|
||||
check(AABB.rectangle(Vector2d(x = CHUNK_SIZEd - 0.1), 2.0, 2.0).encasingChunkPosAABB() == AABBi(Vector2i(0, -1), Vector2i(1, 0))) { "${AABB.rectangle(Vector2d(x = CHUNK_SIZEd - 0.1), 2.0, 2.0)} ${AABB.rectangle(Vector2d(x = CHUNK_SIZEd - 0.1), 2.0, 2.0).encasingChunkPosAABB()}" }
|
||||
check(AABB.rectangle(Vector2d(x = CHUNK_SIZEd + 0.1), 2.0, 2.0).encasingChunkPosAABB() == AABBi(Vector2i(0, -1), Vector2i(1, 0))) { "${AABB.rectangle(Vector2d(x = CHUNK_SIZEd + 0.1), 2.0, 2.0)} ${AABB.rectangle(Vector2d(x = CHUNK_SIZEd + 0.1), 2.0, 2.0).encasingChunkPosAABB()}" }
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("ChunkPos class tests")
|
||||
fun chunkPosTests() {
|
||||
check(ChunkPos.fromTilePosition(0, 0) == ChunkPos(0, 0))
|
||||
check(ChunkPos.fromTilePosition(1, 0) == ChunkPos(0, 0))
|
||||
check(ChunkPos.fromTilePosition(0, 1) == ChunkPos(0, 0))
|
||||
check(ChunkPos.fromTilePosition(1, 1) == ChunkPos(0, 0))
|
||||
check(ChunkPos.fromTilePosition(-1, 1) == ChunkPos(-1, 0))
|
||||
check(ChunkPos.fromTilePosition(-1, -1) == ChunkPos(-1, -1))
|
||||
|
||||
check(ChunkPos.fromTilePosition(CHUNK_SIZE_FF, 0) == ChunkPos(0, 0))
|
||||
check(ChunkPos.fromTilePosition(CHUNK_SIZE, 0) == ChunkPos(1, 0))
|
||||
check(ChunkPos.fromTilePosition(0, CHUNK_SIZE_FF) == ChunkPos(0, 0))
|
||||
check(ChunkPos.fromTilePosition(0, CHUNK_SIZE) == ChunkPos(0, 1))
|
||||
|
||||
check(ChunkPos.fromTilePosition(-CHUNK_SIZE_FF, 0) == ChunkPos(-1, 0)) { ChunkPos.fromTilePosition(-CHUNK_SIZE_FF, 0).toString() }
|
||||
check(ChunkPos.fromTilePosition(-CHUNK_SIZE, 0) == ChunkPos(-2, 0)) { ChunkPos.fromTilePosition(-CHUNK_SIZE, 0) }
|
||||
check(ChunkPos.fromTilePosition(0, -CHUNK_SIZE_FF) == ChunkPos(0, -1)) { ChunkPos.fromTilePosition(0, -CHUNK_SIZE_FF) }
|
||||
check(ChunkPos.fromTilePosition(0, -CHUNK_SIZE) == ChunkPos(0, -2)) { ChunkPos.fromTilePosition(0, -CHUNK_SIZE) }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user