2
votes
How to make shake effect on camera in LibGDX?
This is a good example:
Create a Rumble class to manage the shaking:
...
2
votes
Accepted
Fixed timestep, updates per second keeps changing?
Having a constant time-step does not mean that you force your client to update exactly 60 times per real-life second, it means that whenever you update your physics the timestep you send to your ...
2
votes
Is passing big objects in parameters not performant?
In Kotlin the size of the object passed via parameter does not impacted performance.
Here's why:
Kotlin is designed to be fully interoperable fully with Java.
Java alway uses pass-by-value.
In Java ...
2
votes
Extracting cell center and corner points from rasterized Voronoi diagram
It is better to generate a Voronoi diagram as vectors first, e.g. via Fortune's Sweepline Algorithm, then rasterise.
If, however, you are dead set on using the rasterised version as a basis, then you ...
2
votes
Accepted
Conway's game of life algorithm does not work
Your if statements are not correct.
Lets assume neightbors = 2 (2 neightbors) and grid[col][row] = true (the cell is alive)
The ...
2
votes
Access violation when using shaders in LWJGL 3
Switch the statements glfwMakeContextCurrent() and GL.createCapabilities()
...
2
votes
Accepted
How do I implement data persistence?
It largely depends on a game, but generally, it seems like you have a classic RPG/FPS/Arcade composition, where you have:
a Game instance (roughly speaking, this is your launched executable),
Game ...
1
vote
Accepted
Is it a good idea to detect collisions in 2D game on different thread?
Probably not.
In a game, we usually don't want collisions to be processed eventually — we want them processed now. We have hard time constraints: we want to integrate all object motion forward one ...
1
vote
Accepted
What rotation needs to be applied to align mesh with expected axis of target?
I converted to using a quarternion to hold the value of the rotation which I could readily create from the normals, so the "fix" was for me to understand how rotations work better.
For the ...
1
vote
What rotation needs to be applied to align mesh with expected axis of target?
3 direction unit vectors contain all the needed information for rotation. So there are 2 solutions:
Having calculated the centres and the 3 direction unit vectors you can build a matrix that would ...
1
vote
Android Game - Screen Flickers When an Entity Removed From The List
Apparently removing an item from a list that you are iterating isn't such a good idea. Separating the cleanup/removal process from the render for each loop fixed the issue.
...
1
vote
Action never fires
You're passing the result of calling MenuScreen() as your call back. What does that function return? Perhaps you meant simply MenuScreen, which is a function. Other than that I can't tell what's wrong....
1
vote
Missing texture after add new actors
In BaseActor class I was clearing screen with Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT). After removing it, everything works as ...
1
vote
Getting solid black color when texture is added to GLSL
The OpenGL specification states:
If a fragment shader uses a sampler whose associated texture object is not complete ... the texture image unit will return(R,G,B,A)=(0,0,0,1).
The first thing to ...
1
vote
How to make shake effect on camera in LibGDX?
My approach to this problem is to create a child class of an OrthographicCamera() and add some functionality to its update() ...
1
vote
Accepted
Do I need to dispose Pixmap in Actor?
As other answer stated, in this case it is fine to dispose the Pixmap right after the Texture creation.
However, (especially) if you are on Android (but elsewhere too), you should load your Textures ...
1
vote
Focus scene2d UI actors programmatically in libGDX
I wanted to build something very similar but I didn't love the idea of manipulating the cursor like the other answer as it feels really hacky, though it might work.
In my case, I was also looking to ...
1
vote
Access violation when using shaders in LWJGL 3
I figured it out. It's throwing an exception because by constructing the StaticShader class when I declare it in my Main class variables, gl functions are being called by StaticShader's constructor ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
kotlin × 26libgdx × 17
opengl × 3
java × 3
2d × 2
geometry × 2
lwjgl × 2
materials × 2
trigonometry × 2
jmonkeyengine × 2
pbr × 2
collision-detection × 1
android × 1
3d × 1
mathematics × 1
textures × 1
architecture × 1
rendering × 1
algorithm × 1
glsl × 1
box2d × 1
optimization × 1
terrain × 1
assets × 1
pixel × 1