špothicon
Explore posts from serversJCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 1/18/2025 in #java-help
Converting int array to byte array
I am attempting to convert an array of ints to a byte array to store in a file which will later be read and converted back into an int array.
these are my conversion methods:
14 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 1/13/2025 in #java-help
vmaVirtualFree
I have chunk data that is being alloacted to memory with VMA, and I need to occasionally free the allocation of some chunks.
The method to do this takes an "allocation" long as an argument, but im not sure what i am supposed to actually be giving it.
5 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 12/11/2024 in #java-help
Unallocating direct buffer
18 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 12/10/2024 in #java-help
Making an object that can be various types?
I have a byte[] and a short[] used for the same thing.
I want to switch from using the byte[] and short[] based on the maximum value needed, which changes occasionally.
My idea is to have an Object that is swapped between referencing the byte[] or the short[] as needed.
The part I can't figure out is casting the Object to the array type its referencing. I tried this to alter the contents of the array the object is referencing:
but it just says "the result of getClass() is unused" (aka it isnt trying to cast the Object with the result like i want it to)
29 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 12/7/2024 in #java-help
Increasing max stack size
11 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 11/23/2024 in #java-help
Unpacking packed int
I came up with these methods to pack and unpack ints:
However when I unpack the packed int I get an unepxected result.
For example if I pack (3, 2) then unpack it I get (131072, 3)
11 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 11/11/2024 in #java-help
Removing roll from camera matrix
I have a camera class which is just this:
and it works, but I want to eliminate the roll from the matrix somehow.
199 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 10/27/2024 in #java-help
Figuring out path to resources in built jar
Im currently doing this to read my shader files:
and it works when just testing in intellij, but if i build the jar it no longer works as the src/main/resources part of the path doesnt exist. Any solutions?
11 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 8/2/2024 in #java-help
Repositioning objects to stay in the same position relative to each other when rotated.
10 replies
DHDistant Horizons
ā¢Created by špothicon on 6/22/2024 in #help-me
Ignore non-colliding blocks setting not working
4 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 6/14/2024 in #java-help
Implementing Desmos Function into Java
78 replies
DHDistant Horizons
ā¢Created by špothicon on 4/10/2024 in #help-me
Blocks tinting incorrectly in LOD chunks
100 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 3/9/2024 in #java-help
Get progress of int between two other ints.
I have three integers, min, max, and value. Value is always between min and max, but I need to figure out how to get a double that represents how "far along" the value is from min to max.
For example:
Min: 0
Max: 100
Value: 69
would return 0.69 as it is 69% between 0 and 100.
I just need help on the math required for this.
I just need help on the math required for this.
6 replies
DHDistant Horizons
ā¢Created by špothicon on 2/16/2024 in #help-me
URI scheme is not "file" (preventing game from opening)
14 replies
JCHJava Community | Help. Code. Learn.
ā¢Created by špothicon on 1/7/2024 in #java-help
Unable to get list of list.
56 replies
DHDistant Horizons
ā¢Created by špothicon on 12/27/2023 in #help-me
LOD chunks randomly stop loading
10 replies