Daniel Santos
JCHJava Community | Help. Code. Learn.
•Created by 𝓐pothicon on 12/11/2024 in #java-help
Unallocating direct buffer
the java garbage collector has several levels of storage. the one that takes the most time to clean up is the permanent generation, where the objects that have been active for most time. If you can reduce the time the references to objects are kept (for example instead of reusing a buffer for several operations, create a new buffer for every single operation) those object will not survive long in the ephemeral generation and the memory usage may not be as large at any given instant
18 replies
JCHJava Community | Help. Code. Learn.
•Created by 𝓐pothicon on 11/11/2024 in #java-help
Removing roll from camera matrix
in the rotate method set the rotate angle in just one axis. If Z is up set the up vector to (0, 0, 1) and rotate by an angle (are you using OpenGL ?) And if there is a translation do it after the rotation
199 replies
JCHJava Community | Help. Code. Learn.
•Created by Roasty on 11/18/2024 in #java-help
Math in Java. What a struggle. Help. Please. Fast.
in representing decimal values use BigDecimal. primitive types cause precision and rounding problemsd
9 replies
JCHJava Community | Help. Code. Learn.
•Created by OMIDD on 10/11/2024 in #java-help
recursion
In a recursive method there are two parts : the recursive part where the method calls itself, and the stopping condition, where the recursion stops and the current call returns the value. In your example you have the recursive part where if the sum is bigger than zero you call the method with a value that tends to the stopping condition which is being equal to zero. When that condition is reached in one recursive call, the method returns and so on until the original caller is reached and you have the result. hope it helps
13 replies