X11: Moved to XI2 XI_RawMotion for disabled cursor mode motion input.macOS: Cocoa hints ( GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_COCOA_FRAME_AUTOSAVE, GLFW_COCOA_GRAPHICS_SWITCHING, GLFW_COCOA_CHDIR_RESOURCES, GLFW_COCOA_MENUBAR).Cursor centering control ( GLFW_CENTER_CURSOR).Library initialization hints ( glfwInitHint).Window attribute modification ( glfwSetWindowAttrib).Window maximization events ( glfwSetWindowMaximizeCallback).Platform dependent scancodes for keys ( glfwGetKeyScancode).Requesting attention from the user ( glfwRequestWindowAttention).glfw: Updated to pre-release 3.3.0 version (up from 3.2.1).bgfx: Updated to API version 41 (up from 34).The 3.1.2 release brings several new fixes and features, including new VR oriented library bindings. LWJGL is the underlying technology Java libraries such as LibGDX and jMonkeyEngine depend on for desktop targets.
#Java lwjgl oscillating motion series
LWJGL is series of low level language bindings to critical game development related APIs such as OpenGL and OpenAL. If you want more accurate movement with varying acceleration (right now your acceleration is constant and 0, cuz speed is constant), then you should check out methods such as Euler integration, Runge-Kutta integration or (prefereably) Verlet integration (because it +-conserves energy).LWJGL, the Light Weight Java Game Library, just released version 3.1.2. Where normalize(target-currentPos)*speed is direction vector scaled by speed, thus velocity vector.īoth methods are useful in different scenarios - first is related to Tweening, second is related to physics simulation (but doesn't generalize well in current form). moveTo(currentPos, target, speed, dt) => currentPos + normalize(target-currentPos)*speed*dt On the other hand when you want to apply motion in one tick of your physics simulation and you know, that the velocity is constant, then simply ds = v*dt (delta movement is velocity times delta_time of the physics). It's good in scenarios, when you have a "keyframe" for A, B and want to interpolate between them (like in blender for example). This method returns absolute position at given time t of the movement, assuming that the object has uniform motion. Doing t/timeTotal = t / (distance(target,source)/velocity) gives you a fraction in range that you then use, to lerp from A to B: position(A, B, speed, t) => lerp(A,B, t/(distance(A,B)/speed)) This should then have a signature position(source, target, speed, t).įrom source and target you derive distance, speed is your constant, and then you determine your timeTotal=s/v (how long it takes to travel from A to B). If it's meant to determine the position on a segment, then it has to ask "at what point in time?" and be called getPosition - not moveTo, because it deosn't tell the object to move - it answers where would it be at given time. T = s/v = distance(targer,source)/velocity - answering "what's the total time it will take for object to move from source to target?". You want v = const and you know distance s = distance(target, source), hence you have Your question is not about lwjgl or implementation.