Updating data

This commit is contained in:
Speiger 2023-12-16 16:27:27 +01:00
parent ba143d7d83
commit 6091d8319a
327 changed files with 23809 additions and 8343 deletions

View File

@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'eclipse' apply plugin: 'eclipse'
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
eclipse { eclipse {
@ -11,35 +11,36 @@ eclipse {
downloadSources = true downloadSources = true
} }
} }
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(19) sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(19)
repositories { repositories {
mavenCentral() mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven {
maven { url = "https://maven.speiger.com/repository/main"
url = "https://maven.speiger.com/repository/main" }
}
} }
task srcJar(type: Jar) { task srcJar(type: Jar) {
from sourceSets.main.allSource from sourceSets.main.allSource
archiveClassifier = 'sources' archiveClassifier = 'sources'
from { from {
configurations.compile.collect { configurations.compile.collect {
it.isDirectory() ? it : zipTree(it) it.isDirectory() ? it : zipTree(it)
} }
} }
} }
artifacts { artifacts {
archives srcJar archives srcJar
} }
jar{ jar {
from { from {
configurations.compile.collect { configurations.compile.collect {
it.isDirectory() ? it : zipTree(it) it.isDirectory() ? it : zipTree(it)
} }
} }
} }
dependencies { dependencies {
@ -65,5 +66,5 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.6' implementation 'com.google.code.gson:gson:2.8.6'
//Primitive Collections //Primitive Collections
implementation 'de.speiger:Primitive-Collections:0.7.0' implementation 'de.speiger:Primitive-Collections:0.9.0'
} }

926
hs_err_pid10428.log Normal file
View File

@ -0,0 +1,926 @@
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8b13cc79d, pid=10428, tid=8228
#
# JRE version: Java(TM) SE Runtime Environment (19.0.2+7) (build 19.0.2+7-44)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C [lwjgl_opengl.dll+0xc79d]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63099 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8 speiger.src.coreengine.Testing
Host: AMD Ryzen 9 7900 12-Core Processor , 24 cores, 31G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
Time: Mon Jun 19 04:06:52 2023 Mitteleuropäische Sommerzeit elapsed time: 0.310107 seconds (0d 0h 0m 0s)
--------------- T H R E A D ---------------
Current thread (0x0000023453c10460): JavaThread "main" [_thread_in_native, id=8228, stack(0x0000008f88700000,0x0000008f88800000)]
Stack: [0x0000008f88700000,0x0000008f88800000], sp=0x0000008f887ff4e8, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [lwjgl_opengl.dll+0xc79d]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.lwjgl.opengl.GL11C.nglGetBooleanv(IJ)V+0
j org.lwjgl.opengl.GL11C.glGetBoolean(I)Z+20
j org.lwjgl.opengl.GL11.glGetBoolean(I)Z+1
j speiger.src.coreengine.Testing.main([Ljava/lang/String;)V+14
v ~StubRoutines::call_stub 0x0000023462fd10e8
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x00000000000002f0
Registers:
RAX=0x00000234062e9c50, RBX=0x00000234025b1728, RCX=0x000000000000809d, RDX=0x0000023406349008
RSP=0x0000008f887ff4e8, RBP=0x0000008f887ff578, RSI=0x00000234022fff90, RDI=0x0000000000000001
R8 =0x000000000000809d, R9 =0x0000023406349008, R10=0x0000000000000000, R11=0x000000062bb40c80
R12=0x0000000000000000, R13=0x00000234025b1728, R14=0x0000008f887ff5a8, R15=0x0000023453c10460
RIP=0x00007ff8b13cc79d, EFLAGS=0x0000000000010206
Register to memory mapping:
RIP=0x00007ff8b13cc79d lwjgl_opengl.dll
RAX=0x00000234062e9c50 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
RBX={method} {0x00000234025b1730} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
RCX=0x000000000000809d is an unknown value
RDX=0x0000023406349008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
RSP=0x0000008f887ff4e8 is pointing into the stack for thread: 0x0000023453c10460
RBP=0x0000008f887ff578 is pointing into the stack for thread: 0x0000023453c10460
RSI=0x00000234022fff90 is pointing into metadata
RDI=0x0000000000000001 is an unknown value
R8 =0x000000000000809d is an unknown value
R9 =0x0000023406349008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
R10=0x0 is NULL
R11=0x000000062bb40c80 is an oop: java.lang.Class
{0x000000062bb40c80} - klass: 'java/lang/Class'
- ---- fields (total size 116 words):
- private volatile transient 'classRedefinedCount' 'I' @12 0
- abstract internal 'klass' 'J' @16 34376635896 (101d5f8 8)
- abstract internal 'array_klass' 'J' @24 0 (0 0)
- abstract internal 'oop_size' 'I' @32 116 (74)
- abstract internal 'static_oop_field_count' 'I' @36 0
- private volatile transient 'cachedConstructor' 'Ljava/lang/reflect/Constructor;' @40 NULL (0)
- private transient 'name' 'Ljava/lang/String;' @44 "org.lwjgl.opengl.GL11C"{0x000000062bb41030} (c5768206)
- private transient 'module' 'Ljava/lang/Module;' @48 a 'java/lang/Module'{0x000000062c86c9c8} (c590d939)
- private final 'classLoader' 'Ljava/lang/ClassLoader;' @52 a 'jdk/internal/loader/ClassLoaders$AppClassLoader'{0x000000062c86c808} (c590d901)
- private transient 'classData' 'Ljava/lang/Object;' @56 NULL (0)
- private transient 'packageName' 'Ljava/lang/String;' @60 "org.lwjgl.opengl"{0x000000062c198a70} (c583314e)
- private final 'componentType' 'Ljava/lang/Class;' @64 NULL (0)
- private volatile transient 'reflectionData' 'Ljava/lang/ref/SoftReference;' @68 NULL (0)
- private volatile transient 'genericInfo' 'Lsun/reflect/generics/repository/ClassRepository;' @72 NULL (0)
- private volatile transient 'enumConstants' '[Ljava/lang/Object;' @76 NULL (0)
- private volatile transient 'enumConstantDirectory' 'Ljava/util/Map;' @80 NULL (0)
- private volatile transient 'annotationData' 'Ljava/lang/Class$AnnotationData;' @84 NULL (0)
- private volatile transient 'annotationType' 'Lsun/reflect/annotation/AnnotationType;' @88 NULL (0)
- transient 'classValueMap' 'Ljava/lang/ClassValue$ClassValueMap;' @92 NULL (0)
- abstract internal 'protection_domain' 'Ljava/lang/Object;' @96 a 'java/security/ProtectionDomain'{0x000000062c1a5658} (c5834acb)
- abstract internal 'signers_name' 'Ljava/lang/Object;' @100 NULL (0)
- abstract internal 'source_file' 'Ljava/lang/Object;' @104 NULL (0)
- signature: Lorg/lwjgl/opengl/GL11C;
- ---- static fields (0):
- public static final 'GL_NEVER' 'I' @112 512 (200)
- public static final 'GL_LESS' 'I' @116 513 (201)
- public static final 'GL_EQUAL' 'I' @120 514 (202)
- public static final 'GL_LEQUAL' 'I' @124 515 (203)
- public static final 'GL_GREATER' 'I' @128 516 (204)
- public static final 'GL_NOTEQUAL' 'I' @132 517 (205)
- public static final 'GL_GEQUAL' 'I' @136 518 (206)
- public static final 'GL_ALWAYS' 'I' @140 519 (207)
- public static final 'GL_DEPTH_BUFFER_BIT' 'I' @144 256 (100)
- public static final 'GL_STENCIL_BUFFER_BIT' 'I' @148 1024 (400)
- public static final 'GL_COLOR_BUFFER_BIT' 'I' @152 16384 (4000)
- public static final 'GL_POINTS' 'I' @156 0
- public static final 'GL_LINES' 'I' @160 1
- public static final 'GL_LINE_LOOP' 'I' @164 2
- public static final 'GL_LINE_STRIP' 'I' @168 3
- public static final 'GL_TRIANGLES' 'I' @172 4
- public static final 'GL_TRIANGLE_STRIP' 'I' @176 5
- public static final 'GL_TRIANGLE_FAN' 'I' @180 6
- public static final 'GL_QUADS' 'I' @184 7
- public static final 'GL_ZERO' 'I' @188 0
- public static final 'GL_ONE' 'I' @192 1
- public static final 'GL_SRC_COLOR' 'I' @196 768 (300)
- public static final 'GL_ONE_MINUS_SRC_COLOR' 'I' @200 769 (301)
- public static final 'GL_SRC_ALPHA' 'I' @204 770 (302)
- public static final 'GL_ONE_MINUS_SRC_ALPHA' 'I' @208 771 (303)
- public static final 'GL_DST_ALPHA' 'I' @212 772 (304)
- public static final 'GL_ONE_MINUS_DST_ALPHA' 'I' @216 773 (305)
- public static final 'GL_DST_COLOR' 'I' @220 774 (306)
- public static final 'GL_ONE_MINUS_DST_COLOR' 'I' @224 775 (307)
- public static final 'GL_SRC_ALPHA_SATURATE' 'I' @228 776 (308)
- public static final 'GL_TRUE' 'I' @232 1
- public static final 'GL_FALSE' 'I' @236 0
- public static final 'GL_BYTE' 'I' @240 5120 (1400)
- public static final 'GL_UNSIGNED_BYTE' 'I' @244 5121 (1401)
- public static final 'GL_SHORT' 'I' @248 5122 (1402)
- public static final 'GL_UNSIGNED_SHORT' 'I' @252 5123 (1403)
- public static final 'GL_INT' 'I' @256 5124 (1404)
- public static final 'GL_UNSIGNED_INT' 'I' @260 5125 (1405)
- public static final 'GL_FLOAT' 'I' @264 5126 (1406)
- public static final 'GL_DOUBLE' 'I' @268 5130 (140a)
- public static final 'GL_NONE' 'I' @272 0
- public static final 'GL_FRONT_LEFT' 'I' @276 1024 (400)
- public static final 'GL_FRONT_RIGHT' 'I' @280 1025 (401)
- public static final 'GL_BACK_LEFT' 'I' @284 1026 (402)
- public static final 'GL_BACK_RIGHT' 'I' @288 1027 (403)
- public static final 'GL_FRONT' 'I' @292 1028 (404)
- public static final 'GL_BACK' 'I' @296 1029 (405)
- public static final 'GL_LEFT' 'I' @300 1030 (406)
- public static final 'GL_RIGHT' 'I' @304 1031 (407)
- public static final 'GL_FRONT_AND_BACK' 'I' @308 1032 (408)
- public static final 'GL_NO_ERROR' 'I' @312 0
- public static final 'GL_INVALID_ENUM' 'I' @316 1280 (500)
- public static final 'GL_INVALID_VALUE' 'I' @320 1281 (501)
- public static final 'GL_INVALID_OPERATION' 'I' @324 1282 (502)
- public static final 'GL_STACK_OVERFLOW' 'I' @328 1283 (503)
- public static final 'GL_STACK_UNDERFLOW' 'I' @332 1284 (504)
- public static final 'GL_OUT_OF_MEMORY' 'I' @336 1285 (505)
- public static final 'GL_CW' 'I' @340 2304 (900)
- public static final 'GL_CCW' 'I' @344 2305 (901)
- public static final 'GL_POINT_SIZE' 'I' @348 2833 (b11)
- public static final 'GL_POINT_SIZE_RANGE' 'I' @352 2834 (b12)
- public static final 'GL_POINT_SIZE_GRANULARITY' 'I' @356 2835 (b13)
- public static final 'GL_LINE_SMOOTH' 'I' @360 2848 (b20)
- public static final 'GL_LINE_WIDTH' 'I' @364 2849 (b21)
- public static final 'GL_LINE_WIDTH_RANGE' 'I' @368 2850 (b22)
- public static final 'GL_LINE_WIDTH_GRANULARITY' 'I' @372 2851 (b23)
- public static final 'GL_POLYGON_MODE' 'I' @376 2880 (b40)
- public static final 'GL_POLYGON_SMOOTH' 'I' @380 2881 (b41)
- public static final 'GL_CULL_FACE' 'I' @384 2884 (b44)
- public static final 'GL_CULL_FACE_MODE' 'I' @388 2885 (b45)
- public static final 'GL_FRONT_FACE' 'I' @392 2886 (b46)
- public static final 'GL_DEPTH_RANGE' 'I' @396 2928 (b70)
- public static final 'GL_DEPTH_TEST' 'I' @400 2929 (b71)
- public static final 'GL_DEPTH_WRITEMASK' 'I' @404 2930 (b72)
- public static final 'GL_DEPTH_CLEAR_VALUE' 'I' @408 2931 (b73)
- public static final 'GL_DEPTH_FUNC' 'I' @412 2932 (b74)
- public static final 'GL_STENCIL_TEST' 'I' @416 2960 (b90)
- public static final 'GL_STENCIL_CLEAR_VALUE' 'I' @420 2961 (b91)
- public static final 'GL_STENCIL_FUNC' 'I' @424 2962 (b92)
- public static final 'GL_STENCIL_VALUE_MASK' 'I' @428 2963 (b93)
- public static final 'GL_STENCIL_FAIL' 'I' @432 2964 (b94)
- public static final 'GL_STENCIL_PASS_DEPTH_FAIL' 'I' @436 2965 (b95)
- public static final 'GL_STENCIL_PASS_DEPTH_PASS' 'I' @440 2966 (b96)
- public static final 'GL_STENCIL_REF' 'I' @444 2967 (b97)
- public static final 'GL_STENCIL_WRITEMASK' 'I' @448 2968 (b98)
- public static final 'GL_VIEWPORT' 'I' @452 2978 (ba2)
- public static final 'GL_DITHER' 'I' @456 3024 (bd0)
- public static final 'GL_BLEND_DST' 'I' @460 3040 (be0)
- public static final 'GL_BLEND_SRC' 'I' @464 3041 (be1)
- public static final 'GL_BLEND' 'I' @468 3042 (be2)
- public static final 'GL_LOGIC_OP_MODE' 'I' @472 3056 (bf0)
- public static final 'GL_COLOR_LOGIC_OP' 'I' @476 3058 (bf2)
- public static final 'GL_DRAW_BUFFER' 'I' @480 3073 (c01)
- public static final 'GL_READ_BUFFER' 'I' @484 3074 (c02)
- public static final 'GL_SCISSOR_BOX' 'I' @488 3088 (c10)
- public static final 'GL_SCISSOR_TEST' 'I' @492 3089 (c11)
- public static final 'GL_COLOR_CLEAR_VALUE' 'I' @496 3106 (c22)
- public static final 'GL_COLOR_WRITEMASK' 'I' @500 3107 (c23)
- public static final 'GL_DOUBLEBUFFER' 'I' @504 3122 (c32)
- public static final 'GL_STEREO' 'I' @508 3123 (c33)
- public static final 'GL_LINE_SMOOTH_HINT' 'I' @512 3154 (c52)
- public static final 'GL_POLYGON_SMOOTH_HINT' 'I' @516 3155 (c53)
- public static final 'GL_UNPACK_SWAP_BYTES' 'I' @520 3312 (cf0)
- public static final 'GL_UNPACK_LSB_FIRST' 'I' @524 3313 (cf1)
- public static final 'GL_UNPACK_ROW_LENGTH' 'I' @528 3314 (cf2)
- public static final 'GL_UNPACK_SKIP_ROWS' 'I' @532 3315 (cf3)
- public static final 'GL_UNPACK_SKIP_PIXELS' 'I' @536 3316 (cf4)
- public static final 'GL_UNPACK_ALIGNMENT' 'I' @540 3317 (cf5)
- public static final 'GL_PACK_SWAP_BYTES' 'I' @544 3328 (d00)
- public static final 'GL_PACK_LSB_FIRST' 'I' @548 3329 (d01)
- public static final 'GL_PACK_ROW_LENGTH' 'I' @552 3330 (d02)
- public static final 'GL_PACK_SKIP_ROWS' 'I' @556 3331 (d03)
- public static final 'GL_PACK_SKIP_PIXELS' 'I' @560 3332 (d04)
- public static final 'GL_PACK_ALIGNMENT' 'I' @564 3333 (d05)
- public static final 'GL_MAX_TEXTURE_SIZE' 'I' @568 3379 (d33)
- public static final 'GL_MAX_VIEWPORT_DIMS' 'I' @572 3386 (d3a)
- public static final 'GL_SUBPIXEL_BITS' 'I' @576 3408 (d50)
- public static final 'GL_TEXTURE_1D' 'I' @580 3552 (de0)
- public static final 'GL_TEXTURE_2D' 'I' @584 3553 (de1)
- public static final 'GL_TEXTURE_WIDTH' 'I' @588 4096 (1000)
- public static final 'GL_TEXTURE_HEIGHT' 'I' @592 4097 (1001)
- public static final 'GL_TEXTURE_INTERNAL_FORMAT' 'I' @596 4099 (1003)
- public static final 'GL_TEXTURE_BORDER_COLOR' 'I' @600 4100 (1004)
- public static final 'GL_DONT_CARE' 'I' @604 4352 (1100)
- public static final 'GL_FASTEST' 'I' @608 4353 (1101)
- public static final 'GL_NICEST' 'I' @612 4354 (1102)
- public static final 'GL_CLEAR' 'I' @616 5376 (1500)
- public static final 'GL_AND' 'I' @620 5377 (1501)
- public static final 'GL_AND_REVERSE' 'I' @624 5378 (1502)
- public static final 'GL_COPY' 'I' @628 5379 (1503)
- public static final 'GL_AND_INVERTED' 'I' @632 5380 (1504)
- public static final 'GL_NOOP' 'I' @636 5381 (1505)
- public static final 'GL_XOR' 'I' @640 5382 (1506)
- public static final 'GL_OR' 'I' @644 5383 (1507)
- public static final 'GL_NOR' 'I' @648 5384 (1508)
- public static final 'GL_EQUIV' 'I' @652 5385 (1509)
- public static final 'GL_INVERT' 'I' @656 5386 (150a)
- public static final 'GL_OR_REVERSE' 'I' @660 5387 (150b)
- public static final 'GL_COPY_INVERTED' 'I' @664 5388 (150c)
- public static final 'GL_OR_INVERTED' 'I' @668 5389 (150d)
- public static final 'GL_NAND' 'I' @672 5390 (150e)
- public static final 'GL_SET' 'I' @676 5391 (150f)
- public static final 'GL_TEXTURE' 'I' @680 5890 (1702)
- public static final 'GL_COLOR' 'I' @684 6144 (1800)
- public static final 'GL_DEPTH' 'I' @688 6145 (1801)
- public static final 'GL_STENCIL' 'I' @692 6146 (1802)
- public static final 'GL_STENCIL_INDEX' 'I' @696 6401 (1901)
- public static final 'GL_DEPTH_COMPONENT' 'I' @700 6402 (1902)
- public static final 'GL_RED' 'I' @704 6403 (1903)
- public static final 'GL_GREEN' 'I' @708 6404 (1904)
- public static final 'GL_BLUE' 'I' @712 6405 (1905)
- public static final 'GL_ALPHA' 'I' @716 6406 (1906)
- public static final 'GL_RGB' 'I' @720 6407 (1907)
- public static final 'GL_RGBA' 'I' @724 6408 (1908)
- public static final 'GL_POINT' 'I' @728 6912 (1b00)
- public static final 'GL_LINE' 'I' @732 6913 (1b01)
- public static final 'GL_FILL' 'I' @736 6914 (1b02)
- public static final 'GL_KEEP' 'I' @740 7680 (1e00)
- public static final 'GL_REPLACE' 'I' @744 7681 (1e01)
- public static final 'GL_INCR' 'I' @748 7682 (1e02)
- public static final 'GL_DECR' 'I' @752 7683 (1e03)
- public static final 'GL_VENDOR' 'I' @756 7936 (1f00)
- public static final 'GL_RENDERER' 'I' @760 7937 (1f01)
- public static final 'GL_VERSION' 'I' @764 7938 (1f02)
- public static final 'GL_EXTENSIONS' 'I' @768 7939 (1f03)
- public static final 'GL_NEAREST' 'I' @772 9728 (2600)
- public static final 'GL_LINEAR' 'I' @776 9729 (2601)
- public static final 'GL_NEAREST_MIPMAP_NEAREST' 'I' @780 9984 (2700)
- public static final 'GL_LINEAR_MIPMAP_NEAREST' 'I' @784 9985 (2701)
- public static final 'GL_NEAREST_MIPMAP_LINEAR' 'I' @788 9986 (2702)
- public static final 'GL_LINEAR_MIPMAP_LINEAR' 'I' @792 9987 (2703)
- public static final 'GL_TEXTURE_MAG_FILTER' 'I' @796 10240 (2800)
- public static final 'GL_TEXTURE_MIN_FILTER' 'I' @800 10241 (2801)
- public static final 'GL_TEXTURE_WRAP_S' 'I' @804 10242 (2802)
- public static final 'GL_TEXTURE_WRAP_T' 'I' @808 10243 (2803)
- public static final 'GL_REPEAT' 'I' @812 10497 (2901)
- public static final 'GL_POLYGON_OFFSET_FACTOR' 'I' @816 32824 (8038)
- public static final 'GL_POLYGON_OFFSET_UNITS' 'I' @820 10752 (2a00)
- public static final 'GL_POLYGON_OFFSET_POINT' 'I' @824 10753 (2a01)
- public static final 'GL_POLYGON_OFFSET_LINE' 'I' @828 10754 (2a02)
- public static final 'GL_POLYGON_OFFSET_FILL' 'I' @832 32823 (8037)
- public static final 'GL_R3_G3_B2' 'I' @836 10768 (2a10)
- public static final 'GL_RGB4' 'I' @840 32847 (804f)
- public static final 'GL_RGB5' 'I' @844 32848 (8050)
- public static final 'GL_RGB8' 'I' @848 32849 (8051)
- public static final 'GL_RGB10' 'I' @852 32850 (8052)
- public static final 'GL_RGB12' 'I' @856 32851 (8053)
- public static final 'GL_RGB16' 'I' @860 32852 (8054)
- public static final 'GL_RGBA2' 'I' @864 32853 (8055)
- public static final 'GL_RGBA4' 'I' @868 32854 (8056)
- public static final 'GL_RGB5_A1' 'I' @872 32855 (8057)
- public static final 'GL_RGBA8' 'I' @876 32856 (8058)
- public static final 'GL_RGB10_A2' 'I' @880 32857 (8059)
- public static final 'GL_RGBA12' 'I' @884 32858 (805a)
- public static final 'GL_RGBA16' 'I' @888 32859 (805b)
- public static final 'GL_TEXTURE_RED_SIZE' 'I' @892 32860 (805c)
- public static final 'GL_TEXTURE_GREEN_SIZE' 'I' @896 32861 (805d)
- public static final 'GL_TEXTURE_BLUE_SIZE' 'I' @900 32862 (805e)
- public static final 'GL_TEXTURE_ALPHA_SIZE' 'I' @904 32863 (805f)
- public static final 'GL_PROXY_TEXTURE_1D' 'I' @908 32867 (8063)
- public static final 'GL_PROXY_TEXTURE_2D' 'I' @912 32868 (8064)
- public static final 'GL_TEXTURE_BINDING_1D' 'I' @916 32872 (8068)
- public static final 'GL_TEXTURE_BINDING_2D' 'I' @920 32873 (8069)
- public static final 'GL_VERTEX_ARRAY' 'I' @924 32884 (8074)
R12=0x0 is NULL
R13={method} {0x00000234025b1730} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
R14=0x0000008f887ff5a8 is pointing into the stack for thread: 0x0000023453c10460
R15=0x0000023453c10460 is a thread
Top of Stack: (sp=0x0000008f887ff4e8)
0x0000008f887ff4e8: 0000023462ff3478 0000000000000001
0x0000008f887ff4f8: 0000023462ff2dba 00000234025b1728
0x0000008f887ff508: 00000234022fff90 0000000000000000
0x0000008f887ff518: 0000008f887ff530 0000008f887ff590
0x0000008f887ff528: 0000023462ff2d76 0000008f887ff530
0x0000008f887ff538: 00000234025b1728 0000008f887ff5a8
0x0000008f887ff548: 00000234025bb7d8 0000000000000000
0x0000008f887ff558: 000000062bb40c80 00000234025b1728
0x0000008f887ff568: 0000000000000000 0000008f887ff598
0x0000008f887ff578: 0000008f887ff5f8 0000023462fec11a
0x0000008f887ff588: 000000062bb40c80 0000023462fef557
0x0000008f887ff598: 0000023406349008 0000000000000000
0x0000008f887ff5a8: 000000000000809d 0000008f887ff5b0
0x0000008f887ff5b8: 00000234025b18dc 0000008f887ff630
0x0000008f887ff5c8: 00000234025bb7d8 0000000000000000
0x0000008f887ff5d8: 000000062bb40c80 00000234025b1968
Instructions: (pc=0x00007ff8b13cc79d)
0x00007ff8b13cc69d: cc cc cc 48 8b 01 45 8b d8 44 8b 44 24 28 41 8b
0x00007ff8b13cc6ad: d1 41 8b cb 4c 8b 50 18 49 ff a2 e8 01 00 00 cc
0x00007ff8b13cc6bd: cc cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
0x00007ff8b13cc6cd: f0 01 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc6dd: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
0x00007ff8b13cc6ed: 41 8b d1 4c 8b 4c 24 38 8b cb 4c 8b 50 18 5b 49
0x00007ff8b13cc6fd: ff a2 f8 01 00 00 cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc70d: cc cc cc 48 8b 01 48 8b 48 18 48 ff a1 98 02 00
0x00007ff8b13cc71d: 00 cc cc 48 8b 01 48 8b 48 18 48 ff a1 a0 02 00
0x00007ff8b13cc72d: 00 cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
0x00007ff8b13cc73d: c8 02 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc74d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc75d: 49 ff a2 d8 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc76d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc77d: 49 ff a2 e0 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc78d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc79d: 49 ff a2 f0 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc7ad: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc7bd: 49 ff a2 f8 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc7cd: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc7dd: 49 ff a2 00 03 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc7ed: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc7fd: 49 ff a2 08 03 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc80d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 10 03 00
0x00007ff8b13cc81d: 00 48 ff e0 cc cc cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc82d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc83d: 49 ff a2 68 03 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc84d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 78 03 00
0x00007ff8b13cc85d: 00 41 8b c8 48 ff e0 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc86d: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
0x00007ff8b13cc87d: 41 8b d1 44 8b 4c 24 38 8b cb 4c 8b 50 18 48 8b
0x00007ff8b13cc88d: 44 24 40 48 89 44 24 30 5b 49 ff a2 a8 03 00 00
Stack slot to memory mapping:
stack at sp + 0 slots: 0x0000023462ff3478 is at code_begin+1976 in an Interpreter codelet
method entry point (kind = native) [0x0000023462ff2cc0, 0x0000023462ff4000] 4928 bytes
stack at sp + 1 slots: 0x0000000000000001 is an unknown value
stack at sp + 2 slots: 0x0000023462ff2dba is at code_begin+250 in an Interpreter codelet
method entry point (kind = native) [0x0000023462ff2cc0, 0x0000023462ff4000] 4928 bytes
stack at sp + 3 slots: {method} {0x00000234025b1730} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
stack at sp + 4 slots: 0x00000234022fff90 is pointing into metadata
stack at sp + 5 slots: 0x0 is NULL
stack at sp + 6 slots: 0x0000008f887ff530 is pointing into the stack for thread: 0x0000023453c10460
stack at sp + 7 slots: 0x0000008f887ff590 is pointing into the stack for thread: 0x0000023453c10460
--------------- P R O C E S S ---------------
Threads class SMR info:
_java_thread_list=0x000002347fb81600, length=18, elements={
0x0000023453c10460, 0x000002347e65ecb0, 0x000002347e660120, 0x000002347e6625a0,
0x000002347e664ee0, 0x000002347e6682e0, 0x000002347e66cbf0, 0x000002347e673540,
0x000002347e677fd0, 0x000002347e68cd10, 0x000002347e68c270, 0x000002347f904e70,
0x000002347f907810, 0x000002347f9b69e0, 0x000002347fabebd0, 0x000002347fabf520,
0x000002347fb8ae70, 0x000002347e68b280
}
Java Threads: ( => current thread )
=>0x0000023453c10460 JavaThread "main" [_thread_in_native, id=8228, stack(0x0000008f88700000,0x0000008f88800000)]
0x000002347e65ecb0 JavaThread "Reference Handler" daemon [_thread_blocked, id=4572, stack(0x0000008f88e00000,0x0000008f88f00000)]
0x000002347e660120 JavaThread "Finalizer" daemon [_thread_blocked, id=14964, stack(0x0000008f88f00000,0x0000008f89000000)]
0x000002347e6625a0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13492, stack(0x0000008f89000000,0x0000008f89100000)]
0x000002347e664ee0 JavaThread "Attach Listener" daemon [_thread_blocked, id=6888, stack(0x0000008f89100000,0x0000008f89200000)]
0x000002347e6682e0 JavaThread "Service Thread" daemon [_thread_blocked, id=728, stack(0x0000008f89200000,0x0000008f89300000)]
0x000002347e66cbf0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=18136, stack(0x0000008f89300000,0x0000008f89400000)]
0x000002347e673540 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=9016, stack(0x0000008f89400000,0x0000008f89500000)]
0x000002347e677fd0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=13344, stack(0x0000008f89500000,0x0000008f89600000)]
0x000002347e68cd10 JavaThread "Sweeper thread" daemon [_thread_blocked, id=1584, stack(0x0000008f89600000,0x0000008f89700000)]
0x000002347e68c270 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=14728, stack(0x0000008f89700000,0x0000008f89800000)]
0x000002347f904e70 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=6828, stack(0x0000008f89800000,0x0000008f89900000)]
0x000002347f907810 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=8444, stack(0x0000008f89900000,0x0000008f89a00000)]
0x000002347f9b69e0 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=3880, stack(0x0000008f89a00000,0x0000008f89b00000)]
0x000002347fabebd0 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=19600, stack(0x0000008f89b00000,0x0000008f89c00000)]
0x000002347fabf520 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=19804, stack(0x0000008f89c00000,0x0000008f89d00000)]
0x000002347fb8ae70 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=7232, stack(0x0000008f89d00000,0x0000008f89e00000)]
0x000002347e68b280 JavaThread "Notification Thread" daemon [_thread_blocked, id=10452, stack(0x0000008f89e00000,0x0000008f89f00000)]
Other Threads:
0x0000023453c336a0 VMThread "VM Thread" [stack: 0x0000008f88d00000,0x0000008f88e00000] [id=16992]
0x00000234061a4250 WatcherThread "VM Periodic Task Thread" [stack: 0x0000008f89f00000,0x0000008f8a000000] [id=7680]
0x0000023453c344b0 WorkerThread "GC Thread#0" [stack: 0x0000008f88800000,0x0000008f88900000] [id=4880]
0x0000023453cd3340 ConcurrentGCThread "G1 Main Marker" [stack: 0x0000008f88900000,0x0000008f88a00000] [id=12608]
0x0000023453c333d0 WorkerThread "G1 Conc#0" [stack: 0x0000008f88a00000,0x0000008f88b00000] [id=4216]
0x000002347e580c20 ConcurrentGCThread "G1 Refine#0" [stack: 0x0000008f88b00000,0x0000008f88c00000] [id=12096]
0x000002347e582520 ConcurrentGCThread "G1 Service" [stack: 0x0000008f88c00000,0x0000008f88d00000] [id=2688]
Threads with active compile tasks:
VM state: not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap address: 0x000000060d800000, size: 7976 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
CDS archive(s) mapped at: [0x0000000800000000-0x0000000800c40000-0x0000000800c40000), size 12845056, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 0.
Compressed class space mapped at: 0x0000000801000000-0x0000000841000000, reserved size: 1073741824
Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
GC Precious Log:
CardTable entry size: 512
Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192
CPUs: 24 total, 24 available
Memory: 31894M
Large Page Support: Disabled
NUMA Support: Disabled
Compressed Oops: Enabled (Zero based)
Heap Region Size: 4M
Heap Min Capacity: 8M
Heap Initial Capacity: 500M
Heap Max Capacity: 7976M
Pre-touch: Disabled
Parallel Workers: 18
Concurrent Workers: 5
Concurrent Refinement Workers: 18
Periodic GC: Disabled
Heap:
garbage-first heap total 512000K, used 16384K [0x000000060d800000, 0x0000000800000000)
region size 4096K, 5 young (20480K), 0 survivors (0K)
Metaspace used 5191K, committed 5376K, reserved 1114112K
class space used 367K, committed 448K, reserved 1048576K
Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, OA=open archive, CA=closed archive, TAMS=top-at-mark-start (previous, next)
| 0|0x000000060d800000, 0x000000060d800000, 0x000000060dc00000| 0%| F| |TAMS 0x000000060d800000, 0x000000060d800000| Untracked
| 1|0x000000060dc00000, 0x000000060dc00000, 0x000000060e000000| 0%| F| |TAMS 0x000000060dc00000, 0x000000060dc00000| Untracked
| 2|0x000000060e000000, 0x000000060e000000, 0x000000060e400000| 0%| F| |TAMS 0x000000060e000000, 0x000000060e000000| Untracked
| 3|0x000000060e400000, 0x000000060e400000, 0x000000060e800000| 0%| F| |TAMS 0x000000060e400000, 0x000000060e400000| Untracked
| 4|0x000000060e800000, 0x000000060e800000, 0x000000060ec00000| 0%| F| |TAMS 0x000000060e800000, 0x000000060e800000| Untracked
| 5|0x000000060ec00000, 0x000000060ec00000, 0x000000060f000000| 0%| F| |TAMS 0x000000060ec00000, 0x000000060ec00000| Untracked
| 6|0x000000060f000000, 0x000000060f000000, 0x000000060f400000| 0%| F| |TAMS 0x000000060f000000, 0x000000060f000000| Untracked
| 7|0x000000060f400000, 0x000000060f400000, 0x000000060f800000| 0%| F| |TAMS 0x000000060f400000, 0x000000060f400000| Untracked
| 8|0x000000060f800000, 0x000000060f800000, 0x000000060fc00000| 0%| F| |TAMS 0x000000060f800000, 0x000000060f800000| Untracked
| 9|0x000000060fc00000, 0x000000060fc00000, 0x0000000610000000| 0%| F| |TAMS 0x000000060fc00000, 0x000000060fc00000| Untracked
| 10|0x0000000610000000, 0x0000000610000000, 0x0000000610400000| 0%| F| |TAMS 0x0000000610000000, 0x0000000610000000| Untracked
| 11|0x0000000610400000, 0x0000000610400000, 0x0000000610800000| 0%| F| |TAMS 0x0000000610400000, 0x0000000610400000| Untracked
| 12|0x0000000610800000, 0x0000000610800000, 0x0000000610c00000| 0%| F| |TAMS 0x0000000610800000, 0x0000000610800000| Untracked
| 13|0x0000000610c00000, 0x0000000610c00000, 0x0000000611000000| 0%| F| |TAMS 0x0000000610c00000, 0x0000000610c00000| Untracked
| 14|0x0000000611000000, 0x0000000611000000, 0x0000000611400000| 0%| F| |TAMS 0x0000000611000000, 0x0000000611000000| Untracked
| 15|0x0000000611400000, 0x0000000611400000, 0x0000000611800000| 0%| F| |TAMS 0x0000000611400000, 0x0000000611400000| Untracked
| 16|0x0000000611800000, 0x0000000611800000, 0x0000000611c00000| 0%| F| |TAMS 0x0000000611800000, 0x0000000611800000| Untracked
| 17|0x0000000611c00000, 0x0000000611c00000, 0x0000000612000000| 0%| F| |TAMS 0x0000000611c00000, 0x0000000611c00000| Untracked
| 18|0x0000000612000000, 0x0000000612000000, 0x0000000612400000| 0%| F| |TAMS 0x0000000612000000, 0x0000000612000000| Untracked
| 19|0x0000000612400000, 0x0000000612400000, 0x0000000612800000| 0%| F| |TAMS 0x0000000612400000, 0x0000000612400000| Untracked
| 20|0x0000000612800000, 0x0000000612800000, 0x0000000612c00000| 0%| F| |TAMS 0x0000000612800000, 0x0000000612800000| Untracked
| 21|0x0000000612c00000, 0x0000000612c00000, 0x0000000613000000| 0%| F| |TAMS 0x0000000612c00000, 0x0000000612c00000| Untracked
| 22|0x0000000613000000, 0x0000000613000000, 0x0000000613400000| 0%| F| |TAMS 0x0000000613000000, 0x0000000613000000| Untracked
| 23|0x0000000613400000, 0x0000000613400000, 0x0000000613800000| 0%| F| |TAMS 0x0000000613400000, 0x0000000613400000| Untracked
| 24|0x0000000613800000, 0x0000000613800000, 0x0000000613c00000| 0%| F| |TAMS 0x0000000613800000, 0x0000000613800000| Untracked
| 25|0x0000000613c00000, 0x0000000613c00000, 0x0000000614000000| 0%| F| |TAMS 0x0000000613c00000, 0x0000000613c00000| Untracked
| 26|0x0000000614000000, 0x0000000614000000, 0x0000000614400000| 0%| F| |TAMS 0x0000000614000000, 0x0000000614000000| Untracked
| 27|0x0000000614400000, 0x0000000614400000, 0x0000000614800000| 0%| F| |TAMS 0x0000000614400000, 0x0000000614400000| Untracked
| 28|0x0000000614800000, 0x0000000614800000, 0x0000000614c00000| 0%| F| |TAMS 0x0000000614800000, 0x0000000614800000| Untracked
| 29|0x0000000614c00000, 0x0000000614c00000, 0x0000000615000000| 0%| F| |TAMS 0x0000000614c00000, 0x0000000614c00000| Untracked
| 30|0x0000000615000000, 0x0000000615000000, 0x0000000615400000| 0%| F| |TAMS 0x0000000615000000, 0x0000000615000000| Untracked
| 31|0x0000000615400000, 0x0000000615400000, 0x0000000615800000| 0%| F| |TAMS 0x0000000615400000, 0x0000000615400000| Untracked
| 32|0x0000000615800000, 0x0000000615800000, 0x0000000615c00000| 0%| F| |TAMS 0x0000000615800000, 0x0000000615800000| Untracked
| 33|0x0000000615c00000, 0x0000000615c00000, 0x0000000616000000| 0%| F| |TAMS 0x0000000615c00000, 0x0000000615c00000| Untracked
| 34|0x0000000616000000, 0x0000000616000000, 0x0000000616400000| 0%| F| |TAMS 0x0000000616000000, 0x0000000616000000| Untracked
| 35|0x0000000616400000, 0x0000000616400000, 0x0000000616800000| 0%| F| |TAMS 0x0000000616400000, 0x0000000616400000| Untracked
| 36|0x0000000616800000, 0x0000000616800000, 0x0000000616c00000| 0%| F| |TAMS 0x0000000616800000, 0x0000000616800000| Untracked
| 37|0x0000000616c00000, 0x0000000616c00000, 0x0000000617000000| 0%| F| |TAMS 0x0000000616c00000, 0x0000000616c00000| Untracked
| 38|0x0000000617000000, 0x0000000617000000, 0x0000000617400000| 0%| F| |TAMS 0x0000000617000000, 0x0000000617000000| Untracked
| 39|0x0000000617400000, 0x0000000617400000, 0x0000000617800000| 0%| F| |TAMS 0x0000000617400000, 0x0000000617400000| Untracked
| 40|0x0000000617800000, 0x0000000617800000, 0x0000000617c00000| 0%| F| |TAMS 0x0000000617800000, 0x0000000617800000| Untracked
| 41|0x0000000617c00000, 0x0000000617c00000, 0x0000000618000000| 0%| F| |TAMS 0x0000000617c00000, 0x0000000617c00000| Untracked
| 42|0x0000000618000000, 0x0000000618000000, 0x0000000618400000| 0%| F| |TAMS 0x0000000618000000, 0x0000000618000000| Untracked
| 43|0x0000000618400000, 0x0000000618400000, 0x0000000618800000| 0%| F| |TAMS 0x0000000618400000, 0x0000000618400000| Untracked
| 44|0x0000000618800000, 0x0000000618800000, 0x0000000618c00000| 0%| F| |TAMS 0x0000000618800000, 0x0000000618800000| Untracked
| 45|0x0000000618c00000, 0x0000000618c00000, 0x0000000619000000| 0%| F| |TAMS 0x0000000618c00000, 0x0000000618c00000| Untracked
| 46|0x0000000619000000, 0x0000000619000000, 0x0000000619400000| 0%| F| |TAMS 0x0000000619000000, 0x0000000619000000| Untracked
| 47|0x0000000619400000, 0x0000000619400000, 0x0000000619800000| 0%| F| |TAMS 0x0000000619400000, 0x0000000619400000| Untracked
| 48|0x0000000619800000, 0x0000000619800000, 0x0000000619c00000| 0%| F| |TAMS 0x0000000619800000, 0x0000000619800000| Untracked
| 49|0x0000000619c00000, 0x0000000619c00000, 0x000000061a000000| 0%| F| |TAMS 0x0000000619c00000, 0x0000000619c00000| Untracked
| 50|0x000000061a000000, 0x000000061a000000, 0x000000061a400000| 0%| F| |TAMS 0x000000061a000000, 0x000000061a000000| Untracked
| 51|0x000000061a400000, 0x000000061a400000, 0x000000061a800000| 0%| F| |TAMS 0x000000061a400000, 0x000000061a400000| Untracked
| 52|0x000000061a800000, 0x000000061a800000, 0x000000061ac00000| 0%| F| |TAMS 0x000000061a800000, 0x000000061a800000| Untracked
| 53|0x000000061ac00000, 0x000000061ac00000, 0x000000061b000000| 0%| F| |TAMS 0x000000061ac00000, 0x000000061ac00000| Untracked
| 54|0x000000061b000000, 0x000000061b000000, 0x000000061b400000| 0%| F| |TAMS 0x000000061b000000, 0x000000061b000000| Untracked
| 55|0x000000061b400000, 0x000000061b400000, 0x000000061b800000| 0%| F| |TAMS 0x000000061b400000, 0x000000061b400000| Untracked
| 56|0x000000061b800000, 0x000000061b800000, 0x000000061bc00000| 0%| F| |TAMS 0x000000061b800000, 0x000000061b800000| Untracked
| 57|0x000000061bc00000, 0x000000061bc00000, 0x000000061c000000| 0%| F| |TAMS 0x000000061bc00000, 0x000000061bc00000| Untracked
| 58|0x000000061c000000, 0x000000061c000000, 0x000000061c400000| 0%| F| |TAMS 0x000000061c000000, 0x000000061c000000| Untracked
| 59|0x000000061c400000, 0x000000061c400000, 0x000000061c800000| 0%| F| |TAMS 0x000000061c400000, 0x000000061c400000| Untracked
| 60|0x000000061c800000, 0x000000061c800000, 0x000000061cc00000| 0%| F| |TAMS 0x000000061c800000, 0x000000061c800000| Untracked
| 61|0x000000061cc00000, 0x000000061cc00000, 0x000000061d000000| 0%| F| |TAMS 0x000000061cc00000, 0x000000061cc00000| Untracked
| 62|0x000000061d000000, 0x000000061d000000, 0x000000061d400000| 0%| F| |TAMS 0x000000061d000000, 0x000000061d000000| Untracked
| 63|0x000000061d400000, 0x000000061d400000, 0x000000061d800000| 0%| F| |TAMS 0x000000061d400000, 0x000000061d400000| Untracked
| 64|0x000000061d800000, 0x000000061d800000, 0x000000061dc00000| 0%| F| |TAMS 0x000000061d800000, 0x000000061d800000| Untracked
| 65|0x000000061dc00000, 0x000000061dc00000, 0x000000061e000000| 0%| F| |TAMS 0x000000061dc00000, 0x000000061dc00000| Untracked
| 66|0x000000061e000000, 0x000000061e000000, 0x000000061e400000| 0%| F| |TAMS 0x000000061e000000, 0x000000061e000000| Untracked
| 67|0x000000061e400000, 0x000000061e400000, 0x000000061e800000| 0%| F| |TAMS 0x000000061e400000, 0x000000061e400000| Untracked
| 68|0x000000061e800000, 0x000000061e800000, 0x000000061ec00000| 0%| F| |TAMS 0x000000061e800000, 0x000000061e800000| Untracked
| 69|0x000000061ec00000, 0x000000061ec00000, 0x000000061f000000| 0%| F| |TAMS 0x000000061ec00000, 0x000000061ec00000| Untracked
| 70|0x000000061f000000, 0x000000061f000000, 0x000000061f400000| 0%| F| |TAMS 0x000000061f000000, 0x000000061f000000| Untracked
| 71|0x000000061f400000, 0x000000061f400000, 0x000000061f800000| 0%| F| |TAMS 0x000000061f400000, 0x000000061f400000| Untracked
| 72|0x000000061f800000, 0x000000061f800000, 0x000000061fc00000| 0%| F| |TAMS 0x000000061f800000, 0x000000061f800000| Untracked
| 73|0x000000061fc00000, 0x000000061fc00000, 0x0000000620000000| 0%| F| |TAMS 0x000000061fc00000, 0x000000061fc00000| Untracked
| 74|0x0000000620000000, 0x0000000620000000, 0x0000000620400000| 0%| F| |TAMS 0x0000000620000000, 0x0000000620000000| Untracked
| 75|0x0000000620400000, 0x0000000620400000, 0x0000000620800000| 0%| F| |TAMS 0x0000000620400000, 0x0000000620400000| Untracked
| 76|0x0000000620800000, 0x0000000620800000, 0x0000000620c00000| 0%| F| |TAMS 0x0000000620800000, 0x0000000620800000| Untracked
| 77|0x0000000620c00000, 0x0000000620c00000, 0x0000000621000000| 0%| F| |TAMS 0x0000000620c00000, 0x0000000620c00000| Untracked
| 78|0x0000000621000000, 0x0000000621000000, 0x0000000621400000| 0%| F| |TAMS 0x0000000621000000, 0x0000000621000000| Untracked
| 79|0x0000000621400000, 0x0000000621400000, 0x0000000621800000| 0%| F| |TAMS 0x0000000621400000, 0x0000000621400000| Untracked
| 80|0x0000000621800000, 0x0000000621800000, 0x0000000621c00000| 0%| F| |TAMS 0x0000000621800000, 0x0000000621800000| Untracked
| 81|0x0000000621c00000, 0x0000000621c00000, 0x0000000622000000| 0%| F| |TAMS 0x0000000621c00000, 0x0000000621c00000| Untracked
| 82|0x0000000622000000, 0x0000000622000000, 0x0000000622400000| 0%| F| |TAMS 0x0000000622000000, 0x0000000622000000| Untracked
| 83|0x0000000622400000, 0x0000000622400000, 0x0000000622800000| 0%| F| |TAMS 0x0000000622400000, 0x0000000622400000| Untracked
| 84|0x0000000622800000, 0x0000000622800000, 0x0000000622c00000| 0%| F| |TAMS 0x0000000622800000, 0x0000000622800000| Untracked
| 85|0x0000000622c00000, 0x0000000622c00000, 0x0000000623000000| 0%| F| |TAMS 0x0000000622c00000, 0x0000000622c00000| Untracked
| 86|0x0000000623000000, 0x0000000623000000, 0x0000000623400000| 0%| F| |TAMS 0x0000000623000000, 0x0000000623000000| Untracked
| 87|0x0000000623400000, 0x0000000623400000, 0x0000000623800000| 0%| F| |TAMS 0x0000000623400000, 0x0000000623400000| Untracked
| 88|0x0000000623800000, 0x0000000623800000, 0x0000000623c00000| 0%| F| |TAMS 0x0000000623800000, 0x0000000623800000| Untracked
| 89|0x0000000623c00000, 0x0000000623c00000, 0x0000000624000000| 0%| F| |TAMS 0x0000000623c00000, 0x0000000623c00000| Untracked
| 90|0x0000000624000000, 0x0000000624000000, 0x0000000624400000| 0%| F| |TAMS 0x0000000624000000, 0x0000000624000000| Untracked
| 91|0x0000000624400000, 0x0000000624400000, 0x0000000624800000| 0%| F| |TAMS 0x0000000624400000, 0x0000000624400000| Untracked
| 92|0x0000000624800000, 0x0000000624800000, 0x0000000624c00000| 0%| F| |TAMS 0x0000000624800000, 0x0000000624800000| Untracked
| 93|0x0000000624c00000, 0x0000000624c00000, 0x0000000625000000| 0%| F| |TAMS 0x0000000624c00000, 0x0000000624c00000| Untracked
| 94|0x0000000625000000, 0x0000000625000000, 0x0000000625400000| 0%| F| |TAMS 0x0000000625000000, 0x0000000625000000| Untracked
| 95|0x0000000625400000, 0x0000000625400000, 0x0000000625800000| 0%| F| |TAMS 0x0000000625400000, 0x0000000625400000| Untracked
| 96|0x0000000625800000, 0x0000000625800000, 0x0000000625c00000| 0%| F| |TAMS 0x0000000625800000, 0x0000000625800000| Untracked
| 97|0x0000000625c00000, 0x0000000625c00000, 0x0000000626000000| 0%| F| |TAMS 0x0000000625c00000, 0x0000000625c00000| Untracked
| 98|0x0000000626000000, 0x0000000626000000, 0x0000000626400000| 0%| F| |TAMS 0x0000000626000000, 0x0000000626000000| Untracked
| 99|0x0000000626400000, 0x0000000626400000, 0x0000000626800000| 0%| F| |TAMS 0x0000000626400000, 0x0000000626400000| Untracked
| 100|0x0000000626800000, 0x0000000626800000, 0x0000000626c00000| 0%| F| |TAMS 0x0000000626800000, 0x0000000626800000| Untracked
| 101|0x0000000626c00000, 0x0000000626c00000, 0x0000000627000000| 0%| F| |TAMS 0x0000000626c00000, 0x0000000626c00000| Untracked
| 102|0x0000000627000000, 0x0000000627000000, 0x0000000627400000| 0%| F| |TAMS 0x0000000627000000, 0x0000000627000000| Untracked
| 103|0x0000000627400000, 0x0000000627400000, 0x0000000627800000| 0%| F| |TAMS 0x0000000627400000, 0x0000000627400000| Untracked
| 104|0x0000000627800000, 0x0000000627800000, 0x0000000627c00000| 0%| F| |TAMS 0x0000000627800000, 0x0000000627800000| Untracked
| 105|0x0000000627c00000, 0x0000000627c00000, 0x0000000628000000| 0%| F| |TAMS 0x0000000627c00000, 0x0000000627c00000| Untracked
| 106|0x0000000628000000, 0x0000000628000000, 0x0000000628400000| 0%| F| |TAMS 0x0000000628000000, 0x0000000628000000| Untracked
| 107|0x0000000628400000, 0x0000000628400000, 0x0000000628800000| 0%| F| |TAMS 0x0000000628400000, 0x0000000628400000| Untracked
| 108|0x0000000628800000, 0x0000000628800000, 0x0000000628c00000| 0%| F| |TAMS 0x0000000628800000, 0x0000000628800000| Untracked
| 109|0x0000000628c00000, 0x0000000628c00000, 0x0000000629000000| 0%| F| |TAMS 0x0000000628c00000, 0x0000000628c00000| Untracked
| 110|0x0000000629000000, 0x0000000629000000, 0x0000000629400000| 0%| F| |TAMS 0x0000000629000000, 0x0000000629000000| Untracked
| 111|0x0000000629400000, 0x0000000629400000, 0x0000000629800000| 0%| F| |TAMS 0x0000000629400000, 0x0000000629400000| Untracked
| 112|0x0000000629800000, 0x0000000629800000, 0x0000000629c00000| 0%| F| |TAMS 0x0000000629800000, 0x0000000629800000| Untracked
| 113|0x0000000629c00000, 0x0000000629c00000, 0x000000062a000000| 0%| F| |TAMS 0x0000000629c00000, 0x0000000629c00000| Untracked
| 114|0x000000062a000000, 0x000000062a000000, 0x000000062a400000| 0%| F| |TAMS 0x000000062a000000, 0x000000062a000000| Untracked
| 115|0x000000062a400000, 0x000000062a400000, 0x000000062a800000| 0%| F| |TAMS 0x000000062a400000, 0x000000062a400000| Untracked
| 116|0x000000062a800000, 0x000000062a800000, 0x000000062ac00000| 0%| F| |TAMS 0x000000062a800000, 0x000000062a800000| Untracked
| 117|0x000000062ac00000, 0x000000062ac00000, 0x000000062b000000| 0%| F| |TAMS 0x000000062ac00000, 0x000000062ac00000| Untracked
| 118|0x000000062b000000, 0x000000062b000000, 0x000000062b400000| 0%| F| |TAMS 0x000000062b000000, 0x000000062b000000| Untracked
| 119|0x000000062b400000, 0x000000062b400000, 0x000000062b800000| 0%| F| |TAMS 0x000000062b400000, 0x000000062b400000| Untracked
| 120|0x000000062b800000, 0x000000062bb7fc80, 0x000000062bc00000| 87%| E| |TAMS 0x000000062b800000, 0x000000062b800000| Complete
| 121|0x000000062bc00000, 0x000000062c000000, 0x000000062c000000|100%| E|CS|TAMS 0x000000062bc00000, 0x000000062bc00000| Complete
| 122|0x000000062c000000, 0x000000062c400000, 0x000000062c400000|100%| E|CS|TAMS 0x000000062c000000, 0x000000062c000000| Complete
| 123|0x000000062c400000, 0x000000062c800000, 0x000000062c800000|100%| E|CS|TAMS 0x000000062c400000, 0x000000062c400000| Complete
| 124|0x000000062c800000, 0x000000062cc00000, 0x000000062cc00000|100%| E|CS|TAMS 0x000000062c800000, 0x000000062c800000| Complete
Card table byte_map: [0x000002346c8f0000,0x000002346d890000] _byte_map_base: 0x0000023469884000
Marking Bits (Prev, Next): (CMBitMap*) 0x0000023453cc26f0, (CMBitMap*) 0x0000023453cc2730
Prev Bits: [0x000002346e830000, 0x00000234764d0000)
Next Bits: [0x00000234764d0000, 0x000002347e170000)
Polling page: 0x0000023451ab0000
Metaspace:
Usage:
Non-class: 4.71 MB used.
Class: 367.62 KB used.
Both: 5.07 MB used.
Virtual space:
Non-class space: 64.00 MB reserved, 4.81 MB ( 8%) committed, 1 nodes.
Class space: 1.00 GB reserved, 448.00 KB ( <1%) committed, 1 nodes.
Both: 1.06 GB reserved, 5.25 MB ( <1%) committed.
Chunk freelists:
Non-Class: 2.25 MB
Class: 3.51 MB
Both: 5.76 MB
MaxMetaspaceSize: unlimited
CompressedClassSpaceSize: 1.00 GB
Initial GC threshold: 21.00 MB
Current GC threshold: 21.00 MB
CDS: on
MetaspaceReclaimPolicy: balanced
- commit_granule_bytes: 65536.
- commit_granule_words: 8192.
- virtual_space_node_default_size: 8388608.
- enlarge_chunks_in_place: 1.
- new_chunks_are_fully_committed: 0.
- uncommit_free_chunks: 1.
- use_allocation_guard: 0.
Internal statistics:
num_allocs_failed_limit: 0.
num_arena_births: 84.
num_arena_deaths: 0.
num_vsnodes_births: 2.
num_vsnodes_deaths: 0.
num_space_committed: 84.
num_space_uncommitted: 0.
num_chunks_returned_to_freelist: 0.
num_chunks_taken_from_freelist: 166.
num_chunk_merges: 0.
num_chunk_splits: 118.
num_chunks_enlarged: 83.
num_inconsistent_stats: 0.
CodeHeap 'non-profiled nmethods': size=119168Kb used=290Kb max_used=290Kb free=118878Kb
bounds [0x0000023463720000, 0x0000023463990000, 0x000002346ab80000]
CodeHeap 'profiled nmethods': size=119104Kb used=1485Kb max_used=1485Kb free=117618Kb
bounds [0x000002345bb80000, 0x000002345bdf0000, 0x0000023462fd0000]
CodeHeap 'non-nmethods': size=7488Kb used=2889Kb max_used=2902Kb free=4598Kb
bounds [0x0000023462fd0000, 0x00000234632b0000, 0x0000023463720000]
total_blobs=1942 nmethods=912 adapters=939
compilation: enabled
stopped_count=0, restarted_count=0
full_count=0
Compilation events (20 events):
Event: 0.301 Thread 0x000002347f904e70 901 3 java.lang.Integer::toUnsignedLong (7 bytes)
Event: 0.301 Thread 0x000002347e677fd0 902 3 org.lwjgl.system.MemoryUtil::write8 (19 bytes)
Event: 0.301 Thread 0x000002347f904e70 nmethod 901 0x000002345bcf1090 code [0x000002345bcf1220, 0x000002345bcf1318]
Event: 0.301 Thread 0x000002347f907810 903 3 sun.misc.Unsafe::putByte (11 bytes)
Event: 0.301 Thread 0x000002347f907810 nmethod 903 0x000002345bcf1390 code [0x000002345bcf1520, 0x000002345bcf1638]
Event: 0.301 Thread 0x000002347e677fd0 nmethod 902 0x000002345bcf1710 code [0x000002345bcf18c0, 0x000002345bcf1b18]
Event: 0.302 Thread 0x000002347fb8ae70 905 4 org.eclipse.jdt.launching.internal.org.objectweb.asm.ByteVector::putShort (52 bytes)
Event: 0.303 Thread 0x000002347fb8ae70 nmethod 905 0x0000023463767c90 code [0x0000023463767e20, 0x0000023463767fc8]
Event: 0.305 Thread 0x000002347e677fd0 906 3 java.lang.String::indexOf (64 bytes)
Event: 0.305 Thread 0x000002347f907810 907 3 java.lang.StringLatin1::indexOf (25 bytes)
Event: 0.305 Thread 0x000002347f907810 nmethod 907 0x000002345bcf1c10 code [0x000002345bcf1dc0, 0x000002345bcf1fe8]
Event: 0.305 Thread 0x000002347e677fd0 nmethod 906 0x000002345bcf2110 code [0x000002345bcf2320, 0x000002345bcf2808]
Event: 0.306 Thread 0x000002347f907810 909 3 sun.misc.Unsafe::putLong (11 bytes)
Event: 0.306 Thread 0x000002347f904e70 910 3 org.lwjgl.system.MemoryUtil::memPutAddress (29 bytes)
Event: 0.306 Thread 0x000002347fb8ae70 911 4 java.lang.Integer::toUnsignedLong (7 bytes)
Event: 0.306 Thread 0x000002347f907810 nmethod 909 0x000002345bcf2990 code [0x000002345bcf2b20, 0x000002345bcf2c38]
Event: 0.306 Thread 0x000002347f904e70 nmethod 910 0x000002345bcf2d10 code [0x000002345bcf2ec0, 0x000002345bcf30b8]
Event: 0.306 Thread 0x000002347fb8ae70 nmethod 911 0x0000023463768510 code [0x0000023463768680, 0x00000234637686d8]
Event: 0.306 Thread 0x000002347f904e70 912 3 java.lang.ref.PhantomReference::<init> (7 bytes)
Event: 0.306 Thread 0x000002347f904e70 nmethod 912 0x000002345bcf3190 code [0x000002345bcf3340, 0x000002345bcf3638]
GC Heap History (0 events):
No events
Dll operation events (11 events):
Event: 0.004 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\java.dll
Event: 0.009 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
Event: 0.151 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
Event: 0.152 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
Event: 0.155 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\net.dll
Event: 0.155 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
Event: 0.157 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
Event: 0.194 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
Event: 0.215 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
Event: 0.270 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
Event: 0.280 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
Deoptimization events (20 events):
Event: 0.223 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887fbd10
Event: 0.223 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887fb178 mode 0
Event: 0.224 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887fbde0
Event: 0.224 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887fb248 mode 0
Event: 0.225 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887f7f90
Event: 0.225 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887f73f8 mode 0
Event: 0.226 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002345bc168f3 sp=0x0000008f887f7f90
Event: 0.226 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303b0e3 sp=0x0000008f887f73f8 mode 0
Event: 0.240 Thread 0x0000023453c10460 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000023463750608 relative=0x00000000000002c8
Event: 0.240 Thread 0x0000023453c10460 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000023463750608 method=org.eclipse.jdt.launching.internal.org.objectweb.asm.ClassReader.readUTF8(I[C)Ljava/lang/String; @ 11 c2
Event: 0.240 Thread 0x0000023453c10460 DEOPT PACKING pc=0x0000023463750608 sp=0x0000008f887fc150
Event: 0.240 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303a5a3 sp=0x0000008f887fc158 mode 2
Event: 0.253 Thread 0x0000023453c10460 Uncommon trap: trap_request=0xffffff45 fr.pc=0x0000023463750d18 relative=0x00000000000000f8
Event: 0.253 Thread 0x0000023453c10460 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000023463750d18 method=org.eclipse.jdt.launching.internal.org.objectweb.asm.ByteVector.putShort(I)Lorg/eclipse/jdt/launching/internal/org/objectweb/asm/ByteVector; @ 13 c2
Event: 0.253 Thread 0x0000023453c10460 DEOPT PACKING pc=0x0000023463750d18 sp=0x0000008f887fb060
Event: 0.253 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303a5a3 sp=0x0000008f887faff8 mode 2
Event: 0.264 Thread 0x0000023453c10460 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000002346375e008 relative=0x0000000000000068
Event: 0.264 Thread 0x0000023453c10460 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000002346375e008 method=java.io.WinNTFileSystem.isSlash(C)Z @ 9 c2
Event: 0.264 Thread 0x0000023453c10460 DEOPT PACKING pc=0x000002346375e008 sp=0x0000008f887fcc70
Event: 0.264 Thread 0x0000023453c10460 DEOPT UNPACKING pc=0x000002346303a5a3 sp=0x0000008f887fcc08 mode 2
Classes loaded (20 events):
Event: 0.286 Loading class sun/misc/Unsafe
Event: 0.286 Loading class sun/misc/Unsafe done
Event: 0.286 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor
Event: 0.286 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor done
Event: 0.288 Loading class java/util/function/LongPredicate
Event: 0.288 Loading class java/util/function/LongPredicate done
Event: 0.288 Loading class java/lang/foreign/MemorySegment
Event: 0.289 Loading class java/lang/foreign/Addressable
Event: 0.289 Loading class java/lang/foreign/Addressable done
Event: 0.289 Loading class java/lang/foreign/MemorySegment done
Event: 0.290 Loading class java/nio/InvalidMarkException
Event: 0.291 Loading class java/nio/InvalidMarkException done
Event: 0.291 Loading class java/nio/BufferUnderflowException
Event: 0.291 Loading class java/nio/BufferUnderflowException done
Event: 0.301 Loading class jdk/internal/foreign/MemorySessionImpl
Event: 0.301 Loading class java/lang/foreign/MemorySession
Event: 0.301 Loading class java/lang/foreign/SegmentAllocator
Event: 0.301 Loading class java/lang/foreign/SegmentAllocator done
Event: 0.301 Loading class java/lang/foreign/MemorySession done
Event: 0.301 Loading class jdk/internal/foreign/MemorySessionImpl done
Classes unloaded (0 events):
No events
Classes redefined (0 events):
No events
Internal exceptions (20 events):
Event: 0.276 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf80f98}> (0x000000062bf80f98)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.276 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf818f8}> (0x000000062bf818f8)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.276 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf8a610}> (0x000000062bf8a610)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.278 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf8d3f0}> (0x000000062bf8d3f0)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.278 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf8d7b0}> (0x000000062bf8d7b0)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.282 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf99658}> (0x000000062bf99658)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.282 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bf99950}> (0x000000062bf99950)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.284 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b83b910}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object)'> (0x000000062b83b910)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.288 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b88f0f0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, int, long)'> (0x000000062b88f0f0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.288 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8949c0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, int)'> (0x000000062b8949c0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.289 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8b36a8}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, long, long)'> (0x000000062b8b36a8)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.289 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8b97c0}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, long)'> (0x000000062b8b97c0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.290 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8bdad0}: 'java.lang.Object java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, long, java.lang.Object)'> (0x000000062b8bdad0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.290 Thread 0x0000023453c10460 Exception <a 'java/lang/NoSuchMethodError'{0x000000062b8c5058}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object, long)'> (0x000000062b8c5058)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.295 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9a95b8}> (0x000000062b9a95b8)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.296 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9a98b0}> (0x000000062b9a98b0)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.296 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9aa4c0}> (0x000000062b9aa4c0)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.296 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9b1250}> (0x000000062b9b1250)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.299 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9b4030}> (0x000000062b9b4030)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.299 Thread 0x0000023453c10460 Exception <a 'sun/nio/fs/WindowsException'{0x000000062b9b43e0}> (0x000000062b9b43e0)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
VM Operations (10 events):
Event: 0.031 Executing VM operation: HandshakeAllThreads
Event: 0.031 Executing VM operation: HandshakeAllThreads done
Event: 0.040 Executing VM operation: ChangeBreakpoints
Event: 0.040 Executing VM operation: ChangeBreakpoints done
Event: 0.137 Executing VM operation: ChangeBreakpoints
Event: 0.137 Executing VM operation: ChangeBreakpoints done
Event: 0.259 Executing VM operation: HandshakeAllThreads
Event: 0.259 Executing VM operation: HandshakeAllThreads done
Event: 0.264 Executing VM operation: HandshakeAllThreads
Event: 0.264 Executing VM operation: HandshakeAllThreads done
Events (18 events):
Event: 0.009 Thread 0x0000023453c10460 Thread added: 0x0000023453c10460
Event: 0.014 Thread 0x000002347e65ecb0 Thread added: 0x000002347e65ecb0
Event: 0.015 Thread 0x000002347e660120 Thread added: 0x000002347e660120
Event: 0.015 Thread 0x000002347e6625a0 Thread added: 0x000002347e6625a0
Event: 0.015 Thread 0x000002347e664ee0 Thread added: 0x000002347e664ee0
Event: 0.015 Thread 0x000002347e6682e0 Thread added: 0x000002347e6682e0
Event: 0.015 Thread 0x000002347e66cbf0 Thread added: 0x000002347e66cbf0
Event: 0.015 Thread 0x000002347e673540 Thread added: 0x000002347e673540
Event: 0.015 Thread 0x000002347e677fd0 Thread added: 0x000002347e677fd0
Event: 0.015 Thread 0x000002347e68cd10 Thread added: 0x000002347e68cd10
Event: 0.029 Thread 0x000002347e68c270 Thread added: 0x000002347e68c270
Event: 0.031 Thread 0x000002347f904e70 Thread added: 0x000002347f904e70
Event: 0.032 Thread 0x000002347f907810 Thread added: 0x000002347f907810
Event: 0.040 Thread 0x000002347f9b69e0 Thread added: 0x000002347f9b69e0
Event: 0.040 Thread 0x000002347fabebd0 Thread added: 0x000002347fabebd0
Event: 0.040 Thread 0x000002347fabf520 Thread added: 0x000002347fabf520
Event: 0.200 Thread 0x000002347fb8ae70 Thread added: 0x000002347fb8ae70
Event: 0.212 Thread 0x000002347e68b280 Thread added: 0x000002347e68b280
Dynamic libraries:
0x00007ff636b50000 - 0x00007ff636b60000 C:\Program Files\Java\jdk-19.0.2\bin\javaw.exe
0x00007ff935510000 - 0x00007ff935708000 C:\Windows\SYSTEM32\ntdll.dll
0x00007ff934e50000 - 0x00007ff934f0f000 C:\Windows\System32\KERNEL32.DLL
0x00007ff932bf0000 - 0x00007ff932ee6000 C:\Windows\System32\KERNELBASE.dll
0x00007ff932f20000 - 0x00007ff933020000 C:\Windows\System32\ucrtbase.dll
0x00007ff91a600000 - 0x00007ff91a618000 C:\Program Files\Java\jdk-19.0.2\bin\jli.dll
0x00007ff91a700000 - 0x00007ff91a71b000 C:\Program Files\Java\jdk-19.0.2\bin\VCRUNTIME140.dll
0x00007ff934720000 - 0x00007ff9347cf000 C:\Windows\System32\ADVAPI32.dll
0x00007ff934bb0000 - 0x00007ff934c4e000 C:\Windows\System32\msvcrt.dll
0x00007ff9353a0000 - 0x00007ff93543c000 C:\Windows\System32\sechost.dll
0x00007ff934a80000 - 0x00007ff934ba6000 C:\Windows\System32\RPCRT4.dll
0x00007ff933570000 - 0x00007ff93370d000 C:\Windows\System32\USER32.dll
0x00007ff9334a0000 - 0x00007ff9334c2000 C:\Windows\System32\win32u.dll
0x00007ff925810000 - 0x00007ff925aaa000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
0x00007ff934c80000 - 0x00007ff934cac000 C:\Windows\System32\GDI32.dll
0x00007ff933380000 - 0x00007ff933495000 C:\Windows\System32\gdi32full.dll
0x00007ff9334d0000 - 0x00007ff93356d000 C:\Windows\System32\msvcp_win.dll
0x00007ff92b1d0000 - 0x00007ff92b1da000 C:\Windows\SYSTEM32\VERSION.dll
0x00007ff934c50000 - 0x00007ff934c80000 C:\Windows\System32\IMM32.DLL
0x00007ff92f6f0000 - 0x00007ff92f6fc000 C:\Program Files\Java\jdk-19.0.2\bin\vcruntime140_1.dll
0x00007ff8fde20000 - 0x00007ff8fdeae000 C:\Program Files\Java\jdk-19.0.2\bin\msvcp140.dll
0x00007ff8884e0000 - 0x00007ff8891a0000 C:\Program Files\Java\jdk-19.0.2\bin\server\jvm.dll
0x00007ff8cf580000 - 0x00007ff8cf589000 C:\Windows\SYSTEM32\WSOCK32.dll
0x00007ff925d90000 - 0x00007ff925db7000 C:\Windows\SYSTEM32\WINMM.dll
0x00007ff934990000 - 0x00007ff9349fb000 C:\Windows\System32\WS2_32.dll
0x00007ff930ac0000 - 0x00007ff930ad2000 C:\Windows\SYSTEM32\kernel.appcore.dll
0x00007ff92f6d0000 - 0x00007ff92f6da000 C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
0x00007ff929560000 - 0x00007ff929744000 C:\Windows\SYSTEM32\DBGHELP.DLL
0x00007ff9154a0000 - 0x00007ff9154d4000 C:\Windows\SYSTEM32\dbgcore.DLL
0x00007ff933280000 - 0x00007ff933302000 C:\Windows\System32\bcryptPrimitives.dll
0x00007ff90cd20000 - 0x00007ff90cd5c000 C:\Program Files\Java\jdk-19.0.2\bin\jdwp.dll
0x00007ff91a5f0000 - 0x00007ff91a5fe000 C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
0x00007ff911b60000 - 0x00007ff911b86000 C:\Program Files\Java\jdk-19.0.2\bin\java.dll
0x00007ff8a3af0000 - 0x00007ff8a3bc7000 C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
0x00007ff933710000 - 0x00007ff933e54000 C:\Windows\System32\SHELL32.dll
0x00007ff930cc0000 - 0x00007ff931453000 C:\Windows\SYSTEM32\windows.storage.dll
0x00007ff934f10000 - 0x00007ff935264000 C:\Windows\System32\combase.dll
0x00007ff932640000 - 0x00007ff93266e000 C:\Windows\SYSTEM32\Wldp.dll
0x00007ff9352d0000 - 0x00007ff93537d000 C:\Windows\System32\SHCORE.dll
0x00007ff935270000 - 0x00007ff9352c5000 C:\Windows\System32\shlwapi.dll
0x00007ff932b30000 - 0x00007ff932b4f000 C:\Windows\SYSTEM32\profapi.dll
0x00007ff919f00000 - 0x00007ff919f0c000 C:\Program Files\Java\jdk-19.0.2\bin\dt_socket.dll
0x00007ff932040000 - 0x00007ff93207c000 C:\Windows\SYSTEM32\IPHLPAPI.DLL
0x00007ff9323a0000 - 0x00007ff93240a000 C:\Windows\system32\mswsock.dll
0x00007ff932090000 - 0x00007ff93215a000 C:\Windows\SYSTEM32\DNSAPI.dll
0x00007ff934e40000 - 0x00007ff934e48000 C:\Windows\System32\NSI.dll
0x00007ff92a320000 - 0x00007ff92a32a000 C:\Windows\System32\rasadhlp.dll
0x00007ff9279b0000 - 0x00007ff927a32000 C:\Windows\System32\fwpuclnt.dll
0x00007ff932ef0000 - 0x00007ff932f17000 C:\Windows\System32\bcrypt.dll
0x00007ff919c40000 - 0x00007ff919c58000 C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
0x00007ff916970000 - 0x00007ff916983000 C:\Program Files\Java\jdk-19.0.2\bin\net.dll
0x00007ff92bf70000 - 0x00007ff92c07a000 C:\Windows\SYSTEM32\WINHTTP.dll
0x00007ff912fa0000 - 0x00007ff912fb6000 C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
0x00007ff919ef0000 - 0x00007ff919f00000 C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
0x00007ff8a45d0000 - 0x00007ff8a464a000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
0x00007ff8b13c0000 - 0x00007ff8b141e000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
0x00007ff8c8fb0000 - 0x00007ff8c90d5000 C:\Windows\SYSTEM32\opengl32.dll
0x00007ff8c8a90000 - 0x00007ff8c8abc000 C:\Windows\SYSTEM32\GLU32.dll
0x00007ff8a2190000 - 0x00007ff8a2400000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\jemalloc.dll
dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Java\jdk-19.0.2\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Java\jdk-19.0.2\bin\server;C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64
VM Arguments:
jvm_args: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63099 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8
java_command: speiger.src.coreengine.Testing
java_class_path (initial): D:\Projects\GameProject\SimpleJavaEngine\bin\main;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\757920418805fb90bfebb3d46b1d9e7669fca2eb\lwjgl-glfw-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\1251e3cb7e5d6159334cfb9244f789ce992f03b\lwjgl-glfw-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\877e17e39ebcd58a9c956dc3b5b777813de0873a\lwjgl-jemalloc-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\db886c1f9e313c3fa2a25543b99ccd250d3f9fb5\lwjgl-jemalloc-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\ec66452fad5bf48707cbe96c573c6cc3dd8a7a82\lwjgl-nfd-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\12c0041066a97f0c74d0f72db1423ac9ea124275\lwjgl-nfd-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\ae5357ed6d934546d3533993ea84c0cfb75eed95\lwjgl-openal-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\e74f299a602192faaf14b917632e4cbbb493c940\lwjgl-openal-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\ee8e95be0b438602038bc1f02dc5e3d011b1b216\lwjgl-opengl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\83cd34469d4e0bc335bf74c7f62206530a9480bf\lwjgl-opengl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\a2550795014d622b686e9caac50b14baa87d2c70\lwjgl-stb-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\1c4f4b8353bdb78c5264ab921436f03fc9aa1ba5\lwjgl-stb-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\4421d94af68e35dcaa31737a6fc59136a1e61b94\lwjgl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\a55169ced70ffcd15f2162daf4a9c968578f6cd5\lwjgl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.8.6\9180733b7df8542621dc12e21e87557e8c99b8cb\gson-2.8.6.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\de.speiger\Primitive-Collections\0.8.0\333b9d587940fc34ad68f3d7d6bace4646dd02ec\Primitive-Collections-0.8.0.jar
Launcher Type: SUN_STANDARD
[Global flags]
intx CICompilerCount = 12 {product} {ergonomic}
uint ConcGCThreads = 5 {product} {ergonomic}
uint G1ConcRefinementThreads = 18 {product} {ergonomic}
size_t G1HeapRegionSize = 4194304 {product} {ergonomic}
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
size_t InitialHeapSize = 524288000 {product} {ergonomic}
size_t MarkStackSize = 4194304 {product} {ergonomic}
size_t MaxHeapSize = 8363442176 {product} {ergonomic}
size_t MaxNewSize = 5016387584 {product} {ergonomic}
size_t MinHeapDeltaBytes = 4194304 {product} {ergonomic}
size_t MinHeapSize = 8388608 {product} {ergonomic}
uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic}
uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
bool SegmentedCodeCache = true {product} {ergonomic}
bool ShowCodeDetailsInExceptionMessages = true {manageable} {command line}
size_t SoftMaxHeapSize = 8363442176 {manageable} {ergonomic}
bool UseCompressedClassPointers = true {product lp64_product} {ergonomic}
bool UseCompressedOops = true {product lp64_product} {ergonomic}
bool UseG1GC = true {product} {ergonomic}
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}
Logging:
Log output configuration:
#0: stdout all=warning uptime,level,tags foldmultilines=false
#1: stderr all=off uptime,level,tags foldmultilines=false
Environment Variables:
PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Speiger\AppData\Local\Microsoft\WindowsApps;
USERNAME=Speiger
OS=Windows_NT
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD
TMP=C:\Users\Speiger\AppData\Local\Temp
TEMP=C:\Users\Speiger\AppData\Local\Temp
--------------- S Y S T E M ---------------
OS:
Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
OS uptime: 0 days 3:11 hours
CPU: total 24 (initial active 24) (24 cores per cpu, 2 threads per core) family 25 model 97 stepping 2 microcode 0x0, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, avx512f, avx512dq, avx512cd, avx512bw, avx512vl, sha, fma, vzeroupper, avx512_vpopcntdq, avx512_vpclmulqdq, avx512_vaes, avx512_vnni, clflush, clflushopt, avx512_vbmi2, avx512_vbmi, rdtscp, rdpid, fsrm, gfni, avx512_bitalg
Memory: 4k page, system-wide physical 31894M (21103M free)
TotalPageFile size 36502M (AvailPageFile size 20303M)
current process WorkingSet (physical memory assigned to process): 66M, peak: 66M
current process commit charge ("private bytes"): 639M, peak: 639M
vm_info: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44) for windows-amd64 JRE (19.0.2+7-44), built on 2022-11-30T18:02:09Z by "mach5one" with MS VC++ 17.1 (VS2022)
END.

943
hs_err_pid9584.log Normal file
View File

@ -0,0 +1,943 @@
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8b13cc79d, pid=9584, tid=6384
#
# JRE version: Java(TM) SE Runtime Environment (19.0.2+7) (build 19.0.2+7-44)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C [lwjgl_opengl.dll+0xc79d]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- S U M M A R Y ------------
Command Line: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63110 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8 speiger.src.coreengine.Testing
Host: AMD Ryzen 9 7900 12-Core Processor , 24 cores, 31G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
Time: Mon Jun 19 04:07:01 2023 Mitteleuropäische Sommerzeit elapsed time: 0.291177 seconds (0d 0h 0m 0s)
--------------- T H R E A D ---------------
Current thread (0x000001b7f7801df0): JavaThread "main" [_thread_in_native, id=6384, stack(0x000000549c500000,0x000000549c600000)]
Stack: [0x000000549c500000,0x000000549c600000], sp=0x000000549c5ff6d8, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [lwjgl_opengl.dll+0xc79d]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.lwjgl.opengl.GL11C.nglGetBooleanv(IJ)V+0
j org.lwjgl.opengl.GL11C.glGetBoolean(I)Z+20
j org.lwjgl.opengl.GL11.glGetBoolean(I)Z+1
j speiger.src.coreengine.Testing.main([Ljava/lang/String;)V+18
v ~StubRoutines::call_stub 0x000001b7874510e8
siginfo: EXCEPTION_ACCESS_VIOLATION (0xc0000005), reading address 0x00000000000002f0
Registers:
RAX=0x000001b7a9f46800, RBX=0x000001b7a5dcdd48, RCX=0x000000000000809d, RDX=0x000001b7aa035008
RSP=0x000000549c5ff6d8, RBP=0x000000549c5ff768, RSI=0x000001b7a5afb998, RDI=0x0000000000000001
R8 =0x000000000000809d, R9 =0x000001b7aa035008, R10=0x0000000000000000, R11=0x000000062b44f290
R12=0x0000000000000000, R13=0x000001b7a5dcdd48, R14=0x000000549c5ff798, R15=0x000001b7f7801df0
RIP=0x00007ff8b13cc79d, EFLAGS=0x0000000000010206
Register to memory mapping:
RIP=0x00007ff8b13cc79d lwjgl_opengl.dll
RAX=0x000001b7a9f46800 points into unknown readable memory: 0x0000000000000000 | 00 00 00 00 00 00 00 00
RBX={method} {0x000001b7a5dcdd50} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
RCX=0x000000000000809d is an unknown value
RDX=0x000001b7aa035008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
RSP=0x000000549c5ff6d8 is pointing into the stack for thread: 0x000001b7f7801df0
RBP=0x000000549c5ff768 is pointing into the stack for thread: 0x000001b7f7801df0
RSI=0x000001b7a5afb998 is pointing into metadata
RDI=0x0000000000000001 is an unknown value
R8 =0x000000000000809d is an unknown value
R9 =0x000001b7aa035008 points into unknown readable memory: 0x006200657a690000 | 00 00 69 7a 65 00 62 00
R10=0x0 is NULL
R11=0x000000062b44f290 is an oop: java.lang.Class
{0x000000062b44f290} - klass: 'java/lang/Class'
- ---- fields (total size 116 words):
- private volatile transient 'classRedefinedCount' 'I' @12 0
- abstract internal 'klass' 'J' @16 34376626080 (101afa0 8)
- abstract internal 'array_klass' 'J' @24 0 (0 0)
- abstract internal 'oop_size' 'I' @32 116 (74)
- abstract internal 'static_oop_field_count' 'I' @36 0
- private volatile transient 'cachedConstructor' 'Ljava/lang/reflect/Constructor;' @40 NULL (0)
- private transient 'name' 'Ljava/lang/String;' @44 "org.lwjgl.opengl.GL11C"{0x000000062b44f640} (c5689ec8)
- private transient 'module' 'Ljava/lang/Module;' @48 a 'java/lang/Module'{0x000000062c86c9c8} (c590d939)
- private final 'classLoader' 'Ljava/lang/ClassLoader;' @52 a 'jdk/internal/loader/ClassLoaders$AppClassLoader'{0x000000062c86c808} (c590d901)
- private transient 'classData' 'Ljava/lang/Object;' @56 NULL (0)
- private transient 'packageName' 'Ljava/lang/String;' @60 "org.lwjgl.opengl"{0x000000062bff7af0} (c57fef5e)
- private final 'componentType' 'Ljava/lang/Class;' @64 NULL (0)
- private volatile transient 'reflectionData' 'Ljava/lang/ref/SoftReference;' @68 NULL (0)
- private volatile transient 'genericInfo' 'Lsun/reflect/generics/repository/ClassRepository;' @72 NULL (0)
- private volatile transient 'enumConstants' '[Ljava/lang/Object;' @76 NULL (0)
- private volatile transient 'enumConstantDirectory' 'Ljava/util/Map;' @80 NULL (0)
- private volatile transient 'annotationData' 'Ljava/lang/Class$AnnotationData;' @84 NULL (0)
- private volatile transient 'annotationType' 'Lsun/reflect/annotation/AnnotationType;' @88 NULL (0)
- transient 'classValueMap' 'Ljava/lang/ClassValue$ClassValueMap;' @92 NULL (0)
- abstract internal 'protection_domain' 'Ljava/lang/Object;' @96 a 'java/security/ProtectionDomain'{0x000000062b810610} (c57020c2)
- abstract internal 'signers_name' 'Ljava/lang/Object;' @100 NULL (0)
- abstract internal 'source_file' 'Ljava/lang/Object;' @104 NULL (0)
- signature: Lorg/lwjgl/opengl/GL11C;
- ---- static fields (0):
- public static final 'GL_NEVER' 'I' @112 512 (200)
- public static final 'GL_LESS' 'I' @116 513 (201)
- public static final 'GL_EQUAL' 'I' @120 514 (202)
- public static final 'GL_LEQUAL' 'I' @124 515 (203)
- public static final 'GL_GREATER' 'I' @128 516 (204)
- public static final 'GL_NOTEQUAL' 'I' @132 517 (205)
- public static final 'GL_GEQUAL' 'I' @136 518 (206)
- public static final 'GL_ALWAYS' 'I' @140 519 (207)
- public static final 'GL_DEPTH_BUFFER_BIT' 'I' @144 256 (100)
- public static final 'GL_STENCIL_BUFFER_BIT' 'I' @148 1024 (400)
- public static final 'GL_COLOR_BUFFER_BIT' 'I' @152 16384 (4000)
- public static final 'GL_POINTS' 'I' @156 0
- public static final 'GL_LINES' 'I' @160 1
- public static final 'GL_LINE_LOOP' 'I' @164 2
- public static final 'GL_LINE_STRIP' 'I' @168 3
- public static final 'GL_TRIANGLES' 'I' @172 4
- public static final 'GL_TRIANGLE_STRIP' 'I' @176 5
- public static final 'GL_TRIANGLE_FAN' 'I' @180 6
- public static final 'GL_QUADS' 'I' @184 7
- public static final 'GL_ZERO' 'I' @188 0
- public static final 'GL_ONE' 'I' @192 1
- public static final 'GL_SRC_COLOR' 'I' @196 768 (300)
- public static final 'GL_ONE_MINUS_SRC_COLOR' 'I' @200 769 (301)
- public static final 'GL_SRC_ALPHA' 'I' @204 770 (302)
- public static final 'GL_ONE_MINUS_SRC_ALPHA' 'I' @208 771 (303)
- public static final 'GL_DST_ALPHA' 'I' @212 772 (304)
- public static final 'GL_ONE_MINUS_DST_ALPHA' 'I' @216 773 (305)
- public static final 'GL_DST_COLOR' 'I' @220 774 (306)
- public static final 'GL_ONE_MINUS_DST_COLOR' 'I' @224 775 (307)
- public static final 'GL_SRC_ALPHA_SATURATE' 'I' @228 776 (308)
- public static final 'GL_TRUE' 'I' @232 1
- public static final 'GL_FALSE' 'I' @236 0
- public static final 'GL_BYTE' 'I' @240 5120 (1400)
- public static final 'GL_UNSIGNED_BYTE' 'I' @244 5121 (1401)
- public static final 'GL_SHORT' 'I' @248 5122 (1402)
- public static final 'GL_UNSIGNED_SHORT' 'I' @252 5123 (1403)
- public static final 'GL_INT' 'I' @256 5124 (1404)
- public static final 'GL_UNSIGNED_INT' 'I' @260 5125 (1405)
- public static final 'GL_FLOAT' 'I' @264 5126 (1406)
- public static final 'GL_DOUBLE' 'I' @268 5130 (140a)
- public static final 'GL_NONE' 'I' @272 0
- public static final 'GL_FRONT_LEFT' 'I' @276 1024 (400)
- public static final 'GL_FRONT_RIGHT' 'I' @280 1025 (401)
- public static final 'GL_BACK_LEFT' 'I' @284 1026 (402)
- public static final 'GL_BACK_RIGHT' 'I' @288 1027 (403)
- public static final 'GL_FRONT' 'I' @292 1028 (404)
- public static final 'GL_BACK' 'I' @296 1029 (405)
- public static final 'GL_LEFT' 'I' @300 1030 (406)
- public static final 'GL_RIGHT' 'I' @304 1031 (407)
- public static final 'GL_FRONT_AND_BACK' 'I' @308 1032 (408)
- public static final 'GL_NO_ERROR' 'I' @312 0
- public static final 'GL_INVALID_ENUM' 'I' @316 1280 (500)
- public static final 'GL_INVALID_VALUE' 'I' @320 1281 (501)
- public static final 'GL_INVALID_OPERATION' 'I' @324 1282 (502)
- public static final 'GL_STACK_OVERFLOW' 'I' @328 1283 (503)
- public static final 'GL_STACK_UNDERFLOW' 'I' @332 1284 (504)
- public static final 'GL_OUT_OF_MEMORY' 'I' @336 1285 (505)
- public static final 'GL_CW' 'I' @340 2304 (900)
- public static final 'GL_CCW' 'I' @344 2305 (901)
- public static final 'GL_POINT_SIZE' 'I' @348 2833 (b11)
- public static final 'GL_POINT_SIZE_RANGE' 'I' @352 2834 (b12)
- public static final 'GL_POINT_SIZE_GRANULARITY' 'I' @356 2835 (b13)
- public static final 'GL_LINE_SMOOTH' 'I' @360 2848 (b20)
- public static final 'GL_LINE_WIDTH' 'I' @364 2849 (b21)
- public static final 'GL_LINE_WIDTH_RANGE' 'I' @368 2850 (b22)
- public static final 'GL_LINE_WIDTH_GRANULARITY' 'I' @372 2851 (b23)
- public static final 'GL_POLYGON_MODE' 'I' @376 2880 (b40)
- public static final 'GL_POLYGON_SMOOTH' 'I' @380 2881 (b41)
- public static final 'GL_CULL_FACE' 'I' @384 2884 (b44)
- public static final 'GL_CULL_FACE_MODE' 'I' @388 2885 (b45)
- public static final 'GL_FRONT_FACE' 'I' @392 2886 (b46)
- public static final 'GL_DEPTH_RANGE' 'I' @396 2928 (b70)
- public static final 'GL_DEPTH_TEST' 'I' @400 2929 (b71)
- public static final 'GL_DEPTH_WRITEMASK' 'I' @404 2930 (b72)
- public static final 'GL_DEPTH_CLEAR_VALUE' 'I' @408 2931 (b73)
- public static final 'GL_DEPTH_FUNC' 'I' @412 2932 (b74)
- public static final 'GL_STENCIL_TEST' 'I' @416 2960 (b90)
- public static final 'GL_STENCIL_CLEAR_VALUE' 'I' @420 2961 (b91)
- public static final 'GL_STENCIL_FUNC' 'I' @424 2962 (b92)
- public static final 'GL_STENCIL_VALUE_MASK' 'I' @428 2963 (b93)
- public static final 'GL_STENCIL_FAIL' 'I' @432 2964 (b94)
- public static final 'GL_STENCIL_PASS_DEPTH_FAIL' 'I' @436 2965 (b95)
- public static final 'GL_STENCIL_PASS_DEPTH_PASS' 'I' @440 2966 (b96)
- public static final 'GL_STENCIL_REF' 'I' @444 2967 (b97)
- public static final 'GL_STENCIL_WRITEMASK' 'I' @448 2968 (b98)
- public static final 'GL_VIEWPORT' 'I' @452 2978 (ba2)
- public static final 'GL_DITHER' 'I' @456 3024 (bd0)
- public static final 'GL_BLEND_DST' 'I' @460 3040 (be0)
- public static final 'GL_BLEND_SRC' 'I' @464 3041 (be1)
- public static final 'GL_BLEND' 'I' @468 3042 (be2)
- public static final 'GL_LOGIC_OP_MODE' 'I' @472 3056 (bf0)
- public static final 'GL_COLOR_LOGIC_OP' 'I' @476 3058 (bf2)
- public static final 'GL_DRAW_BUFFER' 'I' @480 3073 (c01)
- public static final 'GL_READ_BUFFER' 'I' @484 3074 (c02)
- public static final 'GL_SCISSOR_BOX' 'I' @488 3088 (c10)
- public static final 'GL_SCISSOR_TEST' 'I' @492 3089 (c11)
- public static final 'GL_COLOR_CLEAR_VALUE' 'I' @496 3106 (c22)
- public static final 'GL_COLOR_WRITEMASK' 'I' @500 3107 (c23)
- public static final 'GL_DOUBLEBUFFER' 'I' @504 3122 (c32)
- public static final 'GL_STEREO' 'I' @508 3123 (c33)
- public static final 'GL_LINE_SMOOTH_HINT' 'I' @512 3154 (c52)
- public static final 'GL_POLYGON_SMOOTH_HINT' 'I' @516 3155 (c53)
- public static final 'GL_UNPACK_SWAP_BYTES' 'I' @520 3312 (cf0)
- public static final 'GL_UNPACK_LSB_FIRST' 'I' @524 3313 (cf1)
- public static final 'GL_UNPACK_ROW_LENGTH' 'I' @528 3314 (cf2)
- public static final 'GL_UNPACK_SKIP_ROWS' 'I' @532 3315 (cf3)
- public static final 'GL_UNPACK_SKIP_PIXELS' 'I' @536 3316 (cf4)
- public static final 'GL_UNPACK_ALIGNMENT' 'I' @540 3317 (cf5)
- public static final 'GL_PACK_SWAP_BYTES' 'I' @544 3328 (d00)
- public static final 'GL_PACK_LSB_FIRST' 'I' @548 3329 (d01)
- public static final 'GL_PACK_ROW_LENGTH' 'I' @552 3330 (d02)
- public static final 'GL_PACK_SKIP_ROWS' 'I' @556 3331 (d03)
- public static final 'GL_PACK_SKIP_PIXELS' 'I' @560 3332 (d04)
- public static final 'GL_PACK_ALIGNMENT' 'I' @564 3333 (d05)
- public static final 'GL_MAX_TEXTURE_SIZE' 'I' @568 3379 (d33)
- public static final 'GL_MAX_VIEWPORT_DIMS' 'I' @572 3386 (d3a)
- public static final 'GL_SUBPIXEL_BITS' 'I' @576 3408 (d50)
- public static final 'GL_TEXTURE_1D' 'I' @580 3552 (de0)
- public static final 'GL_TEXTURE_2D' 'I' @584 3553 (de1)
- public static final 'GL_TEXTURE_WIDTH' 'I' @588 4096 (1000)
- public static final 'GL_TEXTURE_HEIGHT' 'I' @592 4097 (1001)
- public static final 'GL_TEXTURE_INTERNAL_FORMAT' 'I' @596 4099 (1003)
- public static final 'GL_TEXTURE_BORDER_COLOR' 'I' @600 4100 (1004)
- public static final 'GL_DONT_CARE' 'I' @604 4352 (1100)
- public static final 'GL_FASTEST' 'I' @608 4353 (1101)
- public static final 'GL_NICEST' 'I' @612 4354 (1102)
- public static final 'GL_CLEAR' 'I' @616 5376 (1500)
- public static final 'GL_AND' 'I' @620 5377 (1501)
- public static final 'GL_AND_REVERSE' 'I' @624 5378 (1502)
- public static final 'GL_COPY' 'I' @628 5379 (1503)
- public static final 'GL_AND_INVERTED' 'I' @632 5380 (1504)
- public static final 'GL_NOOP' 'I' @636 5381 (1505)
- public static final 'GL_XOR' 'I' @640 5382 (1506)
- public static final 'GL_OR' 'I' @644 5383 (1507)
- public static final 'GL_NOR' 'I' @648 5384 (1508)
- public static final 'GL_EQUIV' 'I' @652 5385 (1509)
- public static final 'GL_INVERT' 'I' @656 5386 (150a)
- public static final 'GL_OR_REVERSE' 'I' @660 5387 (150b)
- public static final 'GL_COPY_INVERTED' 'I' @664 5388 (150c)
- public static final 'GL_OR_INVERTED' 'I' @668 5389 (150d)
- public static final 'GL_NAND' 'I' @672 5390 (150e)
- public static final 'GL_SET' 'I' @676 5391 (150f)
- public static final 'GL_TEXTURE' 'I' @680 5890 (1702)
- public static final 'GL_COLOR' 'I' @684 6144 (1800)
- public static final 'GL_DEPTH' 'I' @688 6145 (1801)
- public static final 'GL_STENCIL' 'I' @692 6146 (1802)
- public static final 'GL_STENCIL_INDEX' 'I' @696 6401 (1901)
- public static final 'GL_DEPTH_COMPONENT' 'I' @700 6402 (1902)
- public static final 'GL_RED' 'I' @704 6403 (1903)
- public static final 'GL_GREEN' 'I' @708 6404 (1904)
- public static final 'GL_BLUE' 'I' @712 6405 (1905)
- public static final 'GL_ALPHA' 'I' @716 6406 (1906)
- public static final 'GL_RGB' 'I' @720 6407 (1907)
- public static final 'GL_RGBA' 'I' @724 6408 (1908)
- public static final 'GL_POINT' 'I' @728 6912 (1b00)
- public static final 'GL_LINE' 'I' @732 6913 (1b01)
- public static final 'GL_FILL' 'I' @736 6914 (1b02)
- public static final 'GL_KEEP' 'I' @740 7680 (1e00)
- public static final 'GL_REPLACE' 'I' @744 7681 (1e01)
- public static final 'GL_INCR' 'I' @748 7682 (1e02)
- public static final 'GL_DECR' 'I' @752 7683 (1e03)
- public static final 'GL_VENDOR' 'I' @756 7936 (1f00)
- public static final 'GL_RENDERER' 'I' @760 7937 (1f01)
- public static final 'GL_VERSION' 'I' @764 7938 (1f02)
- public static final 'GL_EXTENSIONS' 'I' @768 7939 (1f03)
- public static final 'GL_NEAREST' 'I' @772 9728 (2600)
- public static final 'GL_LINEAR' 'I' @776 9729 (2601)
- public static final 'GL_NEAREST_MIPMAP_NEAREST' 'I' @780 9984 (2700)
- public static final 'GL_LINEAR_MIPMAP_NEAREST' 'I' @784 9985 (2701)
- public static final 'GL_NEAREST_MIPMAP_LINEAR' 'I' @788 9986 (2702)
- public static final 'GL_LINEAR_MIPMAP_LINEAR' 'I' @792 9987 (2703)
- public static final 'GL_TEXTURE_MAG_FILTER' 'I' @796 10240 (2800)
- public static final 'GL_TEXTURE_MIN_FILTER' 'I' @800 10241 (2801)
- public static final 'GL_TEXTURE_WRAP_S' 'I' @804 10242 (2802)
- public static final 'GL_TEXTURE_WRAP_T' 'I' @808 10243 (2803)
- public static final 'GL_REPEAT' 'I' @812 10497 (2901)
- public static final 'GL_POLYGON_OFFSET_FACTOR' 'I' @816 32824 (8038)
- public static final 'GL_POLYGON_OFFSET_UNITS' 'I' @820 10752 (2a00)
- public static final 'GL_POLYGON_OFFSET_POINT' 'I' @824 10753 (2a01)
- public static final 'GL_POLYGON_OFFSET_LINE' 'I' @828 10754 (2a02)
- public static final 'GL_POLYGON_OFFSET_FILL' 'I' @832 32823 (8037)
- public static final 'GL_R3_G3_B2' 'I' @836 10768 (2a10)
- public static final 'GL_RGB4' 'I' @840 32847 (804f)
- public static final 'GL_RGB5' 'I' @844 32848 (8050)
- public static final 'GL_RGB8' 'I' @848 32849 (8051)
- public static final 'GL_RGB10' 'I' @852 32850 (8052)
- public static final 'GL_RGB12' 'I' @856 32851 (8053)
- public static final 'GL_RGB16' 'I' @860 32852 (8054)
- public static final 'GL_RGBA2' 'I' @864 32853 (8055)
- public static final 'GL_RGBA4' 'I' @868 32854 (8056)
- public static final 'GL_RGB5_A1' 'I' @872 32855 (8057)
- public static final 'GL_RGBA8' 'I' @876 32856 (8058)
- public static final 'GL_RGB10_A2' 'I' @880 32857 (8059)
- public static final 'GL_RGBA12' 'I' @884 32858 (805a)
- public static final 'GL_RGBA16' 'I' @888 32859 (805b)
- public static final 'GL_TEXTURE_RED_SIZE' 'I' @892 32860 (805c)
- public static final 'GL_TEXTURE_GREEN_SIZE' 'I' @896 32861 (805d)
- public static final 'GL_TEXTURE_BLUE_SIZE' 'I' @900 32862 (805e)
- public static final 'GL_TEXTURE_ALPHA_SIZE' 'I' @904 32863 (805f)
- public static final 'GL_PROXY_TEXTURE_1D' 'I' @908 32867 (8063)
- public static final 'GL_PROXY_TEXTURE_2D' 'I' @912 32868 (8064)
- public static final 'GL_TEXTURE_BINDING_1D' 'I' @916 32872 (8068)
- public static final 'GL_TEXTURE_BINDING_2D' 'I' @920 32873 (8069)
- public static final 'GL_VERTEX_ARRAY' 'I' @924 32884 (8074)
R12=0x0 is NULL
R13={method} {0x000001b7a5dcdd50} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
R14=0x000000549c5ff798 is pointing into the stack for thread: 0x000001b7f7801df0
R15=0x000001b7f7801df0 is a thread
Top of Stack: (sp=0x000000549c5ff6d8)
0x000000549c5ff6d8: 000001b787473478 0000000000000001
0x000000549c5ff6e8: 000001b787472dba 000001b7a5dcdd48
0x000000549c5ff6f8: 000001b7a5afb998 0000000000000000
0x000000549c5ff708: 000000549c5ff720 000000549c5ff780
0x000000549c5ff718: 000001b787472d76 000000549c5ff720
0x000000549c5ff728: 000001b7a5dcdd48 000000549c5ff798
0x000000549c5ff738: 000001b7a5dd8000 0000000000000000
0x000000549c5ff748: 000000062b44f290 000001b7a5dcdd48
0x000000549c5ff758: 0000000000000000 000000549c5ff788
0x000000549c5ff768: 000000549c5ff7e8 000001b78746c11a
0x000000549c5ff778: 000000062b44f290 000001b78746f557
0x000000549c5ff788: 000001b7aa035008 0000000000000000
0x000000549c5ff798: 000000000000809d 000000549c5ff7a0
0x000000549c5ff7a8: 000001b7a5dcdefc 000000549c5ff820
0x000000549c5ff7b8: 000001b7a5dd8000 0000000000000000
0x000000549c5ff7c8: 000000062b44f290 000001b7a5dcdf88
Instructions: (pc=0x00007ff8b13cc79d)
0x00007ff8b13cc69d: cc cc cc 48 8b 01 45 8b d8 44 8b 44 24 28 41 8b
0x00007ff8b13cc6ad: d1 41 8b cb 4c 8b 50 18 49 ff a2 e8 01 00 00 cc
0x00007ff8b13cc6bd: cc cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
0x00007ff8b13cc6cd: f0 01 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc6dd: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
0x00007ff8b13cc6ed: 41 8b d1 4c 8b 4c 24 38 8b cb 4c 8b 50 18 5b 49
0x00007ff8b13cc6fd: ff a2 f8 01 00 00 cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc70d: cc cc cc 48 8b 01 48 8b 48 18 48 ff a1 98 02 00
0x00007ff8b13cc71d: 00 cc cc 48 8b 01 48 8b 48 18 48 ff a1 a0 02 00
0x00007ff8b13cc72d: 00 cc cc 48 8b 01 41 8b c8 48 8b 50 18 48 ff a2
0x00007ff8b13cc73d: c8 02 00 00 cc cc cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc74d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc75d: 49 ff a2 d8 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc76d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc77d: 49 ff a2 e0 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc78d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc79d: 49 ff a2 f0 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc7ad: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc7bd: 49 ff a2 f8 02 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc7cd: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc7dd: 49 ff a2 00 03 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc7ed: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc7fd: 49 ff a2 08 03 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc80d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 10 03 00
0x00007ff8b13cc81d: 00 48 ff e0 cc cc cc cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc82d: cc cc cc 48 8b 01 49 8b d1 41 8b c8 4c 8b 50 18
0x00007ff8b13cc83d: 49 ff a2 68 03 00 00 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc84d: cc cc cc 48 8b 01 48 8b 48 18 48 8b 81 78 03 00
0x00007ff8b13cc85d: 00 41 8b c8 48 ff e0 cc cc cc cc cc cc cc cc cc
0x00007ff8b13cc86d: cc cc cc 40 53 48 8b 01 41 8b d8 44 8b 44 24 30
0x00007ff8b13cc87d: 41 8b d1 44 8b 4c 24 38 8b cb 4c 8b 50 18 48 8b
0x00007ff8b13cc88d: 44 24 40 48 89 44 24 30 5b 49 ff a2 a8 03 00 00
Stack slot to memory mapping:
stack at sp + 0 slots: 0x000001b787473478 is at code_begin+1976 in an Interpreter codelet
method entry point (kind = native) [0x000001b787472cc0, 0x000001b787474000] 4928 bytes
stack at sp + 1 slots: 0x0000000000000001 is an unknown value
stack at sp + 2 slots: 0x000001b787472dba is at code_begin+250 in an Interpreter codelet
method entry point (kind = native) [0x000001b787472cc0, 0x000001b787474000] 4928 bytes
stack at sp + 3 slots: {method} {0x000001b7a5dcdd50} 'nglGetBooleanv' '(IJ)V' in 'org/lwjgl/opengl/GL11C'
stack at sp + 4 slots: 0x000001b7a5afb998 is pointing into metadata
stack at sp + 5 slots: 0x0 is NULL
stack at sp + 6 slots: 0x000000549c5ff720 is pointing into the stack for thread: 0x000001b7f7801df0
stack at sp + 7 slots: 0x000000549c5ff780 is pointing into the stack for thread: 0x000001b7f7801df0
--------------- P R O C E S S ---------------
Threads class SMR info:
_java_thread_list=0x000001b7a55cc070, length=19, elements={
0x000001b7f7801df0, 0x000001b7a4262ce0, 0x000001b7a4264270, 0x000001b7a4266200,
0x000001b7a42684e0, 0x000001b7a426cfb0, 0x000001b7a426c5d0, 0x000001b7a4272110,
0x000001b7a427eae0, 0x000001b7a4289060, 0x000001b7a55067f0, 0x000001b7a5507e80,
0x000001b7a550c420, 0x000001b7a5525550, 0x000001b7a55c40c0, 0x000001b7a55ba2c0,
0x000001b7a55ba810, 0x000001b7a9cb7650, 0x000001b7a9d4f890
}
Java Threads: ( => current thread )
=>0x000001b7f7801df0 JavaThread "main" [_thread_in_native, id=6384, stack(0x000000549c500000,0x000000549c600000)]
0x000001b7a4262ce0 JavaThread "Reference Handler" daemon [_thread_blocked, id=17712, stack(0x000000549cc00000,0x000000549cd00000)]
0x000001b7a4264270 JavaThread "Finalizer" daemon [_thread_blocked, id=13484, stack(0x000000549cd00000,0x000000549ce00000)]
0x000001b7a4266200 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13520, stack(0x000000549ce00000,0x000000549cf00000)]
0x000001b7a42684e0 JavaThread "Attach Listener" daemon [_thread_blocked, id=4268, stack(0x000000549cf00000,0x000000549d000000)]
0x000001b7a426cfb0 JavaThread "Service Thread" daemon [_thread_blocked, id=9864, stack(0x000000549d000000,0x000000549d100000)]
0x000001b7a426c5d0 JavaThread "Monitor Deflation Thread" daemon [_thread_blocked, id=12076, stack(0x000000549d100000,0x000000549d200000)]
0x000001b7a4272110 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=8124, stack(0x000000549d200000,0x000000549d300000)]
0x000001b7a427eae0 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=11212, stack(0x000000549d300000,0x000000549d400000)]
0x000001b7a4289060 JavaThread "Sweeper thread" daemon [_thread_blocked, id=7964, stack(0x000000549d400000,0x000000549d500000)]
0x000001b7a55067f0 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=3064, stack(0x000000549d500000,0x000000549d600000)]
0x000001b7a5507e80 JavaThread "C1 CompilerThread1" daemon [_thread_blocked, id=1292, stack(0x000000549d600000,0x000000549d700000)]
0x000001b7a550c420 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=12712, stack(0x000000549d700000,0x000000549d800000)]
0x000001b7a5525550 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=4864, stack(0x000000549d800000,0x000000549d900000)]
0x000001b7a55c40c0 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=8996, stack(0x000000549d900000,0x000000549da00000)]
0x000001b7a55ba2c0 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=20132, stack(0x000000549da00000,0x000000549db00000)]
0x000001b7a55ba810 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=8152, stack(0x000000549db00000,0x000000549dc00000)]
0x000001b7a9cb7650 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=13052, stack(0x000000549dc00000,0x000000549dd00000)]
0x000001b7a9d4f890 JavaThread "Notification Thread" daemon [_thread_blocked, id=12976, stack(0x000000549dd00000,0x000000549de00000)]
Other Threads:
0x000001b7f7825aa0 VMThread "VM Thread" [stack: 0x000000549cb00000,0x000000549cc00000] [id=1132]
0x000001b7a9e14d40 WatcherThread "VM Periodic Task Thread" [stack: 0x000000549de00000,0x000000549df00000] [id=5172]
0x000001b7f7825500 WorkerThread "GC Thread#0" [stack: 0x000000549c600000,0x000000549c700000] [id=9320]
0x000001b7f78c5ce0 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000549c700000,0x000000549c800000] [id=18060]
0x000001b7f7825230 WorkerThread "G1 Conc#0" [stack: 0x000000549c800000,0x000000549c900000] [id=13100]
0x000001b7a41838f0 ConcurrentGCThread "G1 Refine#0" [stack: 0x000000549c900000,0x000000549ca00000] [id=3660]
0x000001b7a4184340 ConcurrentGCThread "G1 Service" [stack: 0x000000549ca00000,0x000000549cb00000] [id=3504]
Threads with active compile tasks:
VM state: not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap address: 0x000000060d800000, size: 7976 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
CDS archive(s) mapped at: [0x0000000800000000-0x0000000800c40000-0x0000000800c40000), size 12845056, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 0.
Compressed class space mapped at: 0x0000000801000000-0x0000000841000000, reserved size: 1073741824
Narrow klass base: 0x0000000800000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
GC Precious Log:
CardTable entry size: 512
Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 32 size 80 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192
CPUs: 24 total, 24 available
Memory: 31894M
Large Page Support: Disabled
NUMA Support: Disabled
Compressed Oops: Enabled (Zero based)
Heap Region Size: 4M
Heap Min Capacity: 8M
Heap Initial Capacity: 500M
Heap Max Capacity: 7976M
Pre-touch: Disabled
Parallel Workers: 18
Concurrent Workers: 5
Concurrent Refinement Workers: 18
Periodic GC: Disabled
Heap:
garbage-first heap total 512000K, used 20480K [0x000000060d800000, 0x0000000800000000)
region size 4096K, 6 young (24576K), 0 survivors (0K)
Metaspace used 5386K, committed 5568K, reserved 1114112K
class space used 375K, committed 448K, reserved 1048576K
Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, OA=open archive, CA=closed archive, TAMS=top-at-mark-start (previous, next)
| 0|0x000000060d800000, 0x000000060d800000, 0x000000060dc00000| 0%| F| |TAMS 0x000000060d800000, 0x000000060d800000| Untracked
| 1|0x000000060dc00000, 0x000000060dc00000, 0x000000060e000000| 0%| F| |TAMS 0x000000060dc00000, 0x000000060dc00000| Untracked
| 2|0x000000060e000000, 0x000000060e000000, 0x000000060e400000| 0%| F| |TAMS 0x000000060e000000, 0x000000060e000000| Untracked
| 3|0x000000060e400000, 0x000000060e400000, 0x000000060e800000| 0%| F| |TAMS 0x000000060e400000, 0x000000060e400000| Untracked
| 4|0x000000060e800000, 0x000000060e800000, 0x000000060ec00000| 0%| F| |TAMS 0x000000060e800000, 0x000000060e800000| Untracked
| 5|0x000000060ec00000, 0x000000060ec00000, 0x000000060f000000| 0%| F| |TAMS 0x000000060ec00000, 0x000000060ec00000| Untracked
| 6|0x000000060f000000, 0x000000060f000000, 0x000000060f400000| 0%| F| |TAMS 0x000000060f000000, 0x000000060f000000| Untracked
| 7|0x000000060f400000, 0x000000060f400000, 0x000000060f800000| 0%| F| |TAMS 0x000000060f400000, 0x000000060f400000| Untracked
| 8|0x000000060f800000, 0x000000060f800000, 0x000000060fc00000| 0%| F| |TAMS 0x000000060f800000, 0x000000060f800000| Untracked
| 9|0x000000060fc00000, 0x000000060fc00000, 0x0000000610000000| 0%| F| |TAMS 0x000000060fc00000, 0x000000060fc00000| Untracked
| 10|0x0000000610000000, 0x0000000610000000, 0x0000000610400000| 0%| F| |TAMS 0x0000000610000000, 0x0000000610000000| Untracked
| 11|0x0000000610400000, 0x0000000610400000, 0x0000000610800000| 0%| F| |TAMS 0x0000000610400000, 0x0000000610400000| Untracked
| 12|0x0000000610800000, 0x0000000610800000, 0x0000000610c00000| 0%| F| |TAMS 0x0000000610800000, 0x0000000610800000| Untracked
| 13|0x0000000610c00000, 0x0000000610c00000, 0x0000000611000000| 0%| F| |TAMS 0x0000000610c00000, 0x0000000610c00000| Untracked
| 14|0x0000000611000000, 0x0000000611000000, 0x0000000611400000| 0%| F| |TAMS 0x0000000611000000, 0x0000000611000000| Untracked
| 15|0x0000000611400000, 0x0000000611400000, 0x0000000611800000| 0%| F| |TAMS 0x0000000611400000, 0x0000000611400000| Untracked
| 16|0x0000000611800000, 0x0000000611800000, 0x0000000611c00000| 0%| F| |TAMS 0x0000000611800000, 0x0000000611800000| Untracked
| 17|0x0000000611c00000, 0x0000000611c00000, 0x0000000612000000| 0%| F| |TAMS 0x0000000611c00000, 0x0000000611c00000| Untracked
| 18|0x0000000612000000, 0x0000000612000000, 0x0000000612400000| 0%| F| |TAMS 0x0000000612000000, 0x0000000612000000| Untracked
| 19|0x0000000612400000, 0x0000000612400000, 0x0000000612800000| 0%| F| |TAMS 0x0000000612400000, 0x0000000612400000| Untracked
| 20|0x0000000612800000, 0x0000000612800000, 0x0000000612c00000| 0%| F| |TAMS 0x0000000612800000, 0x0000000612800000| Untracked
| 21|0x0000000612c00000, 0x0000000612c00000, 0x0000000613000000| 0%| F| |TAMS 0x0000000612c00000, 0x0000000612c00000| Untracked
| 22|0x0000000613000000, 0x0000000613000000, 0x0000000613400000| 0%| F| |TAMS 0x0000000613000000, 0x0000000613000000| Untracked
| 23|0x0000000613400000, 0x0000000613400000, 0x0000000613800000| 0%| F| |TAMS 0x0000000613400000, 0x0000000613400000| Untracked
| 24|0x0000000613800000, 0x0000000613800000, 0x0000000613c00000| 0%| F| |TAMS 0x0000000613800000, 0x0000000613800000| Untracked
| 25|0x0000000613c00000, 0x0000000613c00000, 0x0000000614000000| 0%| F| |TAMS 0x0000000613c00000, 0x0000000613c00000| Untracked
| 26|0x0000000614000000, 0x0000000614000000, 0x0000000614400000| 0%| F| |TAMS 0x0000000614000000, 0x0000000614000000| Untracked
| 27|0x0000000614400000, 0x0000000614400000, 0x0000000614800000| 0%| F| |TAMS 0x0000000614400000, 0x0000000614400000| Untracked
| 28|0x0000000614800000, 0x0000000614800000, 0x0000000614c00000| 0%| F| |TAMS 0x0000000614800000, 0x0000000614800000| Untracked
| 29|0x0000000614c00000, 0x0000000614c00000, 0x0000000615000000| 0%| F| |TAMS 0x0000000614c00000, 0x0000000614c00000| Untracked
| 30|0x0000000615000000, 0x0000000615000000, 0x0000000615400000| 0%| F| |TAMS 0x0000000615000000, 0x0000000615000000| Untracked
| 31|0x0000000615400000, 0x0000000615400000, 0x0000000615800000| 0%| F| |TAMS 0x0000000615400000, 0x0000000615400000| Untracked
| 32|0x0000000615800000, 0x0000000615800000, 0x0000000615c00000| 0%| F| |TAMS 0x0000000615800000, 0x0000000615800000| Untracked
| 33|0x0000000615c00000, 0x0000000615c00000, 0x0000000616000000| 0%| F| |TAMS 0x0000000615c00000, 0x0000000615c00000| Untracked
| 34|0x0000000616000000, 0x0000000616000000, 0x0000000616400000| 0%| F| |TAMS 0x0000000616000000, 0x0000000616000000| Untracked
| 35|0x0000000616400000, 0x0000000616400000, 0x0000000616800000| 0%| F| |TAMS 0x0000000616400000, 0x0000000616400000| Untracked
| 36|0x0000000616800000, 0x0000000616800000, 0x0000000616c00000| 0%| F| |TAMS 0x0000000616800000, 0x0000000616800000| Untracked
| 37|0x0000000616c00000, 0x0000000616c00000, 0x0000000617000000| 0%| F| |TAMS 0x0000000616c00000, 0x0000000616c00000| Untracked
| 38|0x0000000617000000, 0x0000000617000000, 0x0000000617400000| 0%| F| |TAMS 0x0000000617000000, 0x0000000617000000| Untracked
| 39|0x0000000617400000, 0x0000000617400000, 0x0000000617800000| 0%| F| |TAMS 0x0000000617400000, 0x0000000617400000| Untracked
| 40|0x0000000617800000, 0x0000000617800000, 0x0000000617c00000| 0%| F| |TAMS 0x0000000617800000, 0x0000000617800000| Untracked
| 41|0x0000000617c00000, 0x0000000617c00000, 0x0000000618000000| 0%| F| |TAMS 0x0000000617c00000, 0x0000000617c00000| Untracked
| 42|0x0000000618000000, 0x0000000618000000, 0x0000000618400000| 0%| F| |TAMS 0x0000000618000000, 0x0000000618000000| Untracked
| 43|0x0000000618400000, 0x0000000618400000, 0x0000000618800000| 0%| F| |TAMS 0x0000000618400000, 0x0000000618400000| Untracked
| 44|0x0000000618800000, 0x0000000618800000, 0x0000000618c00000| 0%| F| |TAMS 0x0000000618800000, 0x0000000618800000| Untracked
| 45|0x0000000618c00000, 0x0000000618c00000, 0x0000000619000000| 0%| F| |TAMS 0x0000000618c00000, 0x0000000618c00000| Untracked
| 46|0x0000000619000000, 0x0000000619000000, 0x0000000619400000| 0%| F| |TAMS 0x0000000619000000, 0x0000000619000000| Untracked
| 47|0x0000000619400000, 0x0000000619400000, 0x0000000619800000| 0%| F| |TAMS 0x0000000619400000, 0x0000000619400000| Untracked
| 48|0x0000000619800000, 0x0000000619800000, 0x0000000619c00000| 0%| F| |TAMS 0x0000000619800000, 0x0000000619800000| Untracked
| 49|0x0000000619c00000, 0x0000000619c00000, 0x000000061a000000| 0%| F| |TAMS 0x0000000619c00000, 0x0000000619c00000| Untracked
| 50|0x000000061a000000, 0x000000061a000000, 0x000000061a400000| 0%| F| |TAMS 0x000000061a000000, 0x000000061a000000| Untracked
| 51|0x000000061a400000, 0x000000061a400000, 0x000000061a800000| 0%| F| |TAMS 0x000000061a400000, 0x000000061a400000| Untracked
| 52|0x000000061a800000, 0x000000061a800000, 0x000000061ac00000| 0%| F| |TAMS 0x000000061a800000, 0x000000061a800000| Untracked
| 53|0x000000061ac00000, 0x000000061ac00000, 0x000000061b000000| 0%| F| |TAMS 0x000000061ac00000, 0x000000061ac00000| Untracked
| 54|0x000000061b000000, 0x000000061b000000, 0x000000061b400000| 0%| F| |TAMS 0x000000061b000000, 0x000000061b000000| Untracked
| 55|0x000000061b400000, 0x000000061b400000, 0x000000061b800000| 0%| F| |TAMS 0x000000061b400000, 0x000000061b400000| Untracked
| 56|0x000000061b800000, 0x000000061b800000, 0x000000061bc00000| 0%| F| |TAMS 0x000000061b800000, 0x000000061b800000| Untracked
| 57|0x000000061bc00000, 0x000000061bc00000, 0x000000061c000000| 0%| F| |TAMS 0x000000061bc00000, 0x000000061bc00000| Untracked
| 58|0x000000061c000000, 0x000000061c000000, 0x000000061c400000| 0%| F| |TAMS 0x000000061c000000, 0x000000061c000000| Untracked
| 59|0x000000061c400000, 0x000000061c400000, 0x000000061c800000| 0%| F| |TAMS 0x000000061c400000, 0x000000061c400000| Untracked
| 60|0x000000061c800000, 0x000000061c800000, 0x000000061cc00000| 0%| F| |TAMS 0x000000061c800000, 0x000000061c800000| Untracked
| 61|0x000000061cc00000, 0x000000061cc00000, 0x000000061d000000| 0%| F| |TAMS 0x000000061cc00000, 0x000000061cc00000| Untracked
| 62|0x000000061d000000, 0x000000061d000000, 0x000000061d400000| 0%| F| |TAMS 0x000000061d000000, 0x000000061d000000| Untracked
| 63|0x000000061d400000, 0x000000061d400000, 0x000000061d800000| 0%| F| |TAMS 0x000000061d400000, 0x000000061d400000| Untracked
| 64|0x000000061d800000, 0x000000061d800000, 0x000000061dc00000| 0%| F| |TAMS 0x000000061d800000, 0x000000061d800000| Untracked
| 65|0x000000061dc00000, 0x000000061dc00000, 0x000000061e000000| 0%| F| |TAMS 0x000000061dc00000, 0x000000061dc00000| Untracked
| 66|0x000000061e000000, 0x000000061e000000, 0x000000061e400000| 0%| F| |TAMS 0x000000061e000000, 0x000000061e000000| Untracked
| 67|0x000000061e400000, 0x000000061e400000, 0x000000061e800000| 0%| F| |TAMS 0x000000061e400000, 0x000000061e400000| Untracked
| 68|0x000000061e800000, 0x000000061e800000, 0x000000061ec00000| 0%| F| |TAMS 0x000000061e800000, 0x000000061e800000| Untracked
| 69|0x000000061ec00000, 0x000000061ec00000, 0x000000061f000000| 0%| F| |TAMS 0x000000061ec00000, 0x000000061ec00000| Untracked
| 70|0x000000061f000000, 0x000000061f000000, 0x000000061f400000| 0%| F| |TAMS 0x000000061f000000, 0x000000061f000000| Untracked
| 71|0x000000061f400000, 0x000000061f400000, 0x000000061f800000| 0%| F| |TAMS 0x000000061f400000, 0x000000061f400000| Untracked
| 72|0x000000061f800000, 0x000000061f800000, 0x000000061fc00000| 0%| F| |TAMS 0x000000061f800000, 0x000000061f800000| Untracked
| 73|0x000000061fc00000, 0x000000061fc00000, 0x0000000620000000| 0%| F| |TAMS 0x000000061fc00000, 0x000000061fc00000| Untracked
| 74|0x0000000620000000, 0x0000000620000000, 0x0000000620400000| 0%| F| |TAMS 0x0000000620000000, 0x0000000620000000| Untracked
| 75|0x0000000620400000, 0x0000000620400000, 0x0000000620800000| 0%| F| |TAMS 0x0000000620400000, 0x0000000620400000| Untracked
| 76|0x0000000620800000, 0x0000000620800000, 0x0000000620c00000| 0%| F| |TAMS 0x0000000620800000, 0x0000000620800000| Untracked
| 77|0x0000000620c00000, 0x0000000620c00000, 0x0000000621000000| 0%| F| |TAMS 0x0000000620c00000, 0x0000000620c00000| Untracked
| 78|0x0000000621000000, 0x0000000621000000, 0x0000000621400000| 0%| F| |TAMS 0x0000000621000000, 0x0000000621000000| Untracked
| 79|0x0000000621400000, 0x0000000621400000, 0x0000000621800000| 0%| F| |TAMS 0x0000000621400000, 0x0000000621400000| Untracked
| 80|0x0000000621800000, 0x0000000621800000, 0x0000000621c00000| 0%| F| |TAMS 0x0000000621800000, 0x0000000621800000| Untracked
| 81|0x0000000621c00000, 0x0000000621c00000, 0x0000000622000000| 0%| F| |TAMS 0x0000000621c00000, 0x0000000621c00000| Untracked
| 82|0x0000000622000000, 0x0000000622000000, 0x0000000622400000| 0%| F| |TAMS 0x0000000622000000, 0x0000000622000000| Untracked
| 83|0x0000000622400000, 0x0000000622400000, 0x0000000622800000| 0%| F| |TAMS 0x0000000622400000, 0x0000000622400000| Untracked
| 84|0x0000000622800000, 0x0000000622800000, 0x0000000622c00000| 0%| F| |TAMS 0x0000000622800000, 0x0000000622800000| Untracked
| 85|0x0000000622c00000, 0x0000000622c00000, 0x0000000623000000| 0%| F| |TAMS 0x0000000622c00000, 0x0000000622c00000| Untracked
| 86|0x0000000623000000, 0x0000000623000000, 0x0000000623400000| 0%| F| |TAMS 0x0000000623000000, 0x0000000623000000| Untracked
| 87|0x0000000623400000, 0x0000000623400000, 0x0000000623800000| 0%| F| |TAMS 0x0000000623400000, 0x0000000623400000| Untracked
| 88|0x0000000623800000, 0x0000000623800000, 0x0000000623c00000| 0%| F| |TAMS 0x0000000623800000, 0x0000000623800000| Untracked
| 89|0x0000000623c00000, 0x0000000623c00000, 0x0000000624000000| 0%| F| |TAMS 0x0000000623c00000, 0x0000000623c00000| Untracked
| 90|0x0000000624000000, 0x0000000624000000, 0x0000000624400000| 0%| F| |TAMS 0x0000000624000000, 0x0000000624000000| Untracked
| 91|0x0000000624400000, 0x0000000624400000, 0x0000000624800000| 0%| F| |TAMS 0x0000000624400000, 0x0000000624400000| Untracked
| 92|0x0000000624800000, 0x0000000624800000, 0x0000000624c00000| 0%| F| |TAMS 0x0000000624800000, 0x0000000624800000| Untracked
| 93|0x0000000624c00000, 0x0000000624c00000, 0x0000000625000000| 0%| F| |TAMS 0x0000000624c00000, 0x0000000624c00000| Untracked
| 94|0x0000000625000000, 0x0000000625000000, 0x0000000625400000| 0%| F| |TAMS 0x0000000625000000, 0x0000000625000000| Untracked
| 95|0x0000000625400000, 0x0000000625400000, 0x0000000625800000| 0%| F| |TAMS 0x0000000625400000, 0x0000000625400000| Untracked
| 96|0x0000000625800000, 0x0000000625800000, 0x0000000625c00000| 0%| F| |TAMS 0x0000000625800000, 0x0000000625800000| Untracked
| 97|0x0000000625c00000, 0x0000000625c00000, 0x0000000626000000| 0%| F| |TAMS 0x0000000625c00000, 0x0000000625c00000| Untracked
| 98|0x0000000626000000, 0x0000000626000000, 0x0000000626400000| 0%| F| |TAMS 0x0000000626000000, 0x0000000626000000| Untracked
| 99|0x0000000626400000, 0x0000000626400000, 0x0000000626800000| 0%| F| |TAMS 0x0000000626400000, 0x0000000626400000| Untracked
| 100|0x0000000626800000, 0x0000000626800000, 0x0000000626c00000| 0%| F| |TAMS 0x0000000626800000, 0x0000000626800000| Untracked
| 101|0x0000000626c00000, 0x0000000626c00000, 0x0000000627000000| 0%| F| |TAMS 0x0000000626c00000, 0x0000000626c00000| Untracked
| 102|0x0000000627000000, 0x0000000627000000, 0x0000000627400000| 0%| F| |TAMS 0x0000000627000000, 0x0000000627000000| Untracked
| 103|0x0000000627400000, 0x0000000627400000, 0x0000000627800000| 0%| F| |TAMS 0x0000000627400000, 0x0000000627400000| Untracked
| 104|0x0000000627800000, 0x0000000627800000, 0x0000000627c00000| 0%| F| |TAMS 0x0000000627800000, 0x0000000627800000| Untracked
| 105|0x0000000627c00000, 0x0000000627c00000, 0x0000000628000000| 0%| F| |TAMS 0x0000000627c00000, 0x0000000627c00000| Untracked
| 106|0x0000000628000000, 0x0000000628000000, 0x0000000628400000| 0%| F| |TAMS 0x0000000628000000, 0x0000000628000000| Untracked
| 107|0x0000000628400000, 0x0000000628400000, 0x0000000628800000| 0%| F| |TAMS 0x0000000628400000, 0x0000000628400000| Untracked
| 108|0x0000000628800000, 0x0000000628800000, 0x0000000628c00000| 0%| F| |TAMS 0x0000000628800000, 0x0000000628800000| Untracked
| 109|0x0000000628c00000, 0x0000000628c00000, 0x0000000629000000| 0%| F| |TAMS 0x0000000628c00000, 0x0000000628c00000| Untracked
| 110|0x0000000629000000, 0x0000000629000000, 0x0000000629400000| 0%| F| |TAMS 0x0000000629000000, 0x0000000629000000| Untracked
| 111|0x0000000629400000, 0x0000000629400000, 0x0000000629800000| 0%| F| |TAMS 0x0000000629400000, 0x0000000629400000| Untracked
| 112|0x0000000629800000, 0x0000000629800000, 0x0000000629c00000| 0%| F| |TAMS 0x0000000629800000, 0x0000000629800000| Untracked
| 113|0x0000000629c00000, 0x0000000629c00000, 0x000000062a000000| 0%| F| |TAMS 0x0000000629c00000, 0x0000000629c00000| Untracked
| 114|0x000000062a000000, 0x000000062a000000, 0x000000062a400000| 0%| F| |TAMS 0x000000062a000000, 0x000000062a000000| Untracked
| 115|0x000000062a400000, 0x000000062a400000, 0x000000062a800000| 0%| F| |TAMS 0x000000062a400000, 0x000000062a400000| Untracked
| 116|0x000000062a800000, 0x000000062a800000, 0x000000062ac00000| 0%| F| |TAMS 0x000000062a800000, 0x000000062a800000| Untracked
| 117|0x000000062ac00000, 0x000000062ac00000, 0x000000062b000000| 0%| F| |TAMS 0x000000062ac00000, 0x000000062ac00000| Untracked
| 118|0x000000062b000000, 0x000000062b000000, 0x000000062b400000| 0%| F| |TAMS 0x000000062b000000, 0x000000062b000000| Untracked
| 119|0x000000062b400000, 0x000000062b495768, 0x000000062b800000| 14%| E| |TAMS 0x000000062b400000, 0x000000062b400000| Complete
| 120|0x000000062b800000, 0x000000062bc00000, 0x000000062bc00000|100%| E|CS|TAMS 0x000000062b800000, 0x000000062b800000| Complete
| 121|0x000000062bc00000, 0x000000062c000000, 0x000000062c000000|100%| E|CS|TAMS 0x000000062bc00000, 0x000000062bc00000| Complete
| 122|0x000000062c000000, 0x000000062c400000, 0x000000062c400000|100%| E|CS|TAMS 0x000000062c000000, 0x000000062c000000| Complete
| 123|0x000000062c400000, 0x000000062c800000, 0x000000062c800000|100%| E|CS|TAMS 0x000000062c400000, 0x000000062c400000| Complete
| 124|0x000000062c800000, 0x000000062cc00000, 0x000000062cc00000|100%| E|CS|TAMS 0x000000062c800000, 0x000000062c800000| Complete
Card table byte_map: [0x000001b7904f0000,0x000001b791490000] _byte_map_base: 0x000001b78d484000
Marking Bits (Prev, Next): (CMBitMap*) 0x000001b7f78b5090, (CMBitMap*) 0x000001b7f78b50d0
Prev Bits: [0x000001b792430000, 0x000001b79a0d0000)
Next Bits: [0x000001b79a0d0000, 0x000001b7a1d70000)
Polling page: 0x000001b7f5550000
Metaspace:
Usage:
Non-class: 4.89 MB used.
Class: 375.18 KB used.
Both: 5.26 MB used.
Virtual space:
Non-class space: 64.00 MB reserved, 5.00 MB ( 8%) committed, 1 nodes.
Class space: 1.00 GB reserved, 448.00 KB ( <1%) committed, 1 nodes.
Both: 1.06 GB reserved, 5.44 MB ( <1%) committed.
Chunk freelists:
Non-Class: 2.14 MB
Class: 3.51 MB
Both: 5.66 MB
MaxMetaspaceSize: unlimited
CompressedClassSpaceSize: 1.00 GB
Initial GC threshold: 21.00 MB
Current GC threshold: 21.00 MB
CDS: on
MetaspaceReclaimPolicy: balanced
- commit_granule_bytes: 65536.
- commit_granule_words: 8192.
- virtual_space_node_default_size: 8388608.
- enlarge_chunks_in_place: 1.
- new_chunks_are_fully_committed: 0.
- uncommit_free_chunks: 1.
- use_allocation_guard: 0.
Internal statistics:
num_allocs_failed_limit: 0.
num_arena_births: 84.
num_arena_deaths: 0.
num_vsnodes_births: 2.
num_vsnodes_deaths: 0.
num_space_committed: 87.
num_space_uncommitted: 0.
num_chunks_returned_to_freelist: 0.
num_chunks_taken_from_freelist: 168.
num_chunk_merges: 0.
num_chunk_splits: 121.
num_chunks_enlarged: 90.
num_inconsistent_stats: 0.
CodeHeap 'non-profiled nmethods': size=119168Kb used=297Kb max_used=297Kb free=118870Kb
bounds [0x000001b787ba0000, 0x000001b787e10000, 0x000001b78f000000]
CodeHeap 'profiled nmethods': size=119104Kb used=1574Kb max_used=1574Kb free=117529Kb
bounds [0x000001b780000000, 0x000001b780270000, 0x000001b787450000]
CodeHeap 'non-nmethods': size=7488Kb used=3456Kb max_used=3470Kb free=4031Kb
bounds [0x000001b787450000, 0x000001b7877c0000, 0x000001b787ba0000]
total_blobs=1984 nmethods=949 adapters=943
compilation: enabled
stopped_count=0, restarted_count=0
full_count=0
Compilation events (20 events):
Event: 0.286 Thread 0x000001b7a5525550 nmethod 937 0x000001b780183f10 code [0x000001b7801840e0, 0x000001b7801844a8]
Event: 0.286 Thread 0x000001b7a550c420 940 1 org.lwjgl.system.Pointer$Default::address (5 bytes)
Event: 0.286 Thread 0x000001b7a5507e80 nmethod 939 0x000001b780184690 code [0x000001b7801848e0, 0x000001b780185498]
Event: 0.286 Thread 0x000001b7a550c420 nmethod 940 0x000001b787be9990 code [0x000001b787be9b20, 0x000001b787be9bd8]
Event: 0.287 Thread 0x000001b7a5507e80 941 1 java.net.URLStreamHandler::getDefaultPort (2 bytes)
Event: 0.287 Thread 0x000001b7a5507e80 nmethod 941 0x000001b787be9c90 code [0x000001b787be9e20, 0x000001b787be9ef8]
Event: 0.287 Thread 0x000001b7a5507e80 942 3 java.net.URL::isBuiltinStreamHandler (32 bytes)
Event: 0.287 Thread 0x000001b7a427eae0 943 3 java.net.URL::isBuiltinStreamHandler (8 bytes)
Event: 0.287 Thread 0x000001b7a550c420 944 3 sun.net.util.IPAddressUtil::checkHostString (53 bytes)
Event: 0.287 Thread 0x000001b7a5525550 945 3 sun.net.util.IPAddressUtil::scan (92 bytes)
Event: 0.287 Thread 0x000001b7a427eae0 nmethod 943 0x000001b780185910 code [0x000001b780185ac0, 0x000001b780185c88]
Event: 0.287 Thread 0x000001b7a427eae0 947 3 sun.misc.Unsafe::putLong (11 bytes)
Event: 0.287 Thread 0x000001b7a5507e80 nmethod 942 0x000001b780185d90 code [0x000001b780185fe0, 0x000001b780186898]
Event: 0.287 Thread 0x000001b7a427eae0 nmethod 947 0x000001b780186c10 code [0x000001b780186da0, 0x000001b780186eb8]
Event: 0.287 Thread 0x000001b7a5507e80 948 3 org.lwjgl.system.MemoryUtil::memPutAddress (29 bytes)
Event: 0.287 Thread 0x000001b7a550c420 nmethod 944 0x000001b780186f90 code [0x000001b780187220, 0x000001b780187cf8]
Event: 0.287 Thread 0x000001b7a5525550 nmethod 945 0x000001b780188190 code [0x000001b780188400, 0x000001b780188fb8]
Event: 0.287 Thread 0x000001b7a9cb7650 949 4 sun.misc.Unsafe::putLong (11 bytes)
Event: 0.287 Thread 0x000001b7a5507e80 nmethod 948 0x000001b780189510 code [0x000001b7801896c0, 0x000001b7801898b8]
Event: 0.288 Thread 0x000001b7a9cb7650 nmethod 949 0x000001b787bea390 code [0x000001b787bea520, 0x000001b787bea5d8]
GC Heap History (0 events):
No events
Dll operation events (11 events):
Event: 0.004 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\java.dll
Event: 0.009 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
Event: 0.109 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
Event: 0.110 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
Event: 0.113 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\net.dll
Event: 0.113 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
Event: 0.115 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
Event: 0.154 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
Event: 0.175 Loaded shared library C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
Event: 0.227 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
Event: 0.278 Loaded shared library C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
Deoptimization events (20 events):
Event: 0.181 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5f8590
Event: 0.181 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5f79f8 mode 0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5f8590
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5f79f8 mode 0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5fbfd0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fb438 mode 0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5fbfd0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fb438 mode 0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78009c6f3 sp=0x000000549c5fbfd0
Event: 0.182 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fb438 mode 0
Event: 0.201 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b78006f49f sp=0x000000549c5fad50
Event: 0.201 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874bb0e3 sp=0x000000549c5fa1e8 mode 0
Event: 0.223 Thread 0x000001b7f7801df0 Uncommon trap: trap_request=0xffffff45 fr.pc=0x000001b787bdb488 relative=0x0000000000000068
Event: 0.223 Thread 0x000001b7f7801df0 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000001b787bdb488 method=java.io.WinNTFileSystem.isSlash(C)Z @ 9 c2
Event: 0.223 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b787bdb488 sp=0x000000549c5fd9b0
Event: 0.223 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874ba5a3 sp=0x000000549c5fd948 mode 2
Event: 0.288 Thread 0x000001b7f7801df0 Uncommon trap: trap_request=0xffffff54 fr.pc=0x000001b787bea58c relative=0x000000000000006c
Event: 0.288 Thread 0x000001b7f7801df0 Uncommon trap: reason=speculate_null_assert action=make_not_entrant pc=0x000001b787bea58c method=sun.misc.Unsafe.putLong(Ljava/lang/Object;JJ)V @ 7 c2
Event: 0.288 Thread 0x000001b7f7801df0 DEOPT PACKING pc=0x000001b787bea58c sp=0x000000549c5ff620
Event: 0.289 Thread 0x000001b7f7801df0 DEOPT UNPACKING pc=0x000001b7874ba5a3 sp=0x000000549c5ff5b8 mode 2
Classes loaded (20 events):
Event: 0.244 Loading class sun/misc/Unsafe
Event: 0.244 Loading class sun/misc/Unsafe done
Event: 0.244 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor
Event: 0.244 Loading class java/lang/invoke/DirectMethodHandle$StaticAccessor done
Event: 0.245 Loading class java/util/function/LongPredicate
Event: 0.245 Loading class java/util/function/LongPredicate done
Event: 0.246 Loading class java/lang/foreign/MemorySegment
Event: 0.246 Loading class java/lang/foreign/Addressable
Event: 0.246 Loading class java/lang/foreign/Addressable done
Event: 0.246 Loading class java/lang/foreign/MemorySegment done
Event: 0.248 Loading class java/nio/InvalidMarkException
Event: 0.248 Loading class java/nio/InvalidMarkException done
Event: 0.248 Loading class java/nio/BufferUnderflowException
Event: 0.248 Loading class java/nio/BufferUnderflowException done
Event: 0.284 Loading class jdk/internal/foreign/MemorySessionImpl
Event: 0.284 Loading class java/lang/foreign/MemorySession
Event: 0.284 Loading class java/lang/foreign/SegmentAllocator
Event: 0.284 Loading class java/lang/foreign/SegmentAllocator done
Event: 0.284 Loading class java/lang/foreign/MemorySession done
Event: 0.284 Loading class jdk/internal/foreign/MemorySessionImpl done
Classes unloaded (0 events):
No events
Classes redefined (0 events):
No events
Internal exceptions (20 events):
Event: 0.236 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bcff6d8}> (0x000000062bcff6d8)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.236 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd001a8}> (0x000000062bd001a8)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.237 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd07b00}> (0x000000062bd07b00)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.239 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd0a958}> (0x000000062bd0a958)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.239 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bd0acd8}> (0x000000062bd0acd8)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.243 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062bdb1b80}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object)'> (0x000000062bdb1b80)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.245 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be051f8}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, int, long)'> (0x000000062be051f8)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.245 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be0aac8}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, int)'> (0x000000062be0aac8)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.246 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be297b0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, long, long)'> (0x000000062be297b0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.247 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be2f8c8}: 'java.lang.Object java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.lang.Object, java.lang.Object, long)'> (0x000000062be2f8c8)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.247 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be33928}: 'java.lang.Object java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.lang.Object, long, java.lang.Object)'> (0x000000062be33928)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.247 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062be3aeb0}: 'int java.lang.invoke.DirectMethodHandle$Holder.invokeStaticInit(java.lang.Object, java.lang.Object, java.lang.Object, long)'> (0x000000062be3aeb0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.275 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062bb43dd8}: 'void java.lang.System.load(java.lang.String, java.lang.Class)'> (0x000000062bb43dd8)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.275 Thread 0x000001b7f7801df0 Exception <a 'java/lang/NoSuchMethodError'{0x000000062bb46be0}: 'void java.lang.System.loadLibrary(java.lang.String, java.lang.Class)'> (0x000000062bb46be0)
thrown [s\open\src\hotspot\share\interpreter\linkResolver.cpp, line 774]
Event: 0.277 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb56610}> (0x000000062bb56610)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.277 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb569d0}> (0x000000062bb569d0)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.280 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb62730}> (0x000000062bb62730)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.280 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bb62a28}> (0x000000062bb62a28)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.284 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bbc3e78}> (0x000000062bbc3e78)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
Event: 0.284 Thread 0x000001b7f7801df0 Exception <a 'sun/nio/fs/WindowsException'{0x000000062bbc4228}> (0x000000062bbc4228)
thrown [s\open\src\hotspot\share\prims\jni.cpp, line 517]
VM Operations (10 events):
Event: 0.032 Executing VM operation: HandshakeAllThreads
Event: 0.032 Executing VM operation: HandshakeAllThreads done
Event: 0.041 Executing VM operation: ChangeBreakpoints
Event: 0.041 Executing VM operation: ChangeBreakpoints done
Event: 0.103 Executing VM operation: ChangeBreakpoints
Event: 0.103 Executing VM operation: ChangeBreakpoints done
Event: 0.223 Executing VM operation: HandshakeAllThreads
Event: 0.223 Executing VM operation: HandshakeAllThreads done
Event: 0.227 Executing VM operation: HandshakeAllThreads
Event: 0.227 Executing VM operation: HandshakeAllThreads done
Events (19 events):
Event: 0.009 Thread 0x000001b7f7801df0 Thread added: 0x000001b7f7801df0
Event: 0.015 Thread 0x000001b7a4262ce0 Thread added: 0x000001b7a4262ce0
Event: 0.015 Thread 0x000001b7a4264270 Thread added: 0x000001b7a4264270
Event: 0.015 Thread 0x000001b7a4266200 Thread added: 0x000001b7a4266200
Event: 0.015 Thread 0x000001b7a42684e0 Thread added: 0x000001b7a42684e0
Event: 0.015 Thread 0x000001b7a426cfb0 Thread added: 0x000001b7a426cfb0
Event: 0.015 Thread 0x000001b7a426c5d0 Thread added: 0x000001b7a426c5d0
Event: 0.016 Thread 0x000001b7a4272110 Thread added: 0x000001b7a4272110
Event: 0.016 Thread 0x000001b7a427eae0 Thread added: 0x000001b7a427eae0
Event: 0.016 Thread 0x000001b7a4289060 Thread added: 0x000001b7a4289060
Event: 0.029 Thread 0x000001b7a55067f0 Thread added: 0x000001b7a55067f0
Event: 0.032 Thread 0x000001b7a5507e80 Thread added: 0x000001b7a5507e80
Event: 0.032 Thread 0x000001b7a550c420 Thread added: 0x000001b7a550c420
Event: 0.033 Thread 0x000001b7a5525550 Thread added: 0x000001b7a5525550
Event: 0.041 Thread 0x000001b7a55c40c0 Thread added: 0x000001b7a55c40c0
Event: 0.041 Thread 0x000001b7a55ba2c0 Thread added: 0x000001b7a55ba2c0
Event: 0.041 Thread 0x000001b7a55ba810 Thread added: 0x000001b7a55ba810
Event: 0.160 Thread 0x000001b7a9cb7650 Thread added: 0x000001b7a9cb7650
Event: 0.173 Thread 0x000001b7a9d4f890 Thread added: 0x000001b7a9d4f890
Dynamic libraries:
0x00007ff636b50000 - 0x00007ff636b60000 C:\Program Files\Java\jdk-19.0.2\bin\javaw.exe
0x00007ff935510000 - 0x00007ff935708000 C:\Windows\SYSTEM32\ntdll.dll
0x00007ff934e50000 - 0x00007ff934f0f000 C:\Windows\System32\KERNEL32.DLL
0x00007ff932bf0000 - 0x00007ff932ee6000 C:\Windows\System32\KERNELBASE.dll
0x00007ff932f20000 - 0x00007ff933020000 C:\Windows\System32\ucrtbase.dll
0x00007ff91a700000 - 0x00007ff91a718000 C:\Program Files\Java\jdk-19.0.2\bin\jli.dll
0x00007ff91a600000 - 0x00007ff91a61b000 C:\Program Files\Java\jdk-19.0.2\bin\VCRUNTIME140.dll
0x00007ff934720000 - 0x00007ff9347cf000 C:\Windows\System32\ADVAPI32.dll
0x00007ff934bb0000 - 0x00007ff934c4e000 C:\Windows\System32\msvcrt.dll
0x00007ff9353a0000 - 0x00007ff93543c000 C:\Windows\System32\sechost.dll
0x00007ff934a80000 - 0x00007ff934ba6000 C:\Windows\System32\RPCRT4.dll
0x00007ff933570000 - 0x00007ff93370d000 C:\Windows\System32\USER32.dll
0x00007ff9334a0000 - 0x00007ff9334c2000 C:\Windows\System32\win32u.dll
0x00007ff934c80000 - 0x00007ff934cac000 C:\Windows\System32\GDI32.dll
0x00007ff925810000 - 0x00007ff925aaa000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
0x00007ff933380000 - 0x00007ff933495000 C:\Windows\System32\gdi32full.dll
0x00007ff9334d0000 - 0x00007ff93356d000 C:\Windows\System32\msvcp_win.dll
0x00007ff92b1d0000 - 0x00007ff92b1da000 C:\Windows\SYSTEM32\VERSION.dll
0x00007ff934c50000 - 0x00007ff934c80000 C:\Windows\System32\IMM32.DLL
0x00007ff92f6f0000 - 0x00007ff92f6fc000 C:\Program Files\Java\jdk-19.0.2\bin\vcruntime140_1.dll
0x00007ff8fde20000 - 0x00007ff8fdeae000 C:\Program Files\Java\jdk-19.0.2\bin\msvcp140.dll
0x00007ff8884e0000 - 0x00007ff8891a0000 C:\Program Files\Java\jdk-19.0.2\bin\server\jvm.dll
0x00007ff8cf580000 - 0x00007ff8cf589000 C:\Windows\SYSTEM32\WSOCK32.dll
0x00007ff925d90000 - 0x00007ff925db7000 C:\Windows\SYSTEM32\WINMM.dll
0x00007ff934990000 - 0x00007ff9349fb000 C:\Windows\System32\WS2_32.dll
0x00007ff930ac0000 - 0x00007ff930ad2000 C:\Windows\SYSTEM32\kernel.appcore.dll
0x00007ff92f6d0000 - 0x00007ff92f6da000 C:\Program Files\Java\jdk-19.0.2\bin\jimage.dll
0x00007ff929560000 - 0x00007ff929744000 C:\Windows\SYSTEM32\DBGHELP.DLL
0x00007ff9154a0000 - 0x00007ff9154d4000 C:\Windows\SYSTEM32\dbgcore.DLL
0x00007ff933280000 - 0x00007ff933302000 C:\Windows\System32\bcryptPrimitives.dll
0x00007ff90cd20000 - 0x00007ff90cd5c000 C:\Program Files\Java\jdk-19.0.2\bin\jdwp.dll
0x00007ff91a5f0000 - 0x00007ff91a5fe000 C:\Program Files\Java\jdk-19.0.2\bin\instrument.dll
0x00007ff911b60000 - 0x00007ff911b86000 C:\Program Files\Java\jdk-19.0.2\bin\java.dll
0x00007ff8a3af0000 - 0x00007ff8a3bc7000 C:\Program Files\Java\jdk-19.0.2\bin\jsvml.dll
0x00007ff933710000 - 0x00007ff933e54000 C:\Windows\System32\SHELL32.dll
0x00007ff930cc0000 - 0x00007ff931453000 C:\Windows\SYSTEM32\windows.storage.dll
0x00007ff934f10000 - 0x00007ff935264000 C:\Windows\System32\combase.dll
0x00007ff932640000 - 0x00007ff93266e000 C:\Windows\SYSTEM32\Wldp.dll
0x00007ff9352d0000 - 0x00007ff93537d000 C:\Windows\System32\SHCORE.dll
0x00007ff935270000 - 0x00007ff9352c5000 C:\Windows\System32\shlwapi.dll
0x00007ff932b30000 - 0x00007ff932b4f000 C:\Windows\SYSTEM32\profapi.dll
0x00007ff919f00000 - 0x00007ff919f0c000 C:\Program Files\Java\jdk-19.0.2\bin\dt_socket.dll
0x00007ff932040000 - 0x00007ff93207c000 C:\Windows\SYSTEM32\IPHLPAPI.DLL
0x00007ff9323a0000 - 0x00007ff93240a000 C:\Windows\system32\mswsock.dll
0x00007ff932090000 - 0x00007ff93215a000 C:\Windows\SYSTEM32\DNSAPI.dll
0x00007ff934e40000 - 0x00007ff934e48000 C:\Windows\System32\NSI.dll
0x00007ff92a320000 - 0x00007ff92a32a000 C:\Windows\System32\rasadhlp.dll
0x00007ff9279b0000 - 0x00007ff927a32000 C:\Windows\System32\fwpuclnt.dll
0x00007ff932ef0000 - 0x00007ff932f17000 C:\Windows\System32\bcrypt.dll
0x00007ff919c40000 - 0x00007ff919c58000 C:\Program Files\Java\jdk-19.0.2\bin\zip.dll
0x00007ff916970000 - 0x00007ff916983000 C:\Program Files\Java\jdk-19.0.2\bin\net.dll
0x00007ff92bf70000 - 0x00007ff92c07a000 C:\Windows\SYSTEM32\WINHTTP.dll
0x00007ff912fa0000 - 0x00007ff912fb6000 C:\Program Files\Java\jdk-19.0.2\bin\nio.dll
0x00007ff919ef0000 - 0x00007ff919f00000 C:\Program Files\Java\jdk-19.0.2\bin\verify.dll
0x00007ff8a45d0000 - 0x00007ff8a464a000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl.dll
0x00007ff8a26e0000 - 0x00007ff8a2762000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\glfw.dll
0x00007ff8f5090000 - 0x00007ff8f50d5000 C:\Windows\SYSTEM32\dinput8.dll
0x00007ff911910000 - 0x00007ff911921000 C:\Windows\SYSTEM32\xinput1_4.dll
0x00007ff933020000 - 0x00007ff93306e000 C:\Windows\System32\cfgmgr32.dll
0x00007ff9329a0000 - 0x00007ff9329cc000 C:\Windows\SYSTEM32\DEVOBJ.dll
0x00007ff9307d0000 - 0x00007ff9307ff000 C:\Windows\SYSTEM32\dwmapi.dll
0x00007ff924940000 - 0x00007ff924a92000 C:\Windows\SYSTEM32\inputhost.dll
0x00007ff934130000 - 0x00007ff9341fd000 C:\Windows\System32\OLEAUT32.dll
0x00007ff9301d0000 - 0x00007ff9302c2000 C:\Windows\SYSTEM32\CoreMessaging.dll
0x00007ff92e200000 - 0x00007ff92e2f6000 C:\Windows\SYSTEM32\PROPSYS.dll
0x00007ff92f570000 - 0x00007ff92f6c4000 C:\Windows\SYSTEM32\wintypes.dll
0x00007ff92fd90000 - 0x00007ff9300ee000 C:\Windows\SYSTEM32\CoreUIComponents.dll
0x00007ff931d70000 - 0x00007ff931da3000 C:\Windows\SYSTEM32\ntmarta.dll
0x00007ff930550000 - 0x00007ff9305ee000 C:\Windows\system32\uxtheme.dll
0x00007ff934010000 - 0x00007ff934124000 C:\Windows\System32\MSCTF.dll
0x00007ff8b13c0000 - 0x00007ff8b141e000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\lwjgl_opengl.dll
0x00007ff8c8fb0000 - 0x00007ff8c90d5000 C:\Windows\SYSTEM32\opengl32.dll
0x00007ff8c8a90000 - 0x00007ff8c8abc000 C:\Windows\SYSTEM32\GLU32.dll
0x00007ff8a2190000 - 0x00007ff8a2400000 C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64\jemalloc.dll
dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Java\jdk-19.0.2\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Java\jdk-19.0.2\bin\server;C:\Users\Speiger\AppData\Local\Temp\lwjgl_Speiger\3.3.2+13\x64
VM Arguments:
jvm_args: -XX:+ShowCodeDetailsInExceptionMessages -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:63110 -javaagent:C:\Users\Speiger\eclipse\java-2022-12\eclipse\configuration\org.eclipse.osgi\636\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=UTF-8
java_command: speiger.src.coreengine.Testing
java_class_path (initial): D:\Projects\GameProject\SimpleJavaEngine\bin\main;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\757920418805fb90bfebb3d46b1d9e7669fca2eb\lwjgl-glfw-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-glfw\3.3.2\1251e3cb7e5d6159334cfb9244f789ce992f03b\lwjgl-glfw-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\877e17e39ebcd58a9c956dc3b5b777813de0873a\lwjgl-jemalloc-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-jemalloc\3.3.2\db886c1f9e313c3fa2a25543b99ccd250d3f9fb5\lwjgl-jemalloc-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\ec66452fad5bf48707cbe96c573c6cc3dd8a7a82\lwjgl-nfd-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-nfd\3.3.2\12c0041066a97f0c74d0f72db1423ac9ea124275\lwjgl-nfd-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\ae5357ed6d934546d3533993ea84c0cfb75eed95\lwjgl-openal-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-openal\3.3.2\e74f299a602192faaf14b917632e4cbbb493c940\lwjgl-openal-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\ee8e95be0b438602038bc1f02dc5e3d011b1b216\lwjgl-opengl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-opengl\3.3.2\83cd34469d4e0bc335bf74c7f62206530a9480bf\lwjgl-opengl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\a2550795014d622b686e9caac50b14baa87d2c70\lwjgl-stb-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl-stb\3.3.2\1c4f4b8353bdb78c5264ab921436f03fc9aa1ba5\lwjgl-stb-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\4421d94af68e35dcaa31737a6fc59136a1e61b94\lwjgl-3.3.2.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\org.lwjgl\lwjgl\3.3.2\a55169ced70ffcd15f2162daf4a9c968578f6cd5\lwjgl-3.3.2-natives-windows.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\com.google.code.gson\gson\2.8.6\9180733b7df8542621dc12e21e87557e8c99b8cb\gson-2.8.6.jar;C:\Users\Speiger\.gradle\caches\modules-2\files-2.1\de.speiger\Primitive-Collections\0.8.0\333b9d587940fc34ad68f3d7d6bace4646dd02ec\Primitive-Collections-0.8.0.jar
Launcher Type: SUN_STANDARD
[Global flags]
intx CICompilerCount = 12 {product} {ergonomic}
uint ConcGCThreads = 5 {product} {ergonomic}
uint G1ConcRefinementThreads = 18 {product} {ergonomic}
size_t G1HeapRegionSize = 4194304 {product} {ergonomic}
uintx GCDrainStackTargetSize = 64 {product} {ergonomic}
size_t InitialHeapSize = 524288000 {product} {ergonomic}
size_t MarkStackSize = 4194304 {product} {ergonomic}
size_t MaxHeapSize = 8363442176 {product} {ergonomic}
size_t MaxNewSize = 5016387584 {product} {ergonomic}
size_t MinHeapDeltaBytes = 4194304 {product} {ergonomic}
size_t MinHeapSize = 8388608 {product} {ergonomic}
uintx NonNMethodCodeHeapSize = 7602480 {pd product} {ergonomic}
uintx NonProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
uintx ProfiledCodeHeapSize = 122027880 {pd product} {ergonomic}
uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic}
bool SegmentedCodeCache = true {product} {ergonomic}
bool ShowCodeDetailsInExceptionMessages = true {manageable} {command line}
size_t SoftMaxHeapSize = 8363442176 {manageable} {ergonomic}
bool UseCompressedClassPointers = true {product lp64_product} {ergonomic}
bool UseCompressedOops = true {product lp64_product} {ergonomic}
bool UseG1GC = true {product} {ergonomic}
bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic}
Logging:
Log output configuration:
#0: stdout all=warning uptime,level,tags foldmultilines=false
#1: stderr all=off uptime,level,tags foldmultilines=false
Environment Variables:
PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Speiger\AppData\Local\Microsoft\WindowsApps;
USERNAME=Speiger
OS=Windows_NT
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD
TMP=C:\Users\Speiger\AppData\Local\Temp
TEMP=C:\Users\Speiger\AppData\Local\Temp
--------------- S Y S T E M ---------------
OS:
Windows 10 , 64 bit Build 19041 (10.0.19041.3031)
OS uptime: 0 days 3:11 hours
CPU: total 24 (initial active 24) (24 cores per cpu, 2 threads per core) family 25 model 97 stepping 2 microcode 0x0, cx8, cmov, fxsr, ht, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4a, sse4.1, sse4.2, popcnt, lzcnt, tsc, tscinvbit, avx, avx2, aes, erms, clmul, bmi1, bmi2, adx, avx512f, avx512dq, avx512cd, avx512bw, avx512vl, sha, fma, vzeroupper, avx512_vpopcntdq, avx512_vpclmulqdq, avx512_vaes, avx512_vnni, clflush, clflushopt, avx512_vbmi2, avx512_vbmi, rdtscp, rdpid, fsrm, gfni, avx512_bitalg
Memory: 4k page, system-wide physical 31894M (21079M free)
TotalPageFile size 36502M (AvailPageFile size 20292M)
current process WorkingSet (physical memory assigned to process): 70M, peak: 70M
current process commit charge ("private bytes"): 640M, peak: 640M
vm_info: Java HotSpot(TM) 64-Bit Server VM (19.0.2+7-44) for windows-amd64 JRE (19.0.2+7-44), built on 2022-11-30T18:02:09Z by "mach5one" with MS VC++ 17.1 (VS2022)
END.

BIN
output/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
output/imageOld.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

14653
output/test.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
package speiger.src.coreengine;
import java.nio.file.Path;
import org.lwjgl.opengl.ARBBaseInstance;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL31;
import org.lwjgl.opengl.NVMeshShader;
import speiger.src.coreengine.application.Application;
import speiger.src.coreengine.rendering.input.window.Window;
import speiger.src.coreengine.rendering.input.window.WindowProvider;
public class Testing extends Application {
public static void main(String... args) {
System.out.println((int)1E-6F);
new Testing().run();
}
@Override
public String getMainWindowName() { return "Testing"; }
@Override
public Window createWindow(WindowProvider provider) throws Exception {
return provider.createBuilder().setWidth(250).setHeight(250).setName("Testing").build();
}
@Override
public void init(Path file) {
System.out.println(GL11.glGetInteger(GL31.GL_MAX_UNIFORM_BUFFER_BINDINGS));
}
@Override
public void update() {
System.exit(0);
}
@Override
public void render(float particalTicks) {
}
@Override
public void destroy() {
}
}

View File

@ -1,14 +1,16 @@
package speiger.src.coreengine.application; package speiger.src.coreengine.application;
import java.io.File; import java.nio.file.Path;
import java.nio.ByteBuffer; import java.util.List;
import java.util.function.IntConsumer; import java.util.function.IntConsumer;
import java.util.function.ObjLongConsumer; import java.util.function.ObjLongConsumer;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWErrorCallback; import org.lwjgl.glfw.GLFWErrorCallback;
import speiger.src.collections.objects.utils.ObjectLists;
import speiger.src.coreengine.assets.AssetManager; import speiger.src.coreengine.assets.AssetManager;
import speiger.src.coreengine.assets.base.IAssetPackage;
import speiger.src.coreengine.assets.reloader.ResourceReloader; import speiger.src.coreengine.assets.reloader.ResourceReloader;
import speiger.src.coreengine.rendering.gui.GuiManager; import speiger.src.coreengine.rendering.gui.GuiManager;
import speiger.src.coreengine.rendering.gui.base.DebugOverlay; import speiger.src.coreengine.rendering.gui.base.DebugOverlay;
@ -18,20 +20,21 @@ import speiger.src.coreengine.rendering.input.Mouse;
import speiger.src.coreengine.rendering.input.camera.Camera; import speiger.src.coreengine.rendering.input.camera.Camera;
import speiger.src.coreengine.rendering.input.window.Window; import speiger.src.coreengine.rendering.input.window.Window;
import speiger.src.coreengine.rendering.input.window.WindowProvider; import speiger.src.coreengine.rendering.input.window.WindowProvider;
import speiger.src.coreengine.rendering.shader.ProjectionBuffer; import speiger.src.coreengine.rendering.shaderOld.ProjectionBuffer;
import speiger.src.coreengine.rendering.shader.ShaderTracker; import speiger.src.coreengine.rendering.shaderOld.ShaderTracker;
import speiger.src.coreengine.rendering.textures.base.NativeMemoryParser;
import speiger.src.coreengine.rendering.textures.base.TextureManager; import speiger.src.coreengine.rendering.textures.base.TextureManager;
import speiger.src.coreengine.rendering.utils.Cursor; import speiger.src.coreengine.rendering.utils.Cursor;
import speiger.src.coreengine.utils.counters.timers.FPSTimer; import speiger.src.coreengine.utils.counters.timers.FPSTimer;
import speiger.src.coreengine.utils.eventbus.EventBus; import speiger.src.coreengine.utils.eventbus.EventBus;
import speiger.src.coreengine.utils.helpers.FileUtils; import speiger.src.coreengine.utils.helpers.IOUtils;
import speiger.src.coreengine.utils.profiler.GPUProfiler; import speiger.src.coreengine.utils.profiler.GPUProfiler;
import speiger.src.coreengine.utils.profiler.IProfiler; import speiger.src.coreengine.utils.profiler.IProfiler;
import speiger.src.coreengine.utils.profiler.Profiler; import speiger.src.coreengine.utils.profiler.Profiler;
public abstract class Application public abstract class Application
{ {
private static Application INSTANCE;
protected Path applicationFolder;
protected FPSTimer timer; protected FPSTimer timer;
protected ApplicationExecutor executor = new ApplicationExecutor(this); protected ApplicationExecutor executor = new ApplicationExecutor(this);
protected IProfiler clientProfiler = new Profiler("Client Thread"); protected IProfiler clientProfiler = new Profiler("Client Thread");
@ -48,6 +51,14 @@ public abstract class Application
protected ProjectionBuffer projectionBuffer; protected ProjectionBuffer projectionBuffer;
protected GuiManager uiManager; protected GuiManager uiManager;
protected Application() {
INSTANCE = this;
}
public static Application getInstance() {
return INSTANCE;
}
public void run() public void run()
{ {
GLFWErrorCallback.createPrint(System.err).set(); GLFWErrorCallback.createPrint(System.err).set();
@ -69,10 +80,10 @@ public abstract class Application
return; return;
} }
Thread.currentThread().setName("Client Thread"); Thread.currentThread().setName("Client Thread");
File file = FileUtils.getBase(); applicationFolder = IOUtils.getBaseLocation();
file = file.getName().endsWith(".jar") ? file : new File("bin/main"); applicationFolder = IOUtils.endsWith(applicationFolder, ".jar") ? applicationFolder : Path.of("bin/main");
internalInit(file); internalInit();
init(file); init(applicationFolder);
if(!initEarly) mainWindow.finishWindow(); if(!initEarly) mainWindow.finishWindow();
executor.start(mainWindow); executor.start(mainWindow);
mainWindow.destroy(); mainWindow.destroy();
@ -81,10 +92,8 @@ public abstract class Application
System.exit(0); System.exit(0);
} }
protected void internalInit(File file) protected void internalInit() {
{ assetManager = new AssetManager(gatherPackages());
assetManager = reloader.addReloadableResource(new AssetManager(file), true);
assetManager.registerAssetParser(ByteBuffer.class, new NativeMemoryParser());
reloader.addReloadableResource(fonts); reloader.addReloadableResource(fonts);
fonts.setAssetManager(assetManager); fonts.setAssetManager(assetManager);
ShaderTracker.INSTANCE.init(assetManager); ShaderTracker.INSTANCE.init(assetManager);
@ -101,6 +110,7 @@ public abstract class Application
projectionBuffer = new ProjectionBuffer(camera, mainWindow); projectionBuffer = new ProjectionBuffer(camera, mainWindow);
} }
public List<IAssetPackage> gatherPackages() { return ObjectLists.singleton(IAssetPackage.of(applicationFolder)); }
public abstract String getMainWindowName(); public abstract String getMainWindowName();
public void addExtraTickRates(IntConsumer ticks) {}; public void addExtraTickRates(IntConsumer ticks) {};
public void addExtraTimers(ObjLongConsumer<String> profiler) {}; public void addExtraTimers(ObjLongConsumer<String> profiler) {};
@ -109,7 +119,7 @@ public abstract class Application
public DebugOverlay createCustomDebug() { return null; } public DebugOverlay createCustomDebug() { return null; }
public abstract Window createWindow(WindowProvider provider) throws Exception; public abstract Window createWindow(WindowProvider provider) throws Exception;
public void preinit() {} public void preinit() {}
public abstract void init(File file); public abstract void init(Path path);
public void preUpdate() {} public void preUpdate() {}
public abstract void update(); public abstract void update();
public abstract void render(float particalTicks); public abstract void render(float particalTicks);
@ -131,8 +141,7 @@ public abstract class Application
update(); update();
} }
protected final void renderInternal(float particalTicks) protected final void renderInternal(float particalTicks) {
{
render(particalTicks); render(particalTicks);
if(uiManager != null) if(uiManager != null)
{ {
@ -145,63 +154,16 @@ public abstract class Application
gpuProfiler.stop(); gpuProfiler.stop();
} }
public AssetManager getAssetManager() public AssetManager getAssetManager() { return assetManager; }
{ public ResourceReloader getReloader() { return reloader; }
return assetManager; public Window getMainWindow() { return mainWindow; }
} public Camera getCamera() { return camera; }
public EventBus getEventBus() { return eventBus; }
public ResourceReloader getReloader() public ProjectionBuffer getProjectionBuffer() { return projectionBuffer; }
{ public FPSTimer getTimer() { return timer; }
return reloader; public FontManager getFonts() { return fonts; }
} public GuiManager getUiManager() { return uiManager; }
public IProfiler getClientProfiler() { return clientProfiler; }
public Window getMainWindow() public IProfiler getGPUProfiler() { return gpuProfiler; }
{ public long getFrame() { return executor.frame; }
return mainWindow;
}
public Camera getCamera()
{
return camera;
}
public EventBus getEventBus()
{
return eventBus;
}
public ProjectionBuffer getProjectionBuffer()
{
return projectionBuffer;
}
public FPSTimer getTimer()
{
return timer;
}
public FontManager getFonts()
{
return fonts;
}
public GuiManager getUiManager()
{
return uiManager;
}
public IProfiler getClientProfiler()
{
return clientProfiler;
}
public IProfiler getGPUProfiler()
{
return gpuProfiler;
}
public long getFrame()
{
return executor.frame;
}
} }

View File

@ -10,12 +10,12 @@ import speiger.src.coreengine.rendering.input.window.Window;
import speiger.src.coreengine.rendering.utils.AllocationTracker; import speiger.src.coreengine.rendering.utils.AllocationTracker;
import speiger.src.coreengine.rendering.utils.GLStamper; import speiger.src.coreengine.rendering.utils.GLStamper;
import speiger.src.coreengine.rendering.utils.GLStamper.GLStamp; import speiger.src.coreengine.rendering.utils.GLStamper.GLStamp;
import speiger.src.coreengine.rendering.utils.GLUtils; import speiger.src.coreengine.rendering.utils.GLStateTracker;
import speiger.src.coreengine.utils.counters.averager.TimeAverager; import speiger.src.coreengine.utils.counters.averager.TimeAverager;
import speiger.src.coreengine.utils.counters.timers.FPSTimer; import speiger.src.coreengine.utils.counters.timers.FPSTimer;
import speiger.src.coreengine.utils.counters.timers.FrameSyncer; import speiger.src.coreengine.utils.counters.timers.FrameSyncer;
import speiger.src.coreengine.utils.counters.timers.TimerTarget; import speiger.src.coreengine.utils.counters.timers.TimerTarget;
import speiger.src.coreengine.utils.helpers.FileUtils; import speiger.src.coreengine.utils.helpers.IOUtils;
import speiger.src.coreengine.utils.helpers.TextUtil; import speiger.src.coreengine.utils.helpers.TextUtil;
import speiger.src.coreengine.utils.io.GameLog; import speiger.src.coreengine.utils.io.GameLog;
import speiger.src.coreengine.utils.io.GameLog.LogLevel; import speiger.src.coreengine.utils.io.GameLog.LogLevel;
@ -83,7 +83,7 @@ public class ApplicationExecutor
boolean end = timer.update(); boolean end = timer.update();
stamp.stop(); stamp.stop();
AllocationTracker.INSTANCE.update(); AllocationTracker.INSTANCE.update();
GLUtils.onFrameEnded(); GLStateTracker.onFrameEnded();
gpu().next("Window").start("V-Sync"); gpu().next("Window").start("V-Sync");
window.finishFrame(); window.finishFrame();
if(window.isCPULimited()) sync.sync(fps.getTargetTicks()); if(window.isCPULimited()) sync.sync(fps.getTargetTicks());
@ -126,8 +126,8 @@ public class ApplicationExecutor
builder.append(fps.getTicks()).append(":").append(ups.getTicks()); builder.append(fps.getTicks()).append(":").append(ups.getTicks());
owner.addExtraTickRates(T -> builder.append(":").append(T)); owner.addExtraTickRates(T -> builder.append(":").append(T));
builder.append(",").append(getMemoryUsage()); builder.append(",").append(getMemoryUsage());
builder.append(",").append("CPU-A: "+FileUtils.convertBytes(AllocationTracker.INSTANCE.getCPUAllocatedBytes())); builder.append(",").append("CPU-A: "+IOUtils.convertBytes(AllocationTracker.INSTANCE.getCPUAllocatedBytes()));
builder.append(",").append("GPU-A: "+FileUtils.convertBytes(AllocationTracker.INSTANCE.getGPUAllocatedBytes())); builder.append(",").append("GPU-A: "+IOUtils.convertBytes(AllocationTracker.INSTANCE.getGPUAllocatedBytes()));
builder.append(",").append(TextUtil.convertTime(timer.getUsage(), "Client:", FORMATTER)); builder.append(",").append(TextUtil.convertTime(timer.getUsage(), "Client:", FORMATTER));
builder.append(",").append(TextUtil.convertTime(gpuTime.getAverage(), "GPU:", FORMATTER)); builder.append(",").append(TextUtil.convertTime(gpuTime.getAverage(), "GPU:", FORMATTER));
owner.addExtraTimers((N, T) -> builder.append(",").append(TextUtil.convertTime(T, N, FORMATTER))); owner.addExtraTimers((N, T) -> builder.append(",").append(TextUtil.convertTime(T, N, FORMATTER)));

View File

@ -2,7 +2,7 @@ package speiger.src.coreengine.application;
import speiger.src.coreengine.rendering.gui.GuiManager; import speiger.src.coreengine.rendering.gui.GuiManager;
import speiger.src.coreengine.rendering.gui.base.DebugOverlay; import speiger.src.coreengine.rendering.gui.base.DebugOverlay;
import speiger.src.coreengine.rendering.models.UniformBuffer; import speiger.src.coreengine.rendering.models.buffers.UniformBuffer;
import speiger.src.coreengine.utils.collections.FlagHolder; import speiger.src.coreengine.utils.collections.FlagHolder;
import speiger.src.coreengine.utils.profiler.EmptyProfiler; import speiger.src.coreengine.utils.profiler.EmptyProfiler;
import speiger.src.coreengine.utils.profiler.IProfiler; import speiger.src.coreengine.utils.profiler.IProfiler;

View File

@ -2,103 +2,71 @@ package speiger.src.coreengine.assets;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.function.Function;
import speiger.src.collections.objects.maps.impl.hash.Object2ObjectOpenHashMap; import speiger.src.collections.objects.maps.impl.concurrent.Object2ObjectConcurrentOpenHashMap;
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps;
public final class AssetLocation implements Comparable<AssetLocation> public final class AssetLocation implements Comparable<AssetLocation> {
{ static final Map<String, AssetLocation> LOCATION = new Object2ObjectConcurrentOpenHashMap<>();
static final Map<String, AssetLocation> LOCATION = Object2ObjectMaps.synchronize(new Object2ObjectOpenHashMap<>());
static final Function<String, AssetLocation> BUILDER = AssetLocation::compute;
final String domain; final String domain;
final String location; final String location;
private AssetLocation() {throw new UnsupportedOperationException("use AssetLocation.of instead");} private AssetLocation() {
throw new UnsupportedOperationException("use AssetLocation.of instead");
}
private AssetLocation(String domain, String location) private AssetLocation(String domain, String location) {
{
this.domain = domain; this.domain = domain;
this.location = location; this.location = location;
} }
public String getDomain() public String domain() { return domain; }
{ public String location() { return location; }
return domain; public String actualLocation() { return "assets/"+domain+"/"+location; }
public boolean endsWith(String suffix) { return location.endsWith(suffix); }
public AssetLocation subAsset(String subPath) {
return of(domain+":"+location+"/"+subPath);
} }
public String getLocation() public AssetLocation alternate(String alterversion) {
{
return location;
}
public String getActualLocation()
{
return "assets/"+domain+"/"+location;
}
public AssetLocation subAsset(String subPath)
{
return of(domain+":"+location + "/" + subPath);
}
public AssetLocation alternate(String alterversion)
{
return of(domain+":"+location+"."+alterversion); return of(domain+":"+location+"."+alterversion);
} }
@Override @Override
public String toString() public String toString() {
{
return domain+":"+location; return domain+":"+location;
} }
@Override @Override
public int hashCode() public int hashCode() {
{
return Objects.hash(domain, location); return Objects.hash(domain, location);
} }
@Override @Override
public boolean equals(Object obj) public boolean equals(Object obj) {
{ return obj == this || (obj instanceof AssetLocation location && matches(location));
if(obj == this)
{
return true;
}
if(obj instanceof AssetLocation)
{
AssetLocation location = (AssetLocation)obj;
return location.domain.equals(domain) && location.location.equals(this.location);
}
return false;
} }
@Override @Override
public int compareTo(AssetLocation o) public int compareTo(AssetLocation o) {
{
int result = domain.compareToIgnoreCase(o.domain); int result = domain.compareToIgnoreCase(o.domain);
return result != 0 ? result : location.compareToIgnoreCase(location); return result != 0 ? result : location.compareToIgnoreCase(location);
} }
public boolean matches(AssetLocation location) public boolean matches(AssetLocation location) {
{
return location.domain.equals(domain) && location.location.equals(this.location); return location.domain.equals(domain) && location.location.equals(this.location);
} }
public static final AssetLocation of(String domain, String location) public static final AssetLocation of(String domain, String location) {
{
return of((domain == null || domain.isEmpty() ? "base" : domain)+":"+location); return of((domain == null || domain.isEmpty() ? "base" : domain)+":"+location);
} }
public static final AssetLocation of(String location) public static final AssetLocation of(String location) {
{ return LOCATION.computeIfAbsent(location.indexOf(":") == -1 ? "base:"+location : location, AssetLocation::compute);
return LOCATION.computeIfAbsent(location.indexOf(":") == -1 ? "base:"+location : location, BUILDER);
} }
private static final AssetLocation compute(String s) private static final AssetLocation compute(String s) {
{
int index = s.indexOf(":"); int index = s.indexOf(":");
return new AssetLocation(s.substring(0, index), s.substring(index+1, s.length())); return new AssetLocation(s.substring(0, index), s.substring(index + 1));
} }
} }

View File

@ -1,211 +1,95 @@
package speiger.src.coreengine.assets; package speiger.src.coreengine.assets;
import java.io.File; import java.nio.file.attribute.FileTime;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Map;
import java.util.concurrent.Executor;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.zip.ZipFile;
import speiger.src.collections.objects.lists.ObjectArrayList; import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.collections.objects.maps.impl.hash.Object2ObjectLinkedOpenHashMap; import speiger.src.collections.objects.lists.ObjectList;
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap; import speiger.src.collections.objects.utils.ObjectLists;
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap.Entry; import speiger.src.coreengine.assets.base.IAsset;
import speiger.src.collections.objects.sets.ObjectLinkedOpenHashSet; import speiger.src.coreengine.assets.base.IAssetPackage;
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps; import speiger.src.coreengine.assets.base.IAssetProvider.ICloseableAssetProvider;
import speiger.src.coreengine.assets.impl.FolderAssetPackage; import speiger.src.coreengine.assets.base.IManagedAsset;
import speiger.src.coreengine.assets.impl.ZipAssetPackage; import speiger.src.coreengine.assets.base.IReloadableAsset;
import speiger.src.coreengine.assets.reloader.IReloadableResource; import speiger.src.coreengine.assets.base.MultiAsset;
import speiger.src.coreengine.assets.base.PackReloadingTask;
import speiger.src.coreengine.assets.impl.LayeredAssetProvider;
public class AssetManager implements IReloadableResource public class AssetManager implements ICloseableAssetProvider
{ {
Object2ObjectMap<String, DomainAssets> domains = new Object2ObjectLinkedOpenHashMap<>(); ObjectList<IReloadableAsset> listeners = new ObjectArrayList<>();
Object2ObjectMap<Class<?>, IAssetParser<?>> parsers = new Object2ObjectLinkedOpenHashMap<>(); LayeredAssetProvider provider;
Path path;
public AssetManager(File file) public AssetManager(List<IAssetPackage> packages) {
{ provider = new LayeredAssetProvider(packages);
this(file.toPath());
} }
public AssetManager(Path path) public void addListener(IReloadableAsset listener) {
{ listeners.add(listener);
this.path = path; if(listener instanceof IManagedAsset managed) {
managed.setProvider(this);
}
} }
public Path getMainAsset() public ObjectList<IReloadableAsset> listeners() {
{ return ObjectLists.unmodifiable(listeners);
return path;
} }
public <T> void registerAssetParser(Class<T> clz, IAssetParser<T> parser)
{ public AssetManager reload(Executor offthread, Executor syncer, List<IAssetPackage> packages) {
if(clz == null || parser == null) return; return reloadAssets(packages).reloadSelective(offthread, syncer, listeners);
parsers.put(clz, parser); }
public AssetManager reload(Executor offthread, Executor syncer) {
return reloadSelective(offthread, syncer, listeners);
}
public AssetManager reloadSelective(Executor offthread, Executor syncer, List<IReloadableAsset> listeners) {
PackReloadingTask.reload(provider, listeners, offthread, syncer).join();
return this;
}
public AssetManager reloadAssets(List<IAssetPackage> packages) {
provider.close();
provider = new LayeredAssetProvider(packages);
return this;
} }
@Override @Override
public void reload() public void close() {
{ provider.close();
domains.clear(); listeners.forEach(IReloadableAsset::destroy);
loadAssetPackage(path);
} }
public void loadAssetPackage(File file) @Override
{ public FileTime getModifiedTime(AssetLocation location) {
loadAssetPackage(file.toPath()); return provider.getModifiedTime(location);
} }
public void loadAssetPackage(Path path) @Override
{ public FileTime getLatestTime(AssetLocation... locations) {
if(Files.notExists(path)) return; return provider.getLatestTime(locations);
if(Files.isDirectory(path)) loadAssets(new FolderAssetPackage(path));
else if(isZipFile(path)) loadAssets(new ZipAssetPackage(path));
} }
public void loadAssets(IAssetPackage packages) @Override
{ public IAsset getAsset(AssetLocation location) {
for(String s : packages.getDomains()) return provider.getAsset(location);
{
DomainAssets entry = domains.get(s);
if(entry == null)
{
entry = new DomainAssets();
domains.put(s, entry);
}
entry.addAssets(packages);
}
packages.setParsers(parsers);
} }
public Set<String> getDomains() @Override
{ public MultiAsset getAllAssets(AssetLocation location) {
return domains.keySet(); return provider.getAllAssets(location);
} }
public IAsset getAsset(AssetLocation location) throws IOException @Override
{ public Map<AssetLocation, IAsset> listAssets(String folder, Predicate<AssetLocation> filter) {
DomainAssets asset = domains.get(location.getDomain()); return provider.listAssets(folder, filter);
if(asset == null)
{
throw new FileNotFoundException("Domain & File["+location.toString()+"] not found");
}
return asset.getAsset(location);
} }
public MultiAsset getAssets(AssetLocation...locations) @Override
{ public Map<AssetLocation, MultiAsset> listAllAssets(String folder, Predicate<AssetLocation> filter) {
IAsset[] asset = new IAsset[locations.length]; return provider.listAllAssets(folder, filter);
for(int i = 0,m=locations.length;i<m;i++)
{
try
{
asset[i] = getAsset(locations[i]);
}
catch(Exception e) {e.printStackTrace();}
}
return new MultiAsset(asset);
}
public MultiAsset getMultiAsset(AssetLocation location, AssetLocation...subLocations) throws IOException
{
DomainAssets asset = domains.get(location.getDomain());
if(asset == null)
{
throw new FileNotFoundException("Domain & File["+location.toString()+"] not found");
}
return asset.getMultiAsset(location, subLocations);
}
public MultiAsset getAllAsset(AssetLocation location) throws IOException
{
DomainAssets asset = domains.get(location.getDomain());
if(asset == null)
{
throw new FileNotFoundException("Domain & File["+location.toString()+"] not found");
}
return asset.getAllAssets(location);
}
public Collection<AssetLocation> gatherAssets(String location, int maxDepth, Predicate<String> filter)
{
Set<AssetLocation> result = new ObjectLinkedOpenHashSet<>();
for(Entry<String, DomainAssets> asset : Object2ObjectMaps.fastIterable(domains))
{
asset.getValue().gatherAssets(AssetLocation.of(asset.getKey(), location), maxDepth, filter, result);
}
return result;
}
protected boolean isZipFile(Path file)
{
try(ZipFile zip = new ZipFile(file.toFile())) { return true; }
catch(Exception e) { return false; }
}
static class DomainAssets
{
List<IAssetPackage> packages = new ObjectArrayList<IAssetPackage>();
public void addAssets(IAssetPackage assets)
{
packages.add(assets);
}
public IAsset getAsset(AssetLocation location) throws IOException
{
for(int i = packages.size() - 1;i>=0;i--)
{
IAsset asset = packages.get(i).getAsset(location);
if(asset != null) return asset;
}
throw new FileNotFoundException("File["+location.toString()+"] not found");
}
public MultiAsset getMultiAsset(AssetLocation location, AssetLocation... subLocations)
{
for(int i = packages.size() - 1;i>=0;i--)
{
IAssetPackage entry = packages.get(i);
IAsset asset = entry.getAsset(location);
if(asset != null)
{
IAsset[] result = new IAsset[1 + subLocations.length];
result[0] = asset;
for(int x = 0;x<subLocations.length;x++)
{
result[x+1] = entry.getAsset(subLocations[x]);
}
return new MultiAsset(result);
}
}
return null;
}
public MultiAsset getAllAssets(AssetLocation location) throws IOException
{
List<IAsset> assets = new ObjectArrayList<IAsset>();
for(IAssetPackage entry : packages)
{
IAsset asset = entry.getAsset(location);
if(asset != null) assets.add(asset);
}
if(assets.isEmpty())
{
throw new FileNotFoundException("File["+location.toString()+"] not found");
}
return new MultiAsset(assets.toArray(new IAsset[assets.size()]));
}
public void gatherAssets(AssetLocation folder, int maxDepth, Predicate<String> filter, Collection<AssetLocation> result)
{
for(IAssetPackage entry : packages)
{
entry.getAllAssets(folder, filter, maxDepth, result);
}
}
} }
} }

View File

@ -1,29 +0,0 @@
package speiger.src.coreengine.assets;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import com.google.gson.JsonObject;
public interface IAsset extends Closeable
{
public AssetLocation getLocation();
public IAsset subAsset(String alternative);
public InputStream getStream() throws IOException;
public ByteBuffer getBytes() throws IOException;
public BufferedReader getStringReader() throws IOException;
public JsonObject getJsonObject() throws IOException;
public BufferedImage getTexture() throws Exception;
public <T> T getCustom(Class<T> clz) throws IOException;
}

View File

@ -1,14 +0,0 @@
package speiger.src.coreengine.assets;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
public interface IAssetPackage
{
public void setParsers(Function<Class<?>, IAssetParser<?>> parsers);
public List<String> getDomains();
public IAsset getAsset(AssetLocation location);
public void getAllAssets(AssetLocation folder, Predicate<String> fileNames, int maxDepth, Collection<AssetLocation> result);
}

View File

@ -1,38 +0,0 @@
package speiger.src.coreengine.assets;
import java.io.Closeable;
import java.io.IOException;
public class MultiAsset implements Closeable
{
IAsset[] assets;
public MultiAsset(IAsset[] assets)
{
this.assets = assets;
}
@Override
public void close() throws IOException
{
if(assets != null)
{
for(int i = 0,m=assets.length;i<m;i++)
{
if(assets[i] != null) assets[i].close();
}
assets = null;
}
}
public int size()
{
return assets.length;
}
public IAsset getAsset(int index)
{
return assets[index];
}
}

View File

@ -0,0 +1,29 @@
package speiger.src.coreengine.assets.base;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.List;
import com.google.gson.JsonObject;
import speiger.src.coreengine.assets.AssetLocation;
public interface IAsset extends Closeable
{
public IAssetPackage owner();
public AssetLocation location();
@Override
public void close();
public IAsset subAsset(String alternative);
public InputStream stream() throws IOException;
public ByteBuffer bytes() throws IOException;
public BufferedReader reader() throws IOException;
public List<String> lines() throws IOException;
public JsonObject json() throws IOException;
public BufferedImage texture() throws Exception;
public <T> T custom(IAssetParser<T> parser) throws IOException;
}

View File

@ -0,0 +1,31 @@
package speiger.src.coreengine.assets.base;
import java.io.Closeable;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
import java.util.List;
import java.util.function.BiConsumer;
import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.impl.FolderAssetPackage;
import speiger.src.coreengine.assets.impl.ZipAssetPackage;
import speiger.src.coreengine.utils.helpers.IOUtils;
public interface IAssetPackage extends Closeable
{
@Override
public void close();
public void getModifiedTime(String domain, BiConsumer<AssetLocation, FileTime> accept);
public List<String> getDomains();
public IAsset getAsset(AssetLocation location);
public void gatherAssets(AssetLocation folder, BiConsumer<AssetLocation, IAsset> accept);
public static IAssetPackage of(Path path) {
if(Files.exists(path)) {
if(Files.isDirectory(path)) return new FolderAssetPackage(path);
if(IOUtils.isZip(path)) return new ZipAssetPackage(path);
}
return null;
}
}

View File

@ -1,4 +1,4 @@
package speiger.src.coreengine.assets; package speiger.src.coreengine.assets.base;
import java.io.Closeable; import java.io.Closeable;
import java.io.IOException; import java.io.IOException;

View File

@ -0,0 +1,22 @@
package speiger.src.coreengine.assets.base;
import java.nio.file.attribute.FileTime;
import java.util.Map;
import java.util.function.Predicate;
import speiger.src.coreengine.assets.AssetLocation;
public interface IAssetProvider {
public IAsset getAsset(AssetLocation location);
public MultiAsset getAllAssets(AssetLocation location);
public FileTime getModifiedTime(AssetLocation location);
public FileTime getLatestTime(AssetLocation...locations);
public Map<AssetLocation, IAsset> listAssets(String folder, Predicate<AssetLocation> filter);
public Map<AssetLocation, MultiAsset> listAllAssets(String folder, Predicate<AssetLocation> filter);
public static interface ICloseableAssetProvider extends IAssetProvider, AutoCloseable {
@Override
public void close();
}
}

View File

@ -0,0 +1,5 @@
package speiger.src.coreengine.assets.base;
public interface IManagedAsset {
public void setProvider(IAssetProvider provider);
}

View File

@ -0,0 +1,23 @@
package speiger.src.coreengine.assets.base;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
public interface IReloadableAsset {
public String getName();
public CompletableFuture<Void> reloadAssets(IAssetProvider provider, IReloadSyncer syncer, Executor offthreadExectutor, Executor syncExecutor);
public void destroy();
public static interface IReloadSyncer {
public <T> CompletableFuture<T> sync(T value);
}
public static interface ISimpleRealodableAsset extends IReloadableAsset {
@Override
default CompletableFuture<Void> reloadAssets(IAssetProvider provider, IReloadSyncer syncer, Executor offthreadExectutor, Executor syncExecutor) {
return syncer.sync(null).thenRunAsync(() -> onAssetsReloaded(provider), syncExecutor);
}
public void onAssetsReloaded(IAssetProvider provider);
}
}

View File

@ -0,0 +1,59 @@
package speiger.src.coreengine.assets.base;
import java.io.Closeable;
import java.util.function.Consumer;
import speiger.src.collections.ints.functions.consumer.IntObjectConsumer;
import speiger.src.collections.objects.collections.ObjectIterable;
import speiger.src.collections.objects.collections.ObjectIterator;
import speiger.src.collections.objects.functions.consumer.ObjectObjectConsumer;
import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.collections.objects.lists.ObjectList;
public class MultiAsset implements Closeable, ObjectIterable<IAsset> {
ObjectList<IAsset> assets;
public MultiAsset(IAsset...assets) {
this(ObjectArrayList.wrap(assets));
}
public MultiAsset(ObjectList<IAsset> assets) {
this.assets = assets.unmodifiable();
}
@Override
public void close() {
if(assets != null) {
assets.forEach(IAsset::close);
assets = null;
}
}
public int size() {
return assets.size();
}
public IAsset get(int index) {
return assets.get(index);
}
@Override
public void forEach(Consumer<? super IAsset> action) {
assets.forEach(action);
}
@Override
public <E> void forEach(E input, ObjectObjectConsumer<E, IAsset> action) {
assets.forEach(input, action);
}
@Override
public void forEachIndexed(IntObjectConsumer<IAsset> action) {
assets.forEachIndexed(action);
}
@Override
public ObjectIterator<IAsset> iterator() {
return assets.iterator();
}
}

View File

@ -0,0 +1,51 @@
package speiger.src.coreengine.assets.base;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.collections.objects.sets.ObjectOpenHashSet;
import speiger.src.coreengine.assets.base.IReloadableAsset.IReloadSyncer;
public class PackReloadingTask {
public static CompletableFuture<?> reload(IAssetProvider provider, List<IReloadableAsset> assets, Executor offthreadTask, Executor mainThreadTask) {
CompletableFuture<Object> syncStep = new CompletableFuture<>();
List<CompletableFuture<?>> results = new ObjectArrayList<>();
CompletableFuture<?> currentStep = CompletableFuture.completedFuture("");
Set<IReloadableAsset> toComplete = new ObjectOpenHashSet<>(assets);
for(IReloadableAsset asset : assets) {
CompletableFuture<?> next = asset.reloadAssets(provider, new Syncer(mainThreadTask, currentStep, syncStep, asset, toComplete), offthreadTask, mainThreadTask);
results.add(next);
currentStep = next;
}
return CompletableFuture.allOf(results.toArray(CompletableFuture[]::new));
}
private static class Syncer implements IReloadSyncer {
Executor mainExecutor;
CompletableFuture<?> currentStep;
CompletableFuture<Object> syncStep;
IReloadableAsset currentAsset;
Set<IReloadableAsset> toComplete;
public Syncer(Executor mainExecutor, CompletableFuture<?> currentStep, CompletableFuture<Object> syncStep, IReloadableAsset currentAsset, Set<IReloadableAsset> toComplete) {
this.mainExecutor = mainExecutor;
this.currentStep = currentStep;
this.syncStep = syncStep;
this.currentAsset = currentAsset;
this.toComplete = toComplete;
}
@Override
public <T> CompletableFuture<T> sync(T value) {
mainExecutor.execute(() -> {
if(toComplete.remove(currentAsset) && toComplete.isEmpty()) {
syncStep.complete(new Object());
}
});
return syncStep.thenCombine(currentStep, (k, v) -> value);
}
}
}

View File

@ -0,0 +1,14 @@
package speiger.src.coreengine.assets.base;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
public abstract class SteppedReloadableAsset<T> implements IReloadableAsset {
@Override
public final CompletableFuture<Void> reloadAssets(IAssetProvider provider, IReloadSyncer syncer, Executor offthreadExectutor, Executor syncExecutor) {
return CompletableFuture.supplyAsync(() -> prepare(provider), offthreadExectutor).thenCompose(syncer::sync).thenAcceptAsync(T -> apply(T, provider), syncExecutor);
}
protected abstract T prepare(IAssetProvider provider);
protected abstract void apply(T value, IAssetProvider provider);
}

View File

@ -0,0 +1,44 @@
package speiger.src.coreengine.assets.impl;
import java.io.Closeable;
import java.util.List;
import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.base.IAsset;
import speiger.src.coreengine.assets.base.IAssetPackage;
public abstract class BaseAsset implements IAsset {
protected AssetLocation location;
protected IAssetPackage owner;
protected List<Closeable> closeable = new ObjectArrayList<>();
public BaseAsset(AssetLocation location, IAssetPackage owner) {
this.location = location;
this.owner = owner;
}
@Override
public void close() {
for(Closeable close : closeable) {
try { close.close(); }
catch(Exception e) { e.printStackTrace(); }
}
closeable.clear();
}
protected <T extends Closeable> T markClosed(T value) {
closeable.add(value);
return value;
}
@Override
public AssetLocation location() {
return location;
}
@Override
public IAssetPackage owner() {
return owner;
}
}

View File

@ -1,115 +0,0 @@
package speiger.src.coreengine.assets.impl;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.function.Function;
import javax.imageio.ImageIO;
import com.google.gson.JsonObject;
import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.IAsset;
import speiger.src.coreengine.assets.IAssetParser;
import speiger.src.coreengine.utils.helpers.JsonUtil;
public class FolderAsset implements IAsset
{
Function<Class<?>, IAssetParser<?>> parsers;
AssetLocation location;
Path path;
List<Closeable> closeable;
public FolderAsset(AssetLocation location, Path path, Function<Class<?>, IAssetParser<?>> parsers)
{
this(location, path, parsers, new ObjectArrayList<>());
}
public FolderAsset(AssetLocation location, Path path, Function<Class<?>, IAssetParser<?>> parsers, List<Closeable> closeable)
{
this.location = location;
this.path = path;
this.parsers = parsers;
this.closeable = closeable;
}
@Override
public void close() throws IOException
{
for(Closeable close : closeable)
{
try
{
close.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
closeable.clear();
}
@Override
public IAsset subAsset(String alternative)
{
Path newPath = path.resolveSibling(path.getFileName().toString()+"."+alternative);
return Files.exists(newPath) ? new FolderAsset(location.alternate(alternative), newPath, parsers, closeable) : null;
}
@Override
public AssetLocation getLocation()
{
return location;
}
@Override
public InputStream getStream() throws IOException
{
return markClosed(Files.newInputStream(path));
}
@Override
public ByteBuffer getBytes() throws IOException
{
return ByteBuffer.wrap(Files.readAllBytes(path));
}
@Override
public BufferedImage getTexture() throws Exception
{
return ImageIO.read(getStream());
}
@Override
public BufferedReader getStringReader() throws IOException
{
return markClosed(Files.newBufferedReader(path));
}
@Override
public JsonObject getJsonObject() throws IOException
{
return JsonUtil.loadFile(path);
}
@Override
public <T> T getCustom(Class<T> clz) throws IOException
{
return clz.cast(parsers.apply(clz).parseAsset(path, closeable::add));
}
protected <T extends Closeable> T markClosed(T value)
{
closeable.add(value);
return value;
}
}

View File

@ -1,83 +1,70 @@
package speiger.src.coreengine.assets.impl; package speiger.src.coreengine.assets.impl;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.DirectoryStream; import java.nio.file.DirectoryStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Collection; import java.nio.file.attribute.FileTime;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.BiConsumer;
import java.util.function.Predicate;
import java.util.stream.Stream; import java.util.stream.Stream;
import speiger.src.collections.objects.lists.ObjectArrayList; import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.coreengine.assets.AssetLocation; import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.IAsset; import speiger.src.coreengine.assets.base.IAsset;
import speiger.src.coreengine.assets.IAssetPackage; import speiger.src.coreengine.assets.base.IAssetPackage;
import speiger.src.coreengine.assets.IAssetParser;
import speiger.src.coreengine.utils.collections.iterators.IterableWrapper; import speiger.src.coreengine.utils.collections.iterators.IterableWrapper;
public class FolderAssetPackage implements IAssetPackage public class FolderAssetPackage implements IAssetPackage {
{
Path baseFolder; Path baseFolder;
Function<Class<?>, IAssetParser<?>> parsers;
public FolderAssetPackage(File baseFolder) public FolderAssetPackage(Path baseFolder) {
{
this(baseFolder.toPath());
}
public FolderAssetPackage(Path baseFolder)
{
this.baseFolder = baseFolder; this.baseFolder = baseFolder;
} }
@Override @Override
public void setParsers(Function<Class<?>, IAssetParser<?>> parsers) public void close() {}
{
this.parsers = parsers; @Override
public void getModifiedTime(String domain, BiConsumer<AssetLocation, FileTime> accept) {
try {
Path start = baseFolder.resolve("assets");
for(Path path : IterableWrapper.wrap(Files.walk(start.resolve(domain)).filter(Files::isRegularFile).iterator())) {
accept.accept(AssetLocation.of(domain, start.relativize(path).toString().replace("\\", "/")), Files.getLastModifiedTime(path));
}
}
catch(IOException e) { e.printStackTrace(); }
} }
@Override @Override
public List<String> getDomains() public List<String> getDomains() {
{
List<String> domains = new ObjectArrayList<>(); List<String> domains = new ObjectArrayList<>();
try(DirectoryStream<Path> dirs = Files.newDirectoryStream(baseFolder.resolve("assets"))) try(DirectoryStream<Path> dirs = Files.newDirectoryStream(baseFolder.resolve("assets"))) {
{ for(Path path : dirs) {
for(Path path : dirs)
{
domains.add(path.getFileName().toString()); domains.add(path.getFileName().toString());
} }
} }
catch(IOException e) catch(IOException e) { e.printStackTrace(); }
{
e.printStackTrace();
}
return domains; return domains;
} }
@Override @Override
public IAsset getAsset(AssetLocation location) public IAsset getAsset(AssetLocation location) {
{ Path path = baseFolder.resolve(location.actualLocation());
Path path = baseFolder.resolve(location.getActualLocation()); return Files.exists(path) ? new SimpleAsset(location, this, path) : null;
return Files.exists(path) ? new FolderAsset(location, path, parsers) : null;
} }
@Override @Override
public void getAllAssets(AssetLocation folder, Predicate<String> fileNames, int maxDepth, Collection<AssetLocation> result) public void gatherAssets(AssetLocation folder, BiConsumer<AssetLocation, IAsset> result) {
{ Path start = baseFolder.resolve(folder.actualLocation());
Path start = baseFolder.resolve(folder.getActualLocation());
if(Files.notExists(start)) return; if(Files.notExists(start)) return;
try(Stream<Path> stream = Files.walk(start, maxDepth).filter(Files::isRegularFile).filter(T -> fileNames.test(T.getFileName().toString()))) try(Stream<Path> stream = Files.walk(start).filter(Files::isRegularFile)) {
{ for(Path path : IterableWrapper.wrap(stream.iterator())) {
for(Path path : IterableWrapper.wrap(stream.iterator())) AssetLocation location = folder.subAsset(start.relativize(path).toString().replace("\\", "/"));
{ result.accept(location, new SimpleAsset(location, this, path));
result.add(folder.subAsset(start.relativize(path).toString().replace("\\", "/")));
} }
} }
catch(IOException e) catch(IOException e) {
{
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -0,0 +1,161 @@
package speiger.src.coreengine.assets.impl;
import java.nio.file.attribute.FileTime;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.collections.objects.lists.ObjectList;
import speiger.src.collections.objects.maps.interfaces.Object2ObjectMap;
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps;
import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.base.IAsset;
import speiger.src.coreengine.assets.base.IAssetPackage;
import speiger.src.coreengine.assets.base.IAssetProvider;
import speiger.src.coreengine.assets.base.IAssetProvider.ICloseableAssetProvider;
import speiger.src.coreengine.assets.base.MultiAsset;
import speiger.src.coreengine.math.ArrayUtil;
public class LayeredAssetProvider implements ICloseableAssetProvider {
public static final FileTime DEFAULT_TIME = FileTime.fromMillis(0L);
Map<String, DomainAssetProvider> domains = Object2ObjectMap.builder().linkedMap();
List<IAssetPackage> packages;
public LayeredAssetProvider(List<IAssetPackage> packages) {
this.packages = packages;
for(IAssetPackage pack : packages) {
for(String domain : pack.getDomains()) {
domains.computeIfAbsent(domain, DomainAssetProvider::new).addPackage(pack);
}
}
domains.values().forEach(DomainAssetProvider::buildCaches);
}
@Override
public void close() {
packages.forEach(IAssetPackage::close);
}
@Override
public FileTime getModifiedTime(AssetLocation location) {
DomainAssetProvider provider = domains.get(location.domain());
return provider == null ? DEFAULT_TIME : provider.getModifiedTime(location);
}
@Override
public FileTime getLatestTime(AssetLocation... locations) {
FileTime time = DEFAULT_TIME;
for(AssetLocation location : locations) {
time = ArrayUtil.higher(time, getModifiedTime(location));
}
return time;
}
@Override
public IAsset getAsset(AssetLocation location) {
DomainAssetProvider provider = domains.get(location.domain());
return provider == null ? null : provider.getAsset(location);
}
@Override
public MultiAsset getAllAssets(AssetLocation location) {
DomainAssetProvider provider = domains.get(location.domain());
return provider == null ? null : provider.getAllAssets(location);
}
@Override
public Map<AssetLocation, IAsset> listAssets(String folder, Predicate<AssetLocation> filter) {
Map<AssetLocation, IAsset> result = Object2ObjectMap.builder().linkedMap();
for(DomainAssetProvider provider : domains.values()) {
result.putAll(provider.listAssets(folder, filter));
}
return result;
}
@Override
public Map<AssetLocation, MultiAsset> listAllAssets(String folder, Predicate<AssetLocation> filter) {
Map<AssetLocation, MultiAsset> result = Object2ObjectMap.builder().linkedMap();
for(DomainAssetProvider provider : domains.values()) {
result.putAll(provider.listAllAssets(folder, filter));
}
return result;
}
private static class DomainAssetProvider implements IAssetProvider {
final String domain;
ObjectList<IAssetPackage> packages = new ObjectArrayList<>();
Map<AssetLocation, FileTime> lastChanges = Object2ObjectMap.builder().map();
public DomainAssetProvider(String domain) {
this.domain = domain;
}
public void addPackage(IAssetPackage pack) {
packages.add(pack);
}
private void buildCaches() {
for(int i = packages.size()-1;i>=0;i--) {
packages.get(i).getModifiedTime(domain, lastChanges::putIfAbsent);
}
}
@Override
public FileTime getModifiedTime(AssetLocation location) {
return lastChanges.getOrDefault(location, DEFAULT_TIME);
}
@Override
public FileTime getLatestTime(AssetLocation... locations) {
throw new UnsupportedOperationException();
}
@Override
public IAsset getAsset(AssetLocation location) {
for(int i = packages.size()-1;i>=0;i--) {
IAsset asset = packages.get(i).getAsset(location);
if(asset != null) return asset;
}
return null;
}
@Override
public MultiAsset getAllAssets(AssetLocation location) {
ObjectList<IAsset> result = new ObjectArrayList<>();
for(int i = packages.size()-1;i>=0;i--) {
IAsset asset = packages.get(i).getAsset(location);
if(asset != null) result.add(asset);
}
return new MultiAsset(result);
}
@Override
public Map<AssetLocation, IAsset> listAssets(String folder, Predicate<AssetLocation> filter) {
AssetLocation base = AssetLocation.of(domain, folder);
Map<AssetLocation, IAsset> result = Object2ObjectMap.builder().linkedMap();
for(int i = packages.size()-1;i>=0;i--) {
packages.get(i).gatherAssets(base, (K, V) -> {
if(filter.test(K)) result.putIfAbsent(K, V);
});
}
return result;
}
@Override
public Map<AssetLocation, MultiAsset> listAllAssets(String folder, Predicate<AssetLocation> filter) {
AssetLocation base = AssetLocation.of(domain, folder);
Object2ObjectMap<AssetLocation, ObjectList<IAsset>> assets = Object2ObjectMap.builder().linkedMap();
for(int i = packages.size()-1;i>=0;i--) {
packages.get(i).gatherAssets(base, (K, V) -> {
if(filter.test(K)) assets.supplyIfAbsent(K, ObjectArrayList::new).add(V);
});
}
Map<AssetLocation, MultiAsset> result = Object2ObjectMap.builder().linkedMap();
for(Object2ObjectMap.Entry<AssetLocation, ObjectList<IAsset>> entry : Object2ObjectMaps.fastIterable(assets)) {
result.put(entry.getKey(), new MultiAsset(entry.getValue()));
}
return result;
}
}
}

View File

@ -0,0 +1,51 @@
package speiger.src.coreengine.assets.impl;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import javax.imageio.ImageIO;
import com.google.gson.JsonObject;
import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.base.IAsset;
import speiger.src.coreengine.assets.base.IAssetPackage;
import speiger.src.coreengine.assets.base.IAssetParser;
import speiger.src.coreengine.utils.helpers.JsonUtil;
public class SimpleAsset extends BaseAsset {
Path path;
public SimpleAsset(AssetLocation location, IAssetPackage owner, Path path) {
super(location, owner);
this.path = path;
}
@Override
public IAsset subAsset(String alternative) {
Path newPath = path.resolveSibling(path.getFileName().toString()+"."+alternative);
return Files.exists(newPath) ? new SimpleAsset(location.alternate(alternative), owner, newPath) : null;
}
@Override
public InputStream stream() throws IOException { return markClosed(Files.newInputStream(path)); }
@Override
public ByteBuffer bytes() throws IOException { return ByteBuffer.wrap(Files.readAllBytes(path)); }
@Override
public BufferedImage texture() throws Exception { return ImageIO.read(stream()); }
@Override
public BufferedReader reader() throws IOException { return markClosed(Files.newBufferedReader(path)); }
@Override
public List<String> lines() throws IOException { return Files.readAllLines(path); }
@Override
public JsonObject json() throws IOException { return JsonUtil.loadFile(path); }
@Override
public <T> T custom(IAssetParser<T> parser) throws IOException { return parser.parseAsset(path, closeable::add); }
}

View File

@ -1,103 +0,0 @@
package speiger.src.coreengine.assets.impl;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.function.Function;
import javax.imageio.ImageIO;
import com.google.gson.JsonObject;
import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.IAsset;
import speiger.src.coreengine.assets.IAssetParser;
import speiger.src.coreengine.utils.helpers.JsonUtil;
public class ZipAsset implements IAsset
{
Runnable closer;
AssetLocation location;
Path path;
Function<Class<?>, IAssetParser<?>> parsers;
public ZipAsset(Runnable closer, AssetLocation location, Path path, Function<Class<?>, IAssetParser<?>> parsers)
{
this.closer = closer;
this.location = location;
this.path = path;
this.parsers = parsers;
}
@Override
public void close() throws IOException
{
if(closer != null)
{
closer.run();
closer = null;
}
}
private void closeInternal()
{
if(closer != null)
{
closer.run();
closer = null;
}
}
@Override
public IAsset subAsset(String alternative)
{
if(closer == null) return null;
Path newPath = path.resolveSibling(path.getFileName().toString()+"."+alternative);
return Files.exists(newPath) ? new ZipAsset(this::closeInternal, location.alternate(alternative), newPath, parsers) : null;
}
@Override
public AssetLocation getLocation()
{
return location;
}
@Override
public InputStream getStream() throws IOException
{
return Files.newInputStream(path);
}
@Override
public ByteBuffer getBytes() throws IOException
{
return ByteBuffer.wrap(Files.readAllBytes(path));
}
@Override
public BufferedImage getTexture() throws Exception
{
return ImageIO.read(getStream());
}
@Override
public BufferedReader getStringReader() throws IOException
{
return Files.newBufferedReader(path);
}
@Override
public JsonObject getJsonObject() throws IOException
{
return JsonUtil.loadFile(path);
}
@Override
public <T> T getCustom(Class<T> clz) throws IOException
{
return clz.cast(parsers.apply(clz).parseAsset(path, T -> {}));
}
}

View File

@ -1,116 +1,107 @@
package speiger.src.coreengine.assets.impl; package speiger.src.coreengine.assets.impl;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.DirectoryStream; import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem; import java.nio.file.FileSystem;
import java.nio.file.FileSystems; import java.nio.file.FileSystems;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Collection; import java.nio.file.attribute.FileTime;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Stream; import java.util.stream.Stream;
import speiger.src.collections.objects.lists.ObjectArrayList; import speiger.src.collections.objects.lists.ObjectArrayList;
import speiger.src.coreengine.assets.AssetLocation; import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.IAsset; import speiger.src.coreengine.assets.base.IAsset;
import speiger.src.coreengine.assets.IAssetPackage; import speiger.src.coreengine.assets.base.IAssetPackage;
import speiger.src.coreengine.assets.IAssetParser;
import speiger.src.coreengine.utils.collections.iterators.IterableWrapper; import speiger.src.coreengine.utils.collections.iterators.IterableWrapper;
public class ZipAssetPackage implements IAssetPackage public class ZipAssetPackage implements IAssetPackage {
{
Path baseFolder; Path baseFolder;
Function<Class<?>, IAssetParser<?>> parsers;
FileSystem cache; FileSystem cache;
AtomicInteger usedReferences = new AtomicInteger();
Runnable referenceCleaner = this::cleanReference;
public ZipAssetPackage(File file) public ZipAssetPackage(Path baseFolder) {
{
this(file.toPath());
}
public ZipAssetPackage(Path baseFolder)
{
this.baseFolder = baseFolder; this.baseFolder = baseFolder;
} }
@Override @Override
public void setParsers(Function<Class<?>, IAssetParser<?>> parsers) public void close() {
{ if(cache != null) {
this.parsers = parsers;
}
private void cleanReference()
{
int left = usedReferences.decrementAndGet();
if(left == 0 && cache != null)
{
try { cache.close(); } try { cache.close(); }
catch(Exception e) {e.printStackTrace();} catch(Exception e) { e.printStackTrace(); }
cache = null; cache = null;
} }
else if(left < 0) usedReferences.set(0);
} }
protected FileSystem getReference() throws IOException @Override
{ public void getModifiedTime(String domain, BiConsumer<AssetLocation, FileTime> accept) {
usedReferences.getAndIncrement(); try {
try(FileSystem system = FileSystems.newFileSystem(baseFolder)) {
Path start = system.getPath("assets");
for(Path path : IterableWrapper.wrap(Files.walk(start.resolve(domain)).filter(Files::isRegularFile).iterator())) {
accept.accept(AssetLocation.of(domain, start.relativize(path).toString().replace("\\", "/")), Files.getLastModifiedTime(path));
}
}
}
catch(IOException e) { e.printStackTrace(); }
}
protected FileSystem getReference() throws IOException {
if(cache == null) cache = FileSystems.newFileSystem(baseFolder); if(cache == null) cache = FileSystems.newFileSystem(baseFolder);
return cache; return cache;
} }
@Override @Override
public List<String> getDomains() public List<String> getDomains() {
{
List<String> domains = new ObjectArrayList<>(); List<String> domains = new ObjectArrayList<>();
try(FileSystem system = FileSystems.newFileSystem(baseFolder)) try(FileSystem system = FileSystems.newFileSystem(baseFolder)) {
{ try(DirectoryStream<Path> dirs = Files.newDirectoryStream(system.getPath("assets"))) {
try(DirectoryStream<Path> dirs = Files.newDirectoryStream(system.getPath("assets"))) for(Path path : dirs) {
{
for(Path path : dirs)
{
String s = path.getFileName().toString(); String s = path.getFileName().toString();
domains.add(s.substring(0, s.length()-1)); domains.add(s.substring(0, s.length() - 1));
} }
} }
catch(Exception e) { e.printStackTrace(); } catch(Exception e) {
e.printStackTrace();
}
}
catch(Exception e) {
e.printStackTrace();
} }
catch(Exception e) { e.printStackTrace(); }
return domains; return domains;
} }
@Override @Override
public IAsset getAsset(AssetLocation location) public IAsset getAsset(AssetLocation location) {
{ try {
try Path path = getReference().getPath(location.actualLocation());
{ return Files.exists(path) ? new SimpleAsset(location, this, path) : null;
Path path = getReference().getPath(location.getActualLocation()); }
return Files.exists(path) ? new ZipAsset(referenceCleaner, location, path, parsers) : null; catch(Exception e) {
e.printStackTrace();
return null;
} }
catch(Exception e) { return null; }
} }
@Override @Override
public void getAllAssets(AssetLocation folder, Predicate<String> fileNames, int maxDepth, Collection<AssetLocation> result) public void gatherAssets(AssetLocation folder, BiConsumer<AssetLocation, IAsset> result) {
{ try {
try(FileSystem system = FileSystems.newFileSystem(baseFolder)) FileSystem system = getReference();
{ Path start = system.getPath(folder.actualLocation());
Path start = system.getPath(folder.getActualLocation());
if(Files.notExists(start)) return; if(Files.notExists(start)) return;
try(Stream<Path> stream = Files.walk(start, maxDepth).filter(Files::isRegularFile).filter(T -> fileNames.test(T.getFileName().toString()))) try(Stream<Path> stream = Files.walk(start).filter(Files::isRegularFile)) {
{ for(Path path : IterableWrapper.wrap(stream.iterator())) {
for(Path path : IterableWrapper.wrap(stream.iterator())) AssetLocation location = folder.subAsset(start.relativize(path).toString().replace("\\", "/"));
{ result.accept(location, new SimpleAsset(location, this, path));
result.add(folder.subAsset(start.relativize(path).toString().replace("\\", "/")));
} }
} }
catch(IOException e) { e.printStackTrace(); } catch(IOException e) {
e.printStackTrace();
}
}
catch(Exception e) {
e.printStackTrace();
} }
catch(Exception e) { e.printStackTrace(); }
} }
} }

View File

@ -1,21 +1,17 @@
package speiger.src.coreengine.assets.language; package speiger.src.coreengine.assets.language;
public class I18n public class I18n {
{
static Language CURRENT_LANGUAGE; static Language CURRENT_LANGUAGE;
public static boolean has(String key) public static boolean has(String key) {
{
return CURRENT_LANGUAGE.has(key); return CURRENT_LANGUAGE.has(key);
} }
public static String translate(String key) public static String translate(String key) {
{
return CURRENT_LANGUAGE.translate(key); return CURRENT_LANGUAGE.translate(key);
} }
public String translate(String key, Object...args) public String translate(String key, Object... args) {
{
return CURRENT_LANGUAGE.translate(key, args); return CURRENT_LANGUAGE.translate(key, args);
} }
} }

View File

@ -4,50 +4,36 @@ import java.util.Map;
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps; import speiger.src.collections.objects.utils.maps.Object2ObjectMaps;
public class Language public class Language {
{
String language; String language;
String code; String code;
Map<String, String> translations = Object2ObjectMaps.empty(); Map<String, String> translations = Object2ObjectMaps.empty();
public Language(String code, String language) public Language(String code, String language) {
{
this.code = code; this.code = code;
this.language = language; this.language = language;
} }
public void load(Map<String, String> data) public void load(Map<String, String> data) {
{
translations = data; translations = data;
} }
public void clear() public void clear() {
{
translations = Object2ObjectMaps.empty(); translations = Object2ObjectMaps.empty();
} }
public boolean has(String s) public boolean has(String s) {
{
return translations.containsKey(s); return translations.containsKey(s);
} }
public String translate(String key) public String translate(String key) {
{
return translations.getOrDefault(key, key); return translations.getOrDefault(key, key);
} }
public String translate(String key, Object...args) public String translate(String key, Object... args) {
{
return String.format(translate(key), args); return String.format(translate(key), args);
} }
public String getCode() public String getCode() { return code; }
{ public String getLanguage() { return language; }
return code;
}
public String getLanguage()
{
return language;
}
} }

View File

@ -10,108 +10,79 @@ import speiger.src.collections.objects.maps.impl.hash.Object2ObjectOpenHashMap;
import speiger.src.collections.objects.utils.maps.Object2ObjectMaps; import speiger.src.collections.objects.utils.maps.Object2ObjectMaps;
import speiger.src.coreengine.assets.AssetLocation; import speiger.src.coreengine.assets.AssetLocation;
import speiger.src.coreengine.assets.AssetManager; import speiger.src.coreengine.assets.AssetManager;
import speiger.src.coreengine.assets.MultiAsset; import speiger.src.coreengine.assets.base.MultiAsset;
import speiger.src.coreengine.assets.reloader.IReloadableResource; import speiger.src.coreengine.assets.reloader.IReloadableResource;
public class LanguageManager implements IReloadableResource public class LanguageManager implements IReloadableResource {
{
final AssetLocation location = AssetLocation.of("lang"); final AssetLocation location = AssetLocation.of("lang");
Map<String, Language> languages = new Object2ObjectOpenHashMap<>(); Map<String, Language> languages = new Object2ObjectOpenHashMap<>();
AssetManager assets; AssetManager assets;
String currentLanguage; String currentLanguage;
@Override @Override
public void reload() public void reload() {
{
languages.clear(); languages.clear();
try(MultiAsset langs = assets.getAllAsset(location.subAsset("langs.json"))) try(MultiAsset langs = assets.getAllAssets(location.subAsset("langs.json"))) {
{ for(int i = 0,m = langs.size();i < m;i++) {
for(int i = 0,m=langs.size();i<m;i++) preLoadLanguage(langs.get(i).json());
{
preLoadLanguage(langs.getAsset(i).getJsonObject());
} }
} }
catch(Exception e) catch(Exception e) {
{
e.printStackTrace(); e.printStackTrace();
} }
if(loadLanguage(currentLanguage)) if(loadLanguage(currentLanguage)) {
{
I18n.CURRENT_LANGUAGE = languages.get(currentLanguage); I18n.CURRENT_LANGUAGE = languages.get(currentLanguage);
} }
else else {
{
Language dummy = new Language("en_US", "English"); Language dummy = new Language("en_US", "English");
dummy.load(Object2ObjectMaps.empty()); dummy.load(Object2ObjectMaps.empty());
I18n.CURRENT_LANGUAGE = dummy; I18n.CURRENT_LANGUAGE = dummy;
} }
} }
public boolean setLanguage(String lang) public boolean setLanguage(String lang) {
{ if(loadLanguage(lang)) {
if(loadLanguage(lang))
{
I18n.CURRENT_LANGUAGE = languages.get(lang); I18n.CURRENT_LANGUAGE = languages.get(lang);
Language currentLang = languages.get(currentLanguage); Language currentLang = languages.get(currentLanguage);
currentLanguage = lang; currentLanguage = lang;
if(currentLang != null) if(currentLang != null) currentLang.clear();
{
currentLang.clear();
}
return true; return true;
} }
return false; return false;
} }
protected boolean loadLanguage(String loadingLang) protected boolean loadLanguage(String loadingLang) {
{
Language lang = languages.get(loadingLang); Language lang = languages.get(loadingLang);
if(lang == null) if(lang == null) return false;
{
return false;
}
Map<String, String> map = new Object2ObjectOpenHashMap<>(); Map<String, String> map = new Object2ObjectOpenHashMap<>();
loadLanguage(loadingLang, map); loadLanguage(loadingLang, map);
if(loadingLang != "en_US") if(loadingLang != "en_US") loadLanguage("en_US", map);
{
loadLanguage("en_US", map);
}
lang.load(map); lang.load(map);
return true; return true;
} }
protected void loadLanguage(String lang, Map<String, String> data) protected void loadLanguage(String lang, Map<String, String> data) {
{ try(MultiAsset language = assets.getAllAssets(location.subAsset(lang+".lang"))) {
try(MultiAsset language = assets.getAllAsset(location.subAsset(lang+".lang"))) for(int i = 0,m = language.size();i < m;i++) {
{ try {
for(int i = 0,m=language.size();i<m;i++) for(Map.Entry<String, JsonElement> element : language.get(i).json().entrySet()) {
{
try
{
for(Map.Entry<String, JsonElement> element : language.getAsset(i).getJsonObject().entrySet())
{
loadEntry(element.getKey(), element.getValue(), data); loadEntry(element.getKey(), element.getValue(), data);
} }
} }
catch(Exception e) catch(Exception e) {
{
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
catch(Exception e) catch(Exception e) {
{
e.printStackTrace(); e.printStackTrace();
} }
} }
protected void loadEntry(String basePath, JsonElement el, Map<String, String> data) protected void loadEntry(String basePath, JsonElement el, Map<String, String> data) {
{ if(el.isJsonPrimitive()) data.putIfAbsent(basePath, el.getAsString());
if(el.isJsonPrimitive()) data.put(basePath, el.getAsString()); else if(el.isJsonObject()) {
else if(el.isJsonObject()) for(Map.Entry<String, JsonElement> elements : el.getAsJsonObject().entrySet()) {
{
for(Map.Entry<String, JsonElement> elements : el.getAsJsonObject().entrySet())
{
String key = elements.getKey(); String key = elements.getKey();
if(key.isEmpty()) loadEntry(basePath, elements.getValue(), data); if(key.isEmpty()) loadEntry(basePath, elements.getValue(), data);
else loadEntry(basePath+"."+key, elements.getValue(), data); else loadEntry(basePath+"."+key, elements.getValue(), data);
@ -119,31 +90,16 @@ public class LanguageManager implements IReloadableResource
} }
} }
protected void preLoadLanguage(JsonObject object) protected void preLoadLanguage(JsonObject object) {
{
JsonArray array = object.getAsJsonArray("languages"); JsonArray array = object.getAsJsonArray("languages");
if(array == null) if(array == null) return;
{ for(int i = 0,m = array.size();i < m;i++) {
return;
}
for(int i = 0,m=array.size();i<m;i++)
{
JsonArray subArray = array.get(i).getAsJsonArray(); JsonArray subArray = array.get(i).getAsJsonArray();
if(subArray.size() != 2) if(subArray.size() != 2) continue;
{
continue;
}
String key = subArray.get(0).getAsString(); String key = subArray.get(0).getAsString();
String value = subArray.get(1).getAsString(); String value = subArray.get(1).getAsString();
if(key.length() != 2 || value.length() > 16) if(key.length() != 2 || value.length() > 16) continue;
{ languages.computeIfAbsent(key, T -> new Language(key, value));
continue;
}
Language lang = languages.get(key);
if(lang == null)
{
languages.put(key, new Language(key, value));
}
} }
} }

View File

@ -3,6 +3,5 @@ package speiger.src.coreengine.assets.reloader;
public interface IReloadableResource public interface IReloadableResource
{ {
public void reload(); public void reload();
public default void destroy() {}; public default void destroy() {};
} }

View File

@ -1,5 +1,6 @@
package speiger.src.coreengine.assets.reloader; package speiger.src.coreengine.assets.reloader;
import java.util.ServiceLoader;
import java.util.Set; import java.util.Set;
import speiger.src.collections.objects.sets.ObjectLinkedOpenHashSet; import speiger.src.collections.objects.sets.ObjectLinkedOpenHashSet;
@ -10,51 +11,31 @@ public class ResourceReloader
boolean globalRemoval = false; boolean globalRemoval = false;
boolean reloading = false; boolean reloading = false;
public <T extends IReloadableResource> T addReloadableResource(T resource) public <T extends IReloadableResource> T addReloadableResource(T resource) {
{
return addReloadableResource(resource, false); return addReloadableResource(resource, false);
} }
public <T extends IReloadableResource> T addReloadableResource(T resource, boolean init) public <T extends IReloadableResource> T addReloadableResource(T resource, boolean init) {
{ if(resources.add(resource) && init) resource.reload();
if(resources.add(resource) && init)
{
resource.reload();
}
return resource; return resource;
} }
public void removeReloadableResource(IReloadableResource resource) public void removeReloadableResource(IReloadableResource resource) {
{ if(globalRemoval || reloading) return;
if(globalRemoval || reloading)
{
return;
}
resources.remove(resource); resources.remove(resource);
} }
public boolean isReloading() public boolean isReloading() { return reloading; }
{
return reloading;
}
public void reloadResources() public void reloadResources() {
{
reloading = true; reloading = true;
for(IReloadableResource resource : resources) resources.forEach(IReloadableResource::reload);
{
resource.reload();
}
reloading = false; reloading = false;
} }
public void deleteResources() public void deleteResources() {
{
globalRemoval = true; globalRemoval = true;
for(IReloadableResource resource : resources) resources.forEach(IReloadableResource::destroy);
{
resource.destroy();
}
resources.clear(); resources.clear();
globalRemoval = false; globalRemoval = false;
} }

View File

@ -1,76 +1,91 @@
package speiger.src.coreengine.math; package speiger.src.coreengine.math;
import java.nio.ByteBuffer;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.Consumer;
import speiger.src.collections.ints.lists.IntList; import speiger.src.collections.ints.lists.IntList;
import speiger.src.collections.objects.lists.ObjectArrayList; import speiger.src.collections.objects.lists.ObjectArrayList;
public class ArrayUtil public class ArrayUtil {
{ public static int[] fromTo(int from, int to) {
public static int[] fromTo(int from, int to)
{
int[] result = new int[to - from]; int[] result = new int[to - from];
for(int i = 0,m=result.length;i<m;i++) for(int i = 0,m = result.length;i < m;i++) result[i] = from + i;
{
result[i] = from + i;
}
return result; return result;
} }
public static int sum(int...values) public static int sum(int... values) {
{
int result = 0; int result = 0;
for(int index : values) for(int index : values) result += index;
{
result += index;
}
return result; return result;
} }
public static byte[] fill(byte[] array, byte value) public static byte[] fill(byte[] array, byte value) {
{
Arrays.fill(array, value); Arrays.fill(array, value);
return array; return array;
} }
public static short[] fill(short[] array, short value) public static short[] fill(short[] array, short value) {
{
Arrays.fill(array, value); Arrays.fill(array, value);
return array; return array;
} }
public static int[] fill(int[] array, int value) public static int[] fill(int[] array, int value) {
{
Arrays.fill(array, value); Arrays.fill(array, value);
return array; return array;
} }
public static long[] fill(long[] array, long value) public static long[] fill(long[] array, long value) {
{
Arrays.fill(array, value); Arrays.fill(array, value);
return array; return array;
} }
public static float[] fill(float[] array, float value) public static float[] fill(float[] array, float value) {
{
Arrays.fill(array, value); Arrays.fill(array, value);
return array; return array;
} }
public static double[] fill(double[] array, double value) public static double[] fill(double[] array, double value) {
{
Arrays.fill(array, value); Arrays.fill(array, value);
return array; return array;
} }
public static <T> List<T> makeList(IntList indexes, List<T> entries) public static byte[] toArray(ByteBuffer buffer) {
{ if(buffer.hasArray()) {
List<T> result = new ObjectArrayList<T>(indexes.size()); byte[] data = buffer.array();
for(int i = 0,m=indexes.size();i<m;i++) if(data.length == buffer.remaining()) return data;
{
result.add(entries.get(indexes.getInt(i)));
} }
byte[] data = new byte[buffer.remaining()];
buffer.get(data);
return data;
}
public static byte[] toArray(ByteBuffer buffer, Consumer<ByteBuffer> action) {
if(buffer.hasArray()) {
byte[] data = buffer.array();
if(data.length == buffer.remaining()) {
action.accept(buffer);
return data;
}
}
byte[] data = new byte[buffer.remaining()];
buffer.get(data);
action.accept(buffer);
return data;
}
public static <T extends Comparable<T>> T higher(T key, T value) {
return key.compareTo(value) < 0 ? value : key;
}
public static <T extends Comparable<T>> T lower(T key, T value) {
return key.compareTo(value) > 0 ? value : key;
}
public static <T> List<T> makeList(IntList indexes, List<T> entries) {
List<T> result = new ObjectArrayList<T>(indexes.size());
for(int i = 0,m = indexes.size();i < m;i++) result.add(entries.get(indexes.getInt(i)));
return result; return result;
} }
} }

View File

@ -2,60 +2,48 @@ package speiger.src.coreengine.math;
import speiger.src.coreengine.math.vector.ints.Vec2i; import speiger.src.coreengine.math.vector.ints.Vec2i;
public class BitUtil public class BitUtil {
{ public static long toLong(long firstShort, long secondShort) {
public static long toLong(long firstShort, long secondShort)
{
return (firstShort << 32) | (secondShort & 0xFFFFFFFFL); return (firstShort << 32) | (secondShort & 0xFFFFFFFFL);
} }
public static int toFirstInt(long value) public static int toFirstInt(long value) {
{
return (int)((value >> 32) & 0xFFFFFFFFL); return (int)((value >> 32) & 0xFFFFFFFFL);
} }
public static int toSecondInt(long value) public static int toSecondInt(long value) {
{
return (int)(value & 0xFFFFFFFFL); return (int)(value & 0xFFFFFFFFL);
} }
public static long addToLong(long value, long x, long z) public static long addToLong(long value, long x, long z) {
{
return ((x + toFirstInt(value)) & 0xFFFFFFFFL) << 32 | (((z + toSecondInt(value)) & 0xFFFFFFFFL)); return ((x + toFirstInt(value)) & 0xFFFFFFFFL) << 32 | (((z + toSecondInt(value)) & 0xFFFFFFFFL));
} }
public static int toInt(int firstShort, int secondShort) public static int toInt(int firstShort, int secondShort) {
{
return (firstShort & 0xFFFF) << 16 | (secondShort & 0xFFFF); return (firstShort & 0xFFFF) << 16 | (secondShort & 0xFFFF);
} }
public static int toFirstShort(int value) public static int toFirstShort(int value) {
{
return (short)(value >> 16 & 0xFFFF); return (short)(value >> 16 & 0xFFFF);
} }
public static int toSecondShort(int value) public static int toSecondShort(int value) {
{
return (short)(value & 0xFFFF); return (short)(value & 0xFFFF);
} }
public static int addToInt(int value, int x, int z) public static int addToInt(int value, int x, int z) {
{
return ((x + toFirstShort(value)) & 0xFFFF) << 16 | ((z + toSecondShort(value)) & 0xFFFF); return ((x + toFirstShort(value)) & 0xFFFF) << 16 | ((z + toSecondShort(value)) & 0xFFFF);
} }
public static int addToInt(int value, Vec2i offset) public static int addToInt(int value, Vec2i offset) {
{ return ((offset.x() + toFirstShort(value)) & 0xFFFF) << 16 | ((offset.y() + toSecondShort(value)) & 0xFFFF);
return ((offset.getX() + toFirstShort(value)) & 0xFFFF) << 16 | ((offset.getY() + toSecondShort(value)) & 0xFFFF);
} }
public static int pack_2_10_10_10_int_rev(float x, float y, float z, float w) public static int pack_2_10_10_10_int_rev(float x, float y, float z, float w) {
{
return (Math.round(w * 3F) & 3) << 30 | (Math.round(((z * 0.5F) + 0.5F) * 1023F) & 1023) << 20 | (Math.round(((y * 0.5F) + 0.5F) * 1023F) & 1023) << 10 | (Math.round(((x * 0.5F) + 0.5F) * 1023F) & 1023); return (Math.round(w * 3F) & 3) << 30 | (Math.round(((z * 0.5F) + 0.5F) * 1023F) & 1023) << 20 | (Math.round(((y * 0.5F) + 0.5F) * 1023F) & 1023) << 10 | (Math.round(((x * 0.5F) + 0.5F) * 1023F) & 1023);
} }
public static int pack_10_10_10_2_int(float x, float y, float z, float w) public static int pack_10_10_10_2_int(float x, float y, float z, float w) {
{
return (Math.round(((x * 0.5F) + 0.5F) * 1023F) & 1023) << 22 | (Math.round(((y * 0.5F) + 0.5F) * 1023F) & 1023) << 12 | (Math.round(((z * 0.5F) + 0.5F) * 1023F) & 1023) << 2 | (Math.round(w * 3F) & 3); return (Math.round(((x * 0.5F) + 0.5F) * 1023F) & 1023) << 22 | (Math.round(((y * 0.5F) + 0.5F) * 1023F) & 1023) << 12 | (Math.round(((z * 0.5F) + 0.5F) * 1023F) & 1023) << 2 | (Math.round(w * 3F) & 3);
} }
} }

View File

@ -1,155 +1,126 @@
package speiger.src.coreengine.math; package speiger.src.coreengine.math;
public class MathUtils public class MathUtils {
{
private static final float[] SIN_TABLE; private static final float[] SIN_TABLE;
private static final float[] COS_TABLE; private static final float[] COS_TABLE;
private static final float TABLE_MASK; private static final float TABLE_MASK;
private static final int SIN_MASK; private static final int SIN_MASK;
public static final double PI_INVERSION = 180D / Math.PI; public static final double PI_INVERSION = 180D / Math.PI;
public static float sin(float a) public static float sin(float a) {
{
return SIN_TABLE[(int)(a * TABLE_MASK) & SIN_MASK]; return SIN_TABLE[(int)(a * TABLE_MASK) & SIN_MASK];
} }
public static float sin(double a) public static float sin(double a) {
{
return SIN_TABLE[(int)(a * TABLE_MASK) & SIN_MASK]; return SIN_TABLE[(int)(a * TABLE_MASK) & SIN_MASK];
} }
public static float cos(float a) public static float cos(float a) {
{
return COS_TABLE[(int)(a * TABLE_MASK) & SIN_MASK]; return COS_TABLE[(int)(a * TABLE_MASK) & SIN_MASK];
} }
public static float cos(double a) public static float cos(double a) {
{
return COS_TABLE[(int)(a * TABLE_MASK) & SIN_MASK]; return COS_TABLE[(int)(a * TABLE_MASK) & SIN_MASK];
} }
public static byte clamp(byte min, byte max, byte current) public static byte clamp(byte min, byte max, byte current) {
{
return current < min ? min : (current > max ? max : current); return current < min ? min : (current > max ? max : current);
} }
public static short clamp(short min, short max, short current) public static short clamp(short min, short max, short current) {
{
return current < min ? min : (current > max ? max : current); return current < min ? min : (current > max ? max : current);
} }
public static int clamp(int min, int max, int current) public static int clamp(int min, int max, int current) {
{
return current < min ? min : (current > max ? max : current); return current < min ? min : (current > max ? max : current);
} }
public static float clamp(float min, float max, float current) public static float clamp(float min, float max, float current) {
{
return current < min ? min : (current > max ? max : current); return current < min ? min : (current > max ? max : current);
} }
public static double clamp(double min, double max, double current) public static double clamp(double min, double max, double current) {
{
return current < min ? min : (current > max ? max : current); return current < min ? min : (current > max ? max : current);
} }
public static long clamp(long min, long max, long current) public static long clamp(long min, long max, long current) {
{
return current < min ? min : (current > max ? max : current); return current < min ? min : (current > max ? max : current);
} }
public static byte sign(byte value) public static byte sign(byte value) {
{
return value > 0 ? 1 : (value < 0 ? -1 : (byte)0); return value > 0 ? 1 : (value < 0 ? -1 : (byte)0);
} }
public static short sign(short value) public static short sign(short value) {
{
return value > 0 ? 1 : (value < 0 ? -1 : (short)0); return value > 0 ? 1 : (value < 0 ? -1 : (short)0);
} }
public static int sign(int value) public static int sign(int value) {
{
return value > 0 ? 1 : (value < 0 ? -1 : 0); return value > 0 ? 1 : (value < 0 ? -1 : 0);
} }
public static long sign(long value) public static long sign(long value) {
{
return value > 0 ? 1 : (value < 0 ? -1 : 0); return value > 0 ? 1 : (value < 0 ? -1 : 0);
} }
public static float sign(float value) public static float sign(float value) {
{
return value > 0 ? 1F : (value < 0 ? -1F : 0F); return value > 0 ? 1F : (value < 0 ? -1F : 0F);
} }
public static double sign(double value) public static double sign(double value) {
{
return value > 0 ? 1D : (value < 0 ? -1D : 0D); return value > 0 ? 1D : (value < 0 ? -1D : 0D);
} }
public static int sub(int key, int value) public static int sub(int key, int value) {
{
return key - value; return key - value;
} }
public static int ceil(double value) public static int ceil(double value) {
{
int i = (int)value; int i = (int)value;
return value > i ? i + 1 : i; return value > i ? i + 1 : i;
} }
public static int ceil(float value) public static int ceil(float value) {
{
int i = (int)value; int i = (int)value;
return value > i ? i + 1 : i; return value > i ? i + 1 : i;
} }
public static int floor(float value) public static int floor(float value) {
{
int i = (int)value; int i = (int)value;
return value < i ? i - 1 : i; return value < i ? i - 1 : i;
} }
public static int floor(double value) public static int floor(double value) {
{
int i = (int)value; int i = (int)value;
return value < i ? i - 1 : i; return value < i ? i - 1 : i;
} }
public static int pow(int base, int exp) public static int pow(int base, int exp) {
{
return (int)Math.pow(base, exp); return (int)Math.pow(base, exp);
} }
public static float lerp(float start, float end, float progress) public static float lerp(float start, float end, float progress) {
{
return start + ((end - start) * progress); return start + ((end - start) * progress);
} }
public static double lerp(double start, double end, float progress) public static double lerp(double start, double end, float progress) {
{
return start + ((end - start) * progress); return start + ((end - start) * progress);
} }
public static float smoothLerp(float start, float end, float progress) public static float smoothLerp(float start, float end, float progress) {
{
float cosProgress = (1F - MathUtils.cos(progress * Math.PI)) * 0.5F; float cosProgress = (1F - MathUtils.cos(progress * Math.PI)) * 0.5F;
return start * (1F - cosProgress) + end * cosProgress; return start * (1F - cosProgress) + end * cosProgress;
} }
public static float quadraticCurve(float start, float median, float end, float progress) public static float quadraticCurve(float start, float median, float end, float progress) {
{
return lerp(lerp(start, median, progress), lerp(median, end, progress), progress); return lerp(lerp(start, median, progress), lerp(median, end, progress), progress);
} }
public static float smoothQuadraticCurve(float start, float median, float end, float progress) public static float smoothQuadraticCurve(float start, float median, float end, float progress) {
{
return smoothLerp(smoothLerp(start, median, progress), smoothLerp(median, end, progress), progress); return smoothLerp(smoothLerp(start, median, progress), smoothLerp(median, end, progress), progress);
} }
static static {
{
SIN_MASK = ~(-1 << 12); SIN_MASK = ~(-1 << 12);
int SIN_COUNT = SIN_MASK + 1; int SIN_COUNT = SIN_MASK + 1;
@ -162,13 +133,11 @@ public class MathUtils
SIN_TABLE = new float[SIN_COUNT]; SIN_TABLE = new float[SIN_COUNT];
COS_TABLE = new float[SIN_COUNT]; COS_TABLE = new float[SIN_COUNT];
for(int i = 0;i < SIN_COUNT;i++) for(int i = 0;i < SIN_COUNT;i++) {
{
SIN_TABLE[i] = (float)Math.sin((i + 0.5f) / SIN_COUNT * radFull); SIN_TABLE[i] = (float)Math.sin((i + 0.5f) / SIN_COUNT * radFull);
COS_TABLE[i] = (float)Math.cos((i + 0.5f) / SIN_COUNT * radFull); COS_TABLE[i] = (float)Math.cos((i + 0.5f) / SIN_COUNT * radFull);
} }
for(int i = 0;i < 360;i += 90) for(int i = 0;i < 360;i += 90) {
{
SIN_TABLE[(int)(i * degToIndex) & SIN_MASK] = (float)Math.sin(i * Math.PI / 180D); SIN_TABLE[(int)(i * degToIndex) & SIN_MASK] = (float)Math.sin(i * Math.PI / 180D);
COS_TABLE[(int)(i * degToIndex) & SIN_MASK] = (float)Math.cos(i * Math.PI / 180D); COS_TABLE[(int)(i * degToIndex) & SIN_MASK] = (float)Math.cos(i * Math.PI / 180D);
} }

View File

@ -2,20 +2,16 @@ package speiger.src.coreengine.math;
import speiger.src.coreengine.math.vector.ints.Vec2i; import speiger.src.coreengine.math.vector.ints.Vec2i;
public class ShapeUtil public class ShapeUtil {
{ public static boolean isInCircle(int position, int radius, int testX, int testZ) {
public static boolean isInCircle(int position, int radius, int testX, int testZ)
{
return isInCircle(BitUtil.toFirstShort(position), BitUtil.toSecondShort(position), radius, testX, testZ); return isInCircle(BitUtil.toFirstShort(position), BitUtil.toSecondShort(position), radius, testX, testZ);
} }
public static boolean isInCircle(Vec2i position, int radius, int testX, int testZ) public static boolean isInCircle(Vec2i position, int radius, int testX, int testZ) {
{ return isInCircle(position.x(), position.y(), radius, testX, testZ);
return isInCircle(position.getX(), position.getY(), radius, testX, testZ);
} }
public static boolean isInCircle(int posX, int posZ, int radius, int testX, int testZ) public static boolean isInCircle(int posX, int posZ, int radius, int testX, int testZ) {
{
posX -= testX; posX -= testX;
posZ -= testZ; posZ -= testZ;
return (posX * posX) + (posZ * posZ) < radius * radius; return (posX * posX) + (posZ * posZ) < radius * radius;

View File

@ -5,84 +5,59 @@ import java.util.Iterator;
import speiger.src.coreengine.math.vector.ints.Vec2i; import speiger.src.coreengine.math.vector.ints.Vec2i;
import speiger.src.coreengine.math.vector.ints.Vec3i; import speiger.src.coreengine.math.vector.ints.Vec3i;
public class Circle implements I2DCollision public class Circle implements I2DCollision {
{
final Vec2i center; final Vec2i center;
final int radius; final int radius;
public Circle(int x, int y, int radius) public Circle(int x, int y, int radius) {
{
center = Vec2i.of(x, y); center = Vec2i.of(x, y);
this.radius = radius; this.radius = radius;
} }
public Circle(Vec2i center, int radius) public Circle(Vec2i center, int radius) {
{
this.center = center.asImmutable(); this.center = center.asImmutable();
this.radius = radius; this.radius = radius;
} }
public Circle(Vec3i data) public Circle(Vec3i data) {
{ this(data.x(), data.y(), data.z());
this(data.getX(), data.getY(), data.getZ());
} }
public Vec2i getCenter() public Vec2i getCenter() { return center; }
{
return center;
}
public int getRadius() public int getRadius() { return radius; }
{
return radius;
}
@Override @Override
public boolean isColliding(int x, int y) public boolean isColliding(int x, int y) {
{ int xDiff = center.x() - x;
int xDiff = center.getX() - x; int yDiff = center.y() - y;
int yDiff = center.getY() - y;
return ((xDiff * xDiff) + (yDiff * yDiff)) < radius * radius; return ((xDiff * xDiff) + (yDiff * yDiff)) < radius * radius;
} }
@Override @Override
public Iterator<Vec2i> iterator() public Iterator<Vec2i> iterator() {
{ return new Iterator<Vec2i>() {
return new Iterator<Vec2i>(){
Vec2i iter = step(Vec2i.mutable(center).sub(radius)); Vec2i iter = step(Vec2i.mutable(center).sub(radius));
Vec2i result = Vec2i.mutable(); Vec2i result = Vec2i.mutable();
@Override @Override
public boolean hasNext() public boolean hasNext() {
{
return iter != null; return iter != null;
} }
@Override @Override
public Vec2i next() public Vec2i next() {
{
result.set(iter); result.set(iter);
iter = step(iter); iter = step(iter);
return result; return result;
} }
Vec2i step(Vec2i iter) Vec2i step(Vec2i iter) {
{ while(iter != null) {
while(iter != null) if(iter.add(1, 0).x() >= center.x() + radius) {
{ if(iter.sub((radius * 2), 0).add(0, 1).y() >= center.y() + radius) iter = null;
iter.add(1, 0);
if(iter.getX() >= center.getX() + radius)
{
iter.sub((radius * 2), 0).add(0, 1);
if(iter.getY() >= center.getY() + radius)
{
iter = null;
}
}
if(iter != null && isColliding(iter))
{
break;
} }
if(iter != null && isColliding(iter)) break;
} }
return iter; return iter;
} }

View File

@ -7,6 +7,6 @@ public interface I2DCollision extends Iterable<Vec2i>
{ {
public default boolean isMixedCollision() {return false;} public default boolean isMixedCollision() {return false;}
public default boolean isColliding(int position){return isColliding(BitUtil.toFirstShort(position), BitUtil.toSecondShort(position));} public default boolean isColliding(int position){return isColliding(BitUtil.toFirstShort(position), BitUtil.toSecondShort(position));}
public default boolean isColliding(Vec2i pos){return isColliding(pos.getX(), pos.getY());} public default boolean isColliding(Vec2i pos){return isColliding(pos.x(), pos.y());}
public boolean isColliding(int x, int y); public boolean isColliding(int x, int y);
} }

View File

@ -9,60 +9,45 @@ public class Mixed2DCollision implements I2DCollision
I2DCollision mainBox; I2DCollision mainBox;
I2DCollision[] subBoxes; I2DCollision[] subBoxes;
public Mixed2DCollision(I2DCollision mainBox, I2DCollision...subBoxes) public Mixed2DCollision(I2DCollision mainBox, I2DCollision...subBoxes) {
{
this.mainBox = mainBox; this.mainBox = mainBox;
this.subBoxes = subBoxes; this.subBoxes = subBoxes;
} }
@Override @Override
public boolean isColliding(int x, int y) public boolean isColliding(int x, int y) {
{
return mainBox.isColliding(x, y) && isCollidingInSubBox(x, y); return mainBox.isColliding(x, y) && isCollidingInSubBox(x, y);
} }
public boolean isCollidingInSubBox(int x, int y) public boolean isCollidingInSubBox(int x, int y) {
{ for(int i = 0,m=subBoxes.length;i<m;i++) {
for(int i = 0,m=subBoxes.length;i<m;i++) if(!subBoxes[i].isColliding(x, y)) return false;
{
if(!subBoxes[i].isColliding(x, y))
{
return false;
}
} }
return true; return true;
} }
@Override @Override
public Iterator<Vec2i> iterator() public Iterator<Vec2i> iterator() {
{
return new Iterator<Vec2i>(){ return new Iterator<Vec2i>(){
Iterator<Vec2i> mainIter = mainBox.iterator(); Iterator<Vec2i> mainIter = mainBox.iterator();
Vec2i cache = findNext(Vec2i.mutable()); Vec2i cache = findNext(Vec2i.mutable());
Vec2i result = Vec2i.mutable(); Vec2i result = Vec2i.mutable();
@Override @Override
public boolean hasNext() public boolean hasNext() {
{
return cache != null; return cache != null;
} }
@Override @Override
public Vec2i next() public Vec2i next() {
{
result.set(cache); result.set(cache);
cache = findNext(cache); cache = findNext(cache);
return result; return result;
} }
Vec2i findNext(Vec2i input) Vec2i findNext(Vec2i input) {
{ while(mainIter.hasNext()) {
while(mainIter.hasNext())
{
Vec2i next = mainIter.next(); Vec2i next = mainIter.next();
if(isCollidingInSubBox(next.getX(), next.getY())) if(isCollidingInSubBox(next.x(), next.y())) return input.set(next);
{
return input.set(next);
}
} }
return null; return null;
} }

View File

@ -4,96 +4,70 @@ import java.util.Iterator;
import speiger.src.coreengine.math.vector.ints.Vec2i; import speiger.src.coreengine.math.vector.ints.Vec2i;
public class Plane implements I2DCollision public class Plane implements I2DCollision {
{
Vec2i min; Vec2i min;
Vec2i max; Vec2i max;
public Plane() public Plane() {
{
this(0, 0, 0, 0); this(0, 0, 0, 0);
} }
public Plane(int minX, int minY, int maxX, int maxY) public Plane(int minX, int minY, int maxX, int maxY) {
{
this(Vec2i.mutable(minX, minY), Vec2i.mutable(maxX, maxY)); this(Vec2i.mutable(minX, minY), Vec2i.mutable(maxX, maxY));
} }
public Plane(Vec2i center, int radius) public Plane(Vec2i center, int radius) {
{
this(center.sub(radius), center.add(radius)); this(center.sub(radius), center.add(radius));
} }
public Plane(Vec2i min, Vec2i max) public Plane(Vec2i min, Vec2i max) {
{
this.min = min; this.min = min;
this.max = max; this.max = max;
} }
public Plane set(Plane other) public Plane set(Plane other) {
{
min.set(other.getMin()); min.set(other.getMin());
max.set(other.getMax()); max.set(other.getMax());
return this; return this;
} }
public Plane set(int minX, int minY, int maxX, int maxY) public Plane set(int minX, int minY, int maxX, int maxY) {
{
min.set(minX, minY); min.set(minX, minY);
max.set(maxX, maxY); max.set(maxX, maxY);
return this; return this;
} }
@Override @Override
public boolean isColliding(int x, int y) public boolean isColliding(int x, int y) { return x >= min.x() && y >= min.y() && x < max.x() && y < max.y(); }
{ public boolean isIntersecting(Plane plane) { return isIntersecting(plane.getMinX(), plane.getMinY(), plane.getMaxX(), plane.getMaxY()); }
return x >= min.getX() && y >= min.getY() && x < max.getX() && y < max.getY(); public boolean isIntersecting(int minX, int minY, int maxX, int maxY) { return min.x() <= maxX && max.x() >= minX && min.y() <= maxY && max.y() >= minY; }
} public Vec2i getMin() { return min; }
public Vec2i getMax() { return max; }
public boolean isIntersecting(Plane plane) public int getWidth() { return max.x() - min.x(); }
{ public int getHeight() { return max.y() - min.y(); }
return isIntersecting(plane.getMinX(), plane.getMinY(), plane.getMaxX(), plane.getMaxY()); public int getMinX() { return min.x(); }
} public int getMinY() { return min.y(); }
public int getMaxX() { return max.x(); }
public boolean isIntersecting(int minX, int minY, int maxX, int maxY) public int getMaxY() { return max.y(); }
{
return min.getX() <= maxX && max.getX() >= minX && min.getY() <= maxY && max.getY() >= minY;
}
public Vec2i getMin(){return min;}
public Vec2i getMax(){return max;}
public int getWidth(){return max.getX() - min.getX();}
public int getHeight(){return max.getY() - min.getY();}
public int getMinX(){return min.getX();}
public int getMinY(){return min.getY();}
public int getMaxX(){return max.getX();}
public int getMaxY(){return max.getY();}
@Override @Override
public Iterator<Vec2i> iterator() public Iterator<Vec2i> iterator() {
{ return new Iterator<Vec2i>() {
return new Iterator<Vec2i>(){
Vec2i iter = Vec2i.mutable(min); Vec2i iter = Vec2i.mutable(min);
Vec2i result = Vec2i.mutable(); Vec2i result = Vec2i.mutable();
@Override @Override
public boolean hasNext() public boolean hasNext() {
{
return iter != null; return iter != null;
} }
@Override @Override
public Vec2i next() public Vec2i next() {
{
result.set(iter); result.set(iter);
iter.add(1, 0); iter.add(1, 0);
if(iter.getX() == max.getX()) if(iter.x() == max.x()) {
{ iter.set(min.x(), iter.y() + 1);
iter.set(min.getX(), iter.getY() + 1); if(iter.y() == max.y()) iter = null;
if(iter.getY() == max.getY())
{
iter = null;
}
} }
return result; return result;
} }

View File

@ -6,8 +6,7 @@ import java.nio.FloatBuffer;
import speiger.src.collections.floats.lists.FloatList; import speiger.src.collections.floats.lists.FloatList;
import speiger.src.coreengine.math.MathUtils; import speiger.src.coreengine.math.MathUtils;
public class ColorUtils public class ColorUtils {
{
static final float DEVIDER = 1F / 255F; static final float DEVIDER = 1F / 255F;
public static final int R = 0xFF << 16; public static final int R = 0xFF << 16;
public static final int G = 0xFF << 8; public static final int G = 0xFF << 8;
@ -15,7 +14,6 @@ public class ColorUtils
public static final int A = 0xFF << 24; public static final int A = 0xFF << 24;
public static final long SIGN = 0x00000000FFFFFFFFL; public static final long SIGN = 0x00000000FFFFFFFFL;
static final int ALL = 0xFFFFFFFF; static final int ALL = 0xFFFFFFFF;
public static final int WHITE = rgb(255, 255, 255); public static final int WHITE = rgb(255, 255, 255);
public static final int LIGHT_GRAY = rgb(192, 192, 192); public static final int LIGHT_GRAY = rgb(192, 192, 192);
public static final int GRAY = rgb(128, 128, 128); public static final int GRAY = rgb(128, 128, 128);
@ -33,15 +31,14 @@ public class ColorUtils
public static final int BLUE = rgb(0, 0, 255); public static final int BLUE = rgb(0, 0, 255);
public static final int LIGHT_BLUE = rgb(0, 150, 255); public static final int LIGHT_BLUE = rgb(0, 150, 255);
//Specialized Components that get reused // Specialized Components that get reused
public static final int INVISIBLE = rgb(0, 0, 0, 0); public static final int INVISIBLE = rgb(0, 0, 0, 0);
public static final int TEXT_DEFAULT_BACKGROUND = rgb(80, 80, 80, 144); public static final int TEXT_DEFAULT_BACKGROUND = rgb(80, 80, 80, 144);
public static final int WINDOW_DEFAULT_BACKGROUND = rgb(64, 64, 64, 128); public static final int WINDOW_DEFAULT_BACKGROUND = rgb(64, 64, 64, 128);
public static final int POPUP_DEFAULT_BACKGROUND = rgb(85, 85, 85); public static final int POPUP_DEFAULT_BACKGROUND = rgb(85, 85, 85);
public static final int DESTRUCTION = rgb(255, 0, 0, 128); public static final int DESTRUCTION = rgb(255, 0, 0, 128);
public static byte[] toByteArray(int color, boolean alpha) public static byte[] toByteArray(int color, boolean alpha) {
{
byte[] data = new byte[alpha ? 4 : 3]; byte[] data = new byte[alpha ? 4 : 3];
data[0] = (byte)((color >> 16) & 0xFF); data[0] = (byte)((color >> 16) & 0xFF);
data[1] = (byte)((color >> 8) & 0xFF); data[1] = (byte)((color >> 8) & 0xFF);
@ -50,325 +47,154 @@ public class ColorUtils
return data; return data;
} }
public static void write(int color, boolean alpha, ByteBuffer buffer) public static void write(int color, boolean alpha, ByteBuffer buffer) {
{
buffer.put((byte)((color >> 16) & 0xFF)).put((byte)((color >> 8) & 0xFF)).put((byte)(color & 0xFF)); buffer.put((byte)((color >> 16) & 0xFF)).put((byte)((color >> 8) & 0xFF)).put((byte)(color & 0xFF));
if(alpha) if(alpha) { buffer.put((byte)((color >> 24) & 0xFF)); }
{
buffer.put((byte)((color >> 24) & 0xFF));
}
} }
public static void write(int index, int color, boolean alpha, ByteBuffer buffer) public static void write(int index, int color, boolean alpha, ByteBuffer buffer) {
{
buffer.put(index, (byte)((color >> 16) & 0xFF)).put(index + 1, (byte)((color >> 8) & 0xFF)).put(index + 2, (byte)(color & 0xFF)); buffer.put(index, (byte)((color >> 16) & 0xFF)).put(index + 1, (byte)((color >> 8) & 0xFF)).put(index + 2, (byte)(color & 0xFF));
if(alpha) if(alpha) buffer.put(index + 3, (byte)((color >> 24) & 0xFF));
{
buffer.put(index + 3, (byte)((color >> 24) & 0xFF));
}
} }
public static void writeFloat(int color, boolean alpha, ByteBuffer buffer) public static void writeFloat(int color, boolean alpha, ByteBuffer buffer) {
{
buffer.putFloat(((color >> 16) & 0xFF) * DEVIDER).putFloat(((color >> 8) & 0xFF) * DEVIDER).putFloat((color & 0xFF) * DEVIDER); buffer.putFloat(((color >> 16) & 0xFF) * DEVIDER).putFloat(((color >> 8) & 0xFF) * DEVIDER).putFloat((color & 0xFF) * DEVIDER);
if(alpha) if(alpha) buffer.putFloat(((color >> 24) & 0xFF) * DEVIDER);
{
buffer.putFloat(((color >> 24) & 0xFF) * DEVIDER);
}
} }
public static void writeFloat(int index, int color, boolean alpha, ByteBuffer buffer) public static void writeFloat(int index, int color, boolean alpha, ByteBuffer buffer) {
{
buffer.putFloat(index, ((color >> 16) & 0xFF) * DEVIDER).putFloat(index + 1, ((color >> 8) & 0xFF) * DEVIDER).putFloat(index + 2, (color & 0xFF) * DEVIDER); buffer.putFloat(index, ((color >> 16) & 0xFF) * DEVIDER).putFloat(index + 1, ((color >> 8) & 0xFF) * DEVIDER).putFloat(index + 2, (color & 0xFF) * DEVIDER);
if(alpha) if(alpha) buffer.putFloat(index + 3, ((color >> 24) & 0xFF) * DEVIDER);
{
buffer.putFloat(index + 3, ((color >> 24) & 0xFF) * DEVIDER);
}
} }
public static void write(int color, boolean alpha, FloatBuffer buffer) public static void write(int color, boolean alpha, FloatBuffer buffer) {
{
buffer.put(((color >> 16) & 0xFF) * DEVIDER).put(((color >> 8) & 0xFF) * DEVIDER).put((color & 0xFF) * DEVIDER); buffer.put(((color >> 16) & 0xFF) * DEVIDER).put(((color >> 8) & 0xFF) * DEVIDER).put((color & 0xFF) * DEVIDER);
if(alpha) if(alpha) buffer.put(((color >> 24) & 0xFF) * DEVIDER);
{
buffer.put(((color >> 24) & 0xFF) * DEVIDER);
}
} }
public static void write(int index, int color, boolean alpha, FloatBuffer buffer) public static void write(int index, int color, boolean alpha, FloatBuffer buffer) {
{
buffer.put(index, ((color >> 16) & 0xFF) * DEVIDER).put(index + 1, ((color >> 8) & 0xFF) * DEVIDER).put(index + 2, (color & 0xFF) * DEVIDER); buffer.put(index, ((color >> 16) & 0xFF) * DEVIDER).put(index + 1, ((color >> 8) & 0xFF) * DEVIDER).put(index + 2, (color & 0xFF) * DEVIDER);
if(alpha) if(alpha) buffer.put(index + 3, ((color >> 24) & 0xFF) * DEVIDER);
{
buffer.put(index + 3, ((color >> 24) & 0xFF) * DEVIDER);
}
} }
public static void write(int color, boolean alpha, FloatList list) public static void write(int color, boolean alpha, FloatList list) {
{
list.add(((color >> 16) & 0xFF) * DEVIDER); list.add(((color >> 16) & 0xFF) * DEVIDER);
list.add(((color >> 8) & 0xFF) * DEVIDER); list.add(((color >> 8) & 0xFF) * DEVIDER);
list.add((color & 0xFF) * DEVIDER); list.add((color & 0xFF) * DEVIDER);
if(alpha) if(alpha) { list.add(((color >> 24) & 0xFF) * DEVIDER); }
{
list.add(((color >> 24) & 0xFF) * DEVIDER);
}
} }
public static int read(ByteBuffer buffer, boolean alpha) public static int read(ByteBuffer buffer, boolean alpha) { return alpha ? rgb(buffer.get(), buffer.get(), buffer.get()) : rgb(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
{ public static int read(ByteBuffer buffer, int index, boolean alpha) { return alpha ? rgb(buffer.get(index), buffer.get(index + 1), buffer.get(index + 2)) : rgb(buffer.get(index), buffer.get(index + 1), buffer.get(index + 2), buffer.get(index + 3)); }
return alpha ? rgb(buffer.get(), buffer.get(), buffer.get()) : rgb(buffer.get(), buffer.get(), buffer.get(), buffer.get()); public static int readFloat(ByteBuffer buffer, boolean alpha) { return alpha ? rgb(buffer.getFloat(), buffer.getFloat(), buffer.getFloat()) : rgb(buffer.getFloat(), buffer.getFloat(), buffer.getFloat(), buffer.getFloat()); }
public static int readFloat(ByteBuffer buffer, int index, boolean alpha) { return alpha ? rgb(buffer.getFloat(index), buffer.getFloat(index + 1), buffer.getFloat(index + 2)) : rgb(buffer.getFloat(index), buffer.getFloat(index + 1), buffer.getFloat(index + 2), buffer.getFloat(index + 3)); }
public static int read(FloatBuffer buffer, boolean alpha) { return alpha ? rgb(buffer.get(), buffer.get(), buffer.get()) : rgb(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
public static int read(FloatBuffer buffer, int index, boolean alpha) { return alpha ? rgb(buffer.get(index), buffer.get(index + 1), buffer.get(index + 2)) : rgb(buffer.get(index), buffer.get(index + 1), buffer.get(index + 2), buffer.get(index + 3)); }
public static boolean needsDarkColor(int rgba) { return getBrightness(rgba) >= 130; }
public static int getBrightness(int rgba) { return getBrightness((rgba >> 16) & 0xFF, (rgba >> 8) & 0xFF, rgba & 0xFF); }
public static int getBrightness(int r, int g, int b) { return (int)Math.sqrt((r * r * 0.241F) + (g * g * 0.691F) + (b * b * 0.068F)); }
public static int mix(int from, int to, float factor) {
float weight0 = (1F - factor);
float weight1 = factor;
int r = (int)((((from >> 16) & 0xFF) * weight0) + (((to >> 16) & 0xFF) * weight1));
int g = (int)((((from >> 8) & 0xFF) * weight0) + (((to >> 8) & 0xFF) * weight1));
int b = (int)(((from & 0xFF) * weight0) + ((to & 0xFF) * weight1));
int a = (int)((((from >> 24) & 0xFF) * weight0) + (((to >> 24) & 0xFF) * weight1));
return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | b & 0xFF;
} }
public static int read(ByteBuffer buffer, int index, boolean alpha) public static int darker(int color) { return darker(color, 0.7F); }
{ public static int darker(int color, float factor) {
return alpha ? rgb(buffer.get(index), buffer.get(index+1), buffer.get(index+2)) : rgb(buffer.get(index), buffer.get(index+1), buffer.get(index+2), buffer.get(index+3));
}
public static int readFloat(ByteBuffer buffer, boolean alpha)
{
return alpha ? rgb(buffer.getFloat(), buffer.getFloat(), buffer.getFloat()) : rgb(buffer.getFloat(), buffer.getFloat(), buffer.getFloat(), buffer.getFloat());
}
public static int readFloat(ByteBuffer buffer, int index, boolean alpha)
{
return alpha ? rgb(buffer.getFloat(index), buffer.getFloat(index+1), buffer.getFloat(index+2)) : rgb(buffer.getFloat(index), buffer.getFloat(index+1), buffer.getFloat(index+2), buffer.getFloat(index+3));
}
public static int read(FloatBuffer buffer, boolean alpha)
{
return alpha ? rgb(buffer.get(), buffer.get(), buffer.get()) : rgb(buffer.get(), buffer.get(), buffer.get(), buffer.get());
}
public static int read(FloatBuffer buffer, int index, boolean alpha)
{
return alpha ? rgb(buffer.get(index), buffer.get(index+1), buffer.get(index+2)) : rgb(buffer.get(index), buffer.get(index+1), buffer.get(index+2), buffer.get(index+3));
}
public static boolean needsDarkColor(int rgba)
{
return getBrightness(rgba) >= 130;
}
public static int getBrightness(int rgba)
{
return getBrightness((rgba >> 16) & 0xFF, (rgba >> 8) & 0xFF, rgba & 0xFF);
}
public static int getBrightness(int r, int g, int b)
{
return (int)Math.sqrt((r * r * 0.241F) + (g * g * 0.691F) + (b * b * 0.068F));
}
public static int mix(int from, int to, float factor)
{
float weight0 = (1F - factor);
float weight1 = factor;
int r = (int)((((from >> 16) & 0xFF) * weight0) + (((to >> 16) & 0xFF) * weight1));
int g = (int)((((from >> 8) & 0xFF) * weight0) + (((to >> 8) & 0xFF) * weight1));
int b = (int)(((from & 0xFF) * weight0) + ((to & 0xFF) * weight1));
int a = (int)((((from >> 24) & 0xFF) * weight0) + (((to >> 24) & 0xFF) * weight1));
return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | b & 0xFF;
}
public static int darker(int color)
{
return darker(color, 0.7F);
}
public static int darker(int color, float factor)
{
int r = Math.max(0, (int)(((color >> 16) & 0xFF) * factor)); int r = Math.max(0, (int)(((color >> 16) & 0xFF) * factor));
int g = Math.max(0, (int)(((color >> 8) & 0xFF) * factor)); int g = Math.max(0, (int)(((color >> 8) & 0xFF) * factor));
int b = Math.max(0, (int)((color & 0xFF) * factor)); int b = Math.max(0, (int)((color & 0xFF) * factor));
return (color & A) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); return (color & A) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF);
} }
public static int brighter(int color) public static int brighter(int color) { return brighter(color, 0.7F); }
{ public static int brighter(int color, float factor) {
return brighter(color, 0.7F);
}
public static int brighter(int color, float factor)
{
int r = (color >> 16) & 0xFF; int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF; int g = (color >> 8) & 0xFF;
int b = color & 0xFF; int b = color & 0xFF;
int i = (int)(1.0 / (1.0 - factor)); int i = (int)(1.0 / (1.0 - factor));
if(r == 0 && g == 0 && b == 0) if(r == 0 && g == 0 && b == 0) { return (color & A) | ((i & 0xFF) << 16) | ((i & 0xFF) << 8) | (i & 0xFF); }
{
return (color & A) | ((i & 0xFF) << 16) | ((i & 0xFF) << 8) | (i & 0xFF);
}
if(r > 0 && r < i) r = i; if(r > 0 && r < i) r = i;
if(g > 0 && g < i) g = i; if(g > 0 && g < i) g = i;
if(b > 0 && b < i) b = i; if(b > 0 && b < i) b = i;
return (color & A) | Math.min(255, (int)(r / factor)) << 16 | Math.min(255, (int)(g / factor)) << 8 | Math.min(255, (int)(b / factor)); return (color & A) | Math.min(255, (int)(r / factor)) << 16 | Math.min(255, (int)(g / factor)) << 8 | Math.min(255, (int)(b / factor));
} }
public static int toRGB(float hue, float saturation, float brightness) public static int toRGB(float hue, float saturation, float brightness) {
{ if(saturation == 0) {
if (saturation == 0)
{
int result = (int)(brightness * 255F + 0.5F); int result = (int)(brightness * 255F + 0.5F);
return rgb(result, result, result); return rgb(result, result, result);
} }
float h = (hue - MathUtils.floor(hue)) * 6F; float h = (hue - MathUtils.floor(hue)) * 6F;
float f = h - MathUtils.floor(h); float f = h - MathUtils.floor(h);
float p = brightness * (1F - saturation); float p = brightness * (1F - saturation);
float q = brightness * (1F - saturation * f); float q = brightness * (1F - saturation * f);
float t = brightness * (1F - (saturation * (1F - f))); float t = brightness * (1F - (saturation * (1F - f)));
switch ((int)h) { switch((int)h) {
case 0: return rgb(brightness, t, p); case 0: return rgb(brightness, t, p);
case 1: return rgb(q, brightness, p); case 1: return rgb(q, brightness, p);
case 2: return rgb(p, brightness, t); case 2: return rgb(p, brightness, t);
case 3: return rgb(p, q, brightness); case 3: return rgb(p, q, brightness);
case 4: return rgb(t, p, brightness); case 4: return rgb(t, p, brightness);
case 5: return rgb(brightness, p, q); case 5: return rgb(brightness, p, q);
default: return BLACK; default: return BLACK;
} }
} }
public static float[] toHue(int rgba) public static float[] toHue(int rgba) {
{
int r = getR(rgba); int r = getR(rgba);
int g = getG(rgba); int g = getG(rgba);
int b = getB(rgba); int b = getB(rgba);
int cmax = (r > g) ? r : g; int cmax = (r > g) ? r : g;
if (b > cmax) cmax = b; if(b > cmax) cmax = b;
int cmin = (r < g) ? r : g; int cmin = (r < g) ? r : g;
if (b < cmin) cmin = b; if(b < cmin) cmin = b;
float length = cmax - cmin; float length = cmax - cmin;
float[] result = new float[3]; float[] result = new float[3];
result[1] = cmax == 0 ? 0F : length / cmax; result[1] = cmax == 0 ? 0F : length / cmax;
result[2] = cmax * DEVIDER; result[2] = cmax * DEVIDER;
float hue = 0F; float hue = 0F;
if(result[1] != 0F) { if(result[1] != 0F) {
float redc = (cmax - r) / length; float redc = (cmax - r) / length;
float greenc = (cmax - g) / length; float greenc = (cmax - g) / length;
float bluec = (cmax - b) / length; float bluec = (cmax - b) / length;
if (r == cmax) hue = bluec - greenc; if(r == cmax) hue = bluec - greenc;
else if (g == cmax) hue = 2F + redc - bluec; else if(g == cmax) hue = 2F + redc - bluec;
else hue = 4F + greenc - redc; else hue = 4F + greenc - redc;
hue /= 6F; hue /= 6F;
if (hue < 0) hue += 1F; if(hue < 0) hue += 1F;
} }
result[0] = hue; result[0] = hue;
return result; return result;
} }
public static int rgb(int rgb) public static int rgb(int rgb) { return rgb | (255 << 24); }
{ public static int rgb(int r, int g, int b) { return A | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); }
return rgb | (255 << 24); public static int rgb(float r, float g, float b) { return rgb((int)(r * 255F + 0.5F), (int)(g * 255F + 0.5F), (int)(b * 255F + 0.5F)); }
} public static int rgb(int r, int g, int b, int a) { return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); }
public static int rgb(float r, float g, float b, float a) { return rgb((int)(r * 255F + 0.5F), (int)(g * 255F + 0.5F), (int)(b * 255F + 0.5F), (int)(b * 255F + 0.5F)); }
public static int rgb(int r, int g, int b) public static int setR(int rgba, int r) { return rgba & ~R | ((r & 0xFF) << 16); }
{ public static int setR(int rgba, float r) { return rgba & ~R | (((int)(r * 255F + 0.5F)) << 16); }
return A | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); public static int setG(int rgba, int g) { return rgba & ~G | ((g & 0xFF) << 8); }
} public static int setG(int rgba, float g) { return rgba & ~G | (((int)(g * 255F + 0.5F)) << 8); }
public static int setB(int rgba, int b) { return rgba & ~B | (b & 0xFF); }
public static int rgb(float r, float g, float b) public static int setB(int rgba, float b) { return rgba & ~B | ((int)(b * 255F + 0.5F)); }
{ public static int setA(int rgba, int a) { return rgba & ~A | ((a & 0xFF) << 24); }
return rgb((int)(r * 255F + 0.5F), (int)(g * 255F + 0.5F), (int)(b * 255F + 0.5F)); public static int setA(int rgba, float a) { return rgba & ~A | (((int)(a * 255F + 0.5F)) << 24); }
} public static int getR(int rgba) { return (rgba >> 16) & 0xFF; }
public static float getRF(int rgba) { return ((rgba >> 16) & 0xFF) * DEVIDER; }
public static int rgb(int r, int g, int b, int a) public static int getG(int rgba) { return (rgba >> 8) & 0xFF; }
{ public static float getGF(int rgba) { return ((rgba >> 8) & 0xFF) * DEVIDER; }
return ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); public static int getB(int rgba) { return rgba & 0xFF; }
} public static float getBF(int rgba) { return (rgba & 0xFF) * DEVIDER; }
public static int getA(int rgba) { return (rgba >> 24) & 0xFF; }
public static int rgb(float r, float g, float b, float a) public static float getAF(int rgba) { return ((rgba >> 24) & 0xFF) * DEVIDER; }
{ public static String toHex(int rgba, boolean alpha) { return "0x"+(alpha ? Long.toHexString(1 << 32 | rgba & SIGN) : Integer.toHexString((1 << 24) | (rgba & ~A))).substring(1); }
return rgb((int)(r * 255F + 0.5F), (int)(g * 255F + 0.5F), (int)(b * 255F + 0.5F), (int)(b * 255F + 0.5F)); public static String toHTML(int rgba, boolean alpha) { return "#"+(alpha ? Long.toHexString(1 << 32 | rgba & SIGN) : Integer.toHexString((1 << 24) | (rgba & ~A))).substring(1); }
}
public static int setR(int rgba, int r)
{
return rgba & ~R | ((r & 0xFF) << 16);
}
public static int setR(int rgba, float r)
{
return rgba & ~R | (((int)(r * 255F + 0.5F)) << 16);
}
public static int setG(int rgba, int g)
{
return rgba & ~G | ((g & 0xFF) << 8);
}
public static int setG(int rgba, float g)
{
return rgba & ~G | (((int)(g * 255F + 0.5F)) << 8);
}
public static int setB(int rgba, int b)
{
return rgba & ~B | (b & 0xFF);
}
public static int setB(int rgba, float b)
{
return rgba & ~B | ((int)(b * 255F + 0.5F));
}
public static int setA(int rgba, int a)
{
return rgba & ~A | ((a & 0xFF) << 24);
}
public static int setA(int rgba, float a)
{
return rgba & ~A | (((int)(a * 255F + 0.5F)) << 24);
}
public static int getR(int rgba)
{
return (rgba >> 16) & 0xFF;
}
public static float getRF(int rgba)
{
return ((rgba >> 16) & 0xFF) * DEVIDER;
}
public static int getG(int rgba)
{
return (rgba >> 8) & 0xFF;
}
public static float getGF(int rgba)
{
return ((rgba >> 8) & 0xFF) * DEVIDER;
}
public static int getB(int rgba)
{
return rgba & 0xFF;
}
public static float getBF(int rgba)
{
return (rgba & 0xFF) * DEVIDER;
}
public static int getA(int rgba)
{
return (rgba >> 24) & 0xFF;
}
public static float getAF(int rgba)
{
return ((rgba >> 24) & 0xFF) * DEVIDER;
}
public static String getHexCode(int rgba, boolean alpha)
{
return "0x"+(alpha ? Long.toHexString(1 << 32 | rgba & SIGN) : Integer.toHexString((1 << 24) | (rgba & ~A))).substring(1);
}
public static String getHTMLCode(int rgba, boolean alpha)
{
return "#"+(alpha ? Long.toHexString(1 << 32 | rgba & SIGN) : Integer.toHexString((1 << 24) | (rgba & ~A))).substring(1);
}
} }

View File

@ -4,8 +4,7 @@ import java.util.function.Predicate;
import speiger.src.coreengine.math.vector.ints.Vec2i; import speiger.src.coreengine.math.vector.ints.Vec2i;
public enum Facing public enum Facing {
{
NORTH(0, 2, "North", Axis.VERTICAL, Vec2i.of(0, 1)), NORTH(0, 2, "North", Axis.VERTICAL, Vec2i.of(0, 1)),
EAST(1, 3, "East", Axis.HORIZONTAL, Vec2i.of(1, 0)), EAST(1, 3, "East", Axis.HORIZONTAL, Vec2i.of(1, 0)),
SOUTH(2, 0, "South", Axis.VERTICAL, Vec2i.of(0, -1)), SOUTH(2, 0, "South", Axis.VERTICAL, Vec2i.of(0, -1)),
@ -13,7 +12,6 @@ public enum Facing
private static final Facing[] VALUES; private static final Facing[] VALUES;
private static final Facing[] ROTATIONS; private static final Facing[] ROTATIONS;
final int index; final int index;
final int rotationIndex; final int rotationIndex;
final String name; final String name;
@ -22,8 +20,7 @@ public enum Facing
final boolean positive; final boolean positive;
final Rotation rotation; final Rotation rotation;
private Facing(int direction, int rotation, String display, Axis axis, Vec2i offset) private Facing(int direction, int rotation, String display, Axis axis, Vec2i offset) {
{
index = direction; index = direction;
rotationIndex = rotation; rotationIndex = rotation;
name = display; name = display;
@ -33,123 +30,50 @@ public enum Facing
this.rotation = Rotation.fromFacing(this); this.rotation = Rotation.fromFacing(this);
} }
public int getIndex() public int getIndex() { return index; }
{ public boolean isPositive() { return positive; }
return index;
}
public boolean isXAxis() public boolean isXAxis() { return axis == Axis.HORIZONTAL; }
{ public boolean isZAxis() { return axis == Axis.VERTICAL; }
return axis == Axis.HORIZONTAL; public Axis getAxis() { return axis; }
}
public boolean isZAxis()
{
return axis == Axis.VERTICAL;
}
public Axis getAxis() public Vec2i getOffset() { return offset; }
{ public float getMultiplier() { return positive ? 1F : -1F; }
return axis;
}
public boolean isPositive() public String getName() { return name; }
{
return positive;
}
public Vec2i getOffset() public int getRotationIndex() { return rotationIndex; }
{ public int getRotation() { return rotationIndex * 90; }
return offset; public int getRotation(Facing other) {
}
public float getMultiplier()
{
return positive ? 1F : -1F;
}
public String getName()
{
return name;
}
public int getRotationIndex()
{
return rotationIndex;
}
public int getRotation()
{
return rotationIndex * 90;
}
public int getRotation(Facing other)
{
if(other == backwards()) return getRotation() - 45; if(other == backwards()) return getRotation() - 45;
else if(other == forward()) return getRotation() + 45; else if(other == forward()) return getRotation() + 45;
return getRotation(); return getRotation();
} }
public Rotation toRotation() public Rotation toRotation() { return rotation; }
{ public Facing rotate(int amount) { return byIndex(index + amount); }
return rotation; public Facing forward() { return byIndex(index + 1); }
} public Facing backwards() { return byIndex(index - 1); }
public Facing opposite() { return byIndex(index + 2); }
public Facing rotate(int amount)
{
return byIndex(index + amount);
}
public Facing forward()
{
return byIndex(index + 1);
}
public Facing backwards()
{
return byIndex(index - 1);
}
public Facing opposite()
{
return byIndex(index + 2);
}
@Override @Override
public String toString() public String toString() { return getName()+": "+offset; }
{
return getName()+": "+offset;
}
public static Facing byIndex(int index) public static Facing byIndex(int index) { return VALUES[index & 3]; }
{ public static Facing byRotationIndex(int index) { return ROTATIONS[index & 3]; }
return VALUES[index & 3]; public static Facing byYaw(float value) { return byRotationIndex((int)(value / 90) & 3); }
}
public static Facing byRotationIndex(int index) static {
{
return ROTATIONS[index & 3];
}
public static Facing byYaw(float value)
{
return byRotationIndex((int)(value / 90) & 3);
}
static
{
Facing[] values = values(); Facing[] values = values();
VALUES = new Facing[values.length]; VALUES = new Facing[values.length];
ROTATIONS = new Facing[values.length]; ROTATIONS = new Facing[values.length];
for(Facing entry : values) for(Facing entry : values) {
{
VALUES[entry.getIndex()] = entry; VALUES[entry.getIndex()] = entry;
ROTATIONS[entry.getRotationIndex()] = entry; ROTATIONS[entry.getRotationIndex()] = entry;
} }
} }
public static enum Rotation public static enum Rotation {
{
NONE(Facing.NORTH), NONE(Facing.NORTH),
CLOCKWISE(Facing.EAST), CLOCKWISE(Facing.EAST),
OPPOSITE(Facing.SOUTH), OPPOSITE(Facing.SOUTH),
@ -158,44 +82,27 @@ public enum Facing
static final Rotation[] ROTATION = Rotation.values(); static final Rotation[] ROTATION = Rotation.values();
Facing facing; Facing facing;
private Rotation(Facing facing) private Rotation(Facing facing) {
{
this.facing = facing; this.facing = facing;
} }
public static Rotation fromFacing(Facing facing) public static Rotation fromFacing(Facing facing) { return ROTATION[facing.getIndex()]; }
{ public Facing toFacing() { return facing; }
return ROTATION[facing.getIndex()];
}
public Facing toFacing()
{
return facing;
}
} }
public static enum Axis implements Predicate<Facing> public static enum Axis implements Predicate<Facing> {
{
HORIZONTAL(5), HORIZONTAL(5),
VERTICAL(10); VERTICAL(10);
int code; int code;
private Axis(int code) private Axis(int code) {
{
this.code = code; this.code = code;
} }
public int getCode() { return code; }
public int getCode()
{
return code;
}
@Override @Override
public boolean test(Facing t) public boolean test(Facing t) { return t.getAxis() == this; }
{
return t.getAxis() == this;
}
} }
} }

View File

@ -12,24 +12,20 @@ import speiger.src.coreengine.math.MathUtils;
import speiger.src.coreengine.math.misc.Facing.Axis; import speiger.src.coreengine.math.misc.Facing.Axis;
import speiger.src.coreengine.math.vector.ints.Vec2i; import speiger.src.coreengine.math.vector.ints.Vec2i;
public final class FacingList implements Iterable<Facing>, Predicate<Facing> public final class FacingList implements Iterable<Facing>, Predicate<Facing> {
{
static final FacingList[] FACINGS = createArray(); static final FacingList[] FACINGS = createArray();
public static final FacingList EMPTY = ofNumber(0); public static final FacingList EMPTY = ofNumber(0);
public static final FacingList NORTH = ofFacings(Facing.NORTH); public static final FacingList NORTH = ofFacings(Facing.NORTH);
public static final FacingList EAST = ofFacings(Facing.EAST); public static final FacingList EAST = ofFacings(Facing.EAST);
public static final FacingList SOUTH = ofFacings(Facing.SOUTH); public static final FacingList SOUTH = ofFacings(Facing.SOUTH);
public static final FacingList WEST = ofFacings(Facing.WEST); public static final FacingList WEST = ofFacings(Facing.WEST);
public static final FacingList NORTH_EAST = ofFacings(Facing.NORTH, Facing.EAST); public static final FacingList NORTH_EAST = ofFacings(Facing.NORTH, Facing.EAST);
public static final FacingList SOUTH_EAST = ofFacings(Facing.EAST, Facing.SOUTH); public static final FacingList SOUTH_EAST = ofFacings(Facing.EAST, Facing.SOUTH);
public static final FacingList SOUTH_WEST = ofFacings(Facing.SOUTH, Facing.WEST); public static final FacingList SOUTH_WEST = ofFacings(Facing.SOUTH, Facing.WEST);
public static final FacingList NORTH_WEST = ofFacings(Facing.WEST, Facing.NORTH); public static final FacingList NORTH_WEST = ofFacings(Facing.WEST, Facing.NORTH);
public static final FacingList VERTICAL = ofFacings(Facing.NORTH, Facing.SOUTH); public static final FacingList VERTICAL = ofFacings(Facing.NORTH, Facing.SOUTH);
public static final FacingList HORIZONTAL = ofFacings(Facing.EAST, Facing.WEST); public static final FacingList HORIZONTAL = ofFacings(Facing.EAST, Facing.WEST);
public static final FacingList ALL = ofFacings(Facing.NORTH, Facing.SOUTH, Facing.EAST, Facing.WEST); public static final FacingList ALL = ofFacings(Facing.NORTH, Facing.SOUTH, Facing.EAST, Facing.WEST);
final byte code; final byte code;
final byte next; final byte next;
final byte opposite; final byte opposite;
@ -38,22 +34,18 @@ public final class FacingList implements Iterable<Facing>, Predicate<Facing>
final Vec2i offset; final Vec2i offset;
final Facing[] array; final Facing[] array;
private FacingList(int initCode) private FacingList(int initCode) {
{
code = (byte)MathUtils.clamp(0, 15, initCode); code = (byte)MathUtils.clamp(0, 15, initCode);
Vec2i pos = Vec2i.mutable(); Vec2i pos = Vec2i.mutable();
ObjectList<Facing> facings = new ObjectArrayList<>(); ObjectList<Facing> facings = new ObjectArrayList<>();
for(int i = 0;i<4;i++) for(int i = 0;i < 4;i++) {
{ if((code & 1 << i) != 0) {
if((code & 1 << i) != 0)
{
pos.add(Facing.byIndex(i).getOffset()); pos.add(Facing.byIndex(i).getOffset());
facings.add(Facing.byIndex(i)); facings.add(Facing.byIndex(i));
} }
} }
int[] data = new int[3]; int[] data = new int[3];
for(int i = 0,m=facings.size();i<m;i++) for(int i = 0,m = facings.size();i < m;i++) {
{
Facing face = facings.get(i); Facing face = facings.get(i);
data[0] |= 1 << face.forward().getIndex(); data[0] |= 1 << face.forward().getIndex();
data[1] |= 1 << face.opposite().getIndex(); data[1] |= 1 << face.opposite().getIndex();
@ -67,68 +59,31 @@ public final class FacingList implements Iterable<Facing>, Predicate<Facing>
array = facings.toArray(new Facing[facings.size()]); array = facings.toArray(new Facing[facings.size()]);
} }
public static FacingList ofFacing(Facing facing) public static FacingList ofFacing(Facing facing) { return FACINGS[1 << facing.getIndex()]; }
{ public static FacingList ofFacings(Facing... facings) { return FACINGS[toNumber(facings)]; }
return FACINGS[1 << facing.getIndex()]; public static FacingList ofFlags(boolean[] facings) { return FACINGS[toNumber(facings)]; }
} public static FacingList ofNumber(int value) { return FACINGS[value & 15]; }
public static FacingList ofAxis(Axis axis) { return FACINGS[axis.getCode()]; }
public static FacingList ofFacings(Facing... facings) public static FacingList fromVec(Vec2i value) {
{
return FACINGS[toNumber(facings)];
}
public static FacingList ofFlags(boolean[] facings)
{
return FACINGS[toNumber(facings)];
}
public static FacingList ofNumber(int value)
{
return FACINGS[value & 15];
}
public static FacingList ofAxis(Axis axis)
{
return FACINGS[axis.getCode()];
}
public static FacingList fromVec(Vec2i value)
{
value = value.clamp(-1, 1); value = value.clamp(-1, 1);
for(int i = 0;i<16;i++) for(int i = 0;i < 16;i++) { if(FACINGS[i].getOffset().equals(value)) { return FACINGS[i]; } }
{
if(FACINGS[i].getOffset().equals(value))
{
return FACINGS[i];
}
}
return FACINGS[0]; return FACINGS[0];
} }
public Set<Facing> toFacings() public Set<Facing> toFacings() { return isEmpty() ? EnumSet.noneOf(Facing.class) : EnumSet.copyOf(ObjectArrayList.wrap(array)); }
{ public boolean[] toFlags() { return toFlags(array); }
return isEmpty() ? EnumSet.noneOf(Facing.class) : EnumSet.copyOf(ObjectArrayList.wrap(array));
}
public boolean[] toFlags() public int getRotation() {
{ switch(count) {
return toFlags(array);
}
public int getRotation()
{
switch(count)
{
case 1: return array[0].getRotation(); case 1: return array[0].getRotation();
case 2: return array[0].getRotation(array[1]); case 2: return array[0].getRotation(array[1]);
default: return 0; default: return 0;
} }
} }
public FacingList rotate(int amount) public FacingList rotate(int amount) {
{ switch(amount & 3) {
switch(amount & 3)
{
case 1: return FACINGS[next]; case 1: return FACINGS[next];
case 2: return FACINGS[opposite]; case 2: return FACINGS[opposite];
case 3: return FACINGS[prev]; case 3: return FACINGS[prev];
@ -136,177 +91,70 @@ public final class FacingList implements Iterable<Facing>, Predicate<Facing>
} }
} }
public FacingList invert() public FacingList invert() { return FACINGS[15 - code]; }
{ public FacingList opposite() { return FACINGS[opposite]; }
return FACINGS[15 - code]; public FacingList add(Facing facing) { return FACINGS[code | (1 << facing.getIndex())]; }
} public FacingList add(FacingList facings) { return FACINGS[code | facings.code]; }
public FacingList remove(Facing facing) { return FACINGS[code & ~(1 << facing.getIndex())]; }
public FacingList opposite() public FacingList remove(FacingList facings) { return FACINGS[code & ~facings.code]; }
{ public boolean contains(Facing direction) { return (code & 1 << direction.getIndex()) != 0; }
return FACINGS[opposite]; public boolean contains(FacingList facings) { return (code & facings.code) == facings.code; }
} public boolean containsAny(FacingList facings) { return (code & facings.code) != 0; }
public boolean notContains(Facing direction) { return (code & 1 << direction.getIndex()) == 0; }
public FacingList add(Facing facing) public boolean notContains(FacingList facings) { return (code & facings.code) != facings.code; }
{ public FacingList flipFacing(Facing facing) { return contains(facing) ? remove(facing).add(facing.opposite()) : this; }
return FACINGS[code | (1 << facing.getIndex())]; public FacingList flipAxis(Axis axis) {
}
public FacingList add(FacingList facings)
{
return FACINGS[code | facings.code];
}
public FacingList remove(Facing facing)
{
return FACINGS[code & ~(1 << facing.getIndex())];
}
public FacingList remove(FacingList facings)
{
return FACINGS[code & ~facings.code];
}
public boolean contains(Facing direction)
{
return (code & 1 << direction.getIndex()) != 0;
}
public boolean contains(FacingList facings)
{
return (code & facings.code) == facings.code;
}
public boolean containsAny(FacingList facings)
{
return (code & facings.code) != 0;
}
public boolean notContains(Facing direction)
{
return (code & 1 << direction.getIndex()) == 0;
}
public boolean notContains(FacingList facings)
{
return (code & facings.code) != facings.code;
}
public FacingList flipFacing(Facing facing)
{
return contains(facing) ? remove(facing).add(facing.opposite()) : this;
}
public FacingList flipAxis(Axis axis)
{
FacingList result = this; FacingList result = this;
for(int i = 0,m=array.length;i<m;i++) for(int i = 0,m = array.length;i < m;i++) { if(array[i].getAxis() == axis) { result = result.remove(array[i]).add(array[i].opposite()); } }
{
if(array[i].getAxis() == axis)
{
result = result.remove(array[i]).add(array[i].opposite());
}
}
return result; return result;
} }
public Vec2i getOffset() public Vec2i getOffset() { return offset; }
{ public Facing getFacing(int index) { return array[index]; }
return offset; public int getCode() { return code; }
} public int size() { return count; }
public boolean isEmpty() { return code == 0; }
public Facing getFacing(int index) public boolean isFull() { return code == 15; }
{
return array[index];
}
public int getCode()
{
return code;
}
public int size()
{
return count;
}
public boolean isEmpty()
{
return code == 0;
}
public boolean isFull()
{
return code == 15;
}
@Override @Override
public String toString() public String toString() {
{
StringJoiner joiner = new StringJoiner(",", "[", "]"); StringJoiner joiner = new StringJoiner(",", "[", "]");
for(int i = 0,m=array.length;i<m;i++) for(int i = 0,m = array.length;i < m;i++) { joiner.add(array[i].getName()); }
{
joiner.add(array[i].getName());
}
return joiner.toString(); return joiner.toString();
} }
@Override @Override
public boolean test(Facing t) public boolean test(Facing t) { return (code & 1 << t.getIndex()) != 0; }
{
return (code & 1 << t.getIndex()) != 0;
}
@Override @Override
public Iterator<Facing> iterator() public Iterator<Facing> iterator() {
{ return new Iterator<Facing>() {
return new Iterator<Facing>(){
int index = 0; int index = 0;
@Override
public boolean hasNext()
{
return index < size();
}
@Override @Override
public Facing next() public boolean hasNext() { return index < size(); }
{ @Override
return array[index++]; public Facing next() { return array[index++]; }
}
}; };
} }
public static int toNumber(Facing...facings) public static int toNumber(Facing... facings) {
{
int value = 0; int value = 0;
for(int i = 0,m=facings.length;i<m;i++) for(int i = 0,m = facings.length;i < m;i++) { value |= (1 << facings[i].getIndex()); }
{
value |= (1 << facings[i].getIndex());
}
return value & 15; return value & 15;
} }
public static int toNumber(boolean[] facings) public static int toNumber(boolean[] facings) { return (facings[0] ? 1 : 0) << 0 | (facings[1] ? 1 : 0) << 1 | (facings[2] ? 1 : 0) << 2 | (facings[3] ? 1 : 0) << 3; }
{
return (facings[0] ? 1 : 0) << 0 | (facings[1] ? 1 : 0) << 1 | (facings[2] ? 1 : 0) << 2 | (facings[3] ? 1 : 0) << 3;
}
public static boolean[] toFlags(Facing...facings) public static boolean[] toFlags(Facing... facings) {
{
boolean[] array = new boolean[4]; boolean[] array = new boolean[4];
for(int i = 0,m=facings.length;i<m;i++) for(int i = 0,m = facings.length;i < m;i++) { array[facings[i].getIndex()] = true; }
{
array[facings[i].getIndex()] = true;
}
return array; return array;
} }
private static FacingList[] createArray() private static FacingList[] createArray() {
{
FacingList[] facings = new FacingList[16]; FacingList[] facings = new FacingList[16];
for(int i = 0;i<16;i++) for(int i = 0;i < 16;i++) { facings[i] = new FacingList(i); }
{
facings[i] = new FacingList(i);
}
return facings; return facings;
} }
} }

View File

@ -6,26 +6,25 @@ public class SmoothFloat
protected float target; protected float target;
protected float agility; protected float agility;
public SmoothFloat(float agility) public SmoothFloat(float agility) {
{
this.agility = agility; this.agility = agility;
} }
public SmoothFloat(float value, float agility) public SmoothFloat(float value, float agility) {
{
this.value = value; this.value = value;
target = value; target = value;
this.agility = agility; this.agility = agility;
} }
public boolean isDone(){return Math.abs(target - value) <= 0.5F;} public boolean isDone() { return isDone(0.0005F); }
public void update(float delta){value += (target - value) * agility * delta;} public boolean isDone(float limit) { return Math.abs(target - value) <= limit; }
public void update(float delta) { value += (target - value) * agility * delta; }
public void setTarget(float value){target = value;} public void setTarget(float value) { target = value; }
public void addTarget(float value){target += value;} public void addTarget(float value) { target += value; }
public void forceFinish(){value = target;} public void forceFinish() { value = target; }
public float getValue(){return value;} public float getValue() { return value; }
public float getTarget(){return target;} public float getTarget() { return target; }
} }

View File

@ -9,36 +9,28 @@ public class SmoothVec3f
Vec3f helper = Vec3f.mutable(); Vec3f helper = Vec3f.mutable();
float agility = 0F; float agility = 0F;
public SmoothVec3f(float agility) public SmoothVec3f(float agility) {
{
this.agility = agility; this.agility = agility;
} }
public SmoothVec3f(Vec3f vec, float agility) public SmoothVec3f(Vec3f vec, float agility) {
{
value.set(vec); value.set(vec);
target.set(vec); target.set(vec);
this.agility = agility; this.agility = agility;
} }
public boolean isDone() public boolean isDone() { return isDone(0.0005F); }
{ public boolean isDone(float limit) { return target.distanceToSquared(value) <= limit; }
return target.distanceToSquared(value) <= 0.005F; public void update(float delta) { value.add(target.difference(value, helper).multiply(agility * delta)); }
}
public void update(float delta) public void setTarget(Vec3f value) { target.set(value); }
{ public void setTarget(float x, float y, float z) { target.set(x, y, z); }
value.add(target.difference(value, helper).multiply(agility * delta));
}
public void setTarget(Vec3f value){setTarget(value.getX(), value.getY(), value.getZ());} public void addTarget(Vec3f value) { target.add(value); }
public void setTarget(float x, float y, float z) {target.set(x, y, z);} public void addTarget(float x, float y, float z) { target.add(x, y, z); }
public void addTarget(Vec3f value){addTarget(value.getX(), value.getY(), value.getZ());} public Vec3f getTarget() { return target.copy(); }
public void addTarget(float x, float y, float z) {target.add(x, y, z);} public Vec3f getValue() { return value.copy();}
public Vec3f getTarget(){return target.copy();} public void forceFinish() { value.set(target); }
public Vec3f getValue(){return value.copy();}
public void forceFinish(){value.set(target);}
} }

View File

@ -1,29 +1,19 @@
package speiger.src.coreengine.math.value; package speiger.src.coreengine.math.value;
public class ConstantValue extends Value public class ConstantValue extends Value {
{
public static final IValue MINUS_ONE = new ConstantValue(-1F); public static final IValue MINUS_ONE = new ConstantValue(-1F);
public static final IValue ZERO = new ConstantValue(0F); public static final IValue ZERO = new ConstantValue(0F);
public static final IValue ONE = new ConstantValue(1F); public static final IValue ONE = new ConstantValue(1F);
final float value; final float value;
public ConstantValue(float value) public ConstantValue(float value) {
{
super(0F, 0F); super(0F, 0F);
this.value = value; this.value = value;
update(-1F); update(-1F);
} }
@Override @Override
protected float calculateProgress(float time) protected float calculateProgress(float time) { return value; }
{
return value;
}
@Override @Override
protected void onInitialValueSet() protected void onInitialValueSet() { finishProgress(); }
{
finishProgress();
}
} }

View File

@ -2,21 +2,18 @@ package speiger.src.coreengine.math.value;
import speiger.src.coreengine.math.MathUtils; import speiger.src.coreengine.math.MathUtils;
public class CubicValue extends Value public class CubicValue extends Value {
{
final float startValue; final float startValue;
final float startHelperValue; final float startHelperValue;
final float endHelperValue; final float endHelperValue;
final float endValue; final float endValue;
boolean smooth = false; boolean smooth = false;
public CubicValue(float duration, float startValue, float startHelper, float endHelper, float endValue) public CubicValue(float duration, float startValue, float startHelper, float endHelper, float endValue) {
{
this(0F, duration, startValue, startHelper, endHelper, endValue); this(0F, duration, startValue, startHelper, endHelper, endValue);
} }
public CubicValue(float start, float duration, float startValue, float startHelper, float endHelper, float endValue) public CubicValue(float start, float duration, float startValue, float startHelper, float endHelper, float endValue) {
{
super(start, duration); super(start, duration);
this.startValue = startValue; this.startValue = startValue;
startHelperValue = startHelper; startHelperValue = startHelper;
@ -24,23 +21,19 @@ public class CubicValue extends Value
this.endValue = endValue; this.endValue = endValue;
} }
public CubicValue setSmooth() public CubicValue setSmooth() {
{
smooth = true; smooth = true;
return this; return this;
} }
public CubicValue setSmooth(boolean smooth) public CubicValue setSmooth(boolean smooth) {
{
this.smooth = smooth; this.smooth = smooth;
return this; return this;
} }
@Override @Override
protected float calculateProgress(float time) protected float calculateProgress(float time) {
{ if(smooth) {
if(smooth)
{
float first = MathUtils.smoothQuadraticCurve(startValue, startHelperValue, endHelperValue, time); float first = MathUtils.smoothQuadraticCurve(startValue, startHelperValue, endHelperValue, time);
float second = MathUtils.smoothQuadraticCurve(startHelperValue, endHelperValue, endValue, time); float second = MathUtils.smoothQuadraticCurve(startHelperValue, endHelperValue, endValue, time);
return MathUtils.smoothLerp(first, second, time); return MathUtils.smoothLerp(first, second, time);
@ -51,9 +44,5 @@ public class CubicValue extends Value
} }
@Override @Override
protected void onFinished() protected void onFinished() { finishProgress(); }
{
finishProgress();
}
} }

View File

@ -1,15 +1,8 @@
package speiger.src.coreengine.math.value; package speiger.src.coreengine.math.value;
public interface IValue public interface IValue {
{
public float get(); public float get();
public default float get(float min, float max) { return min + ((max - min) * get()); }
public default float get(float min, float max)
{
return min + ((max - min) * get());
}
public float update(float particalTicks); public float update(float particalTicks);
public boolean isDone(); public boolean isDone();
} }

View File

@ -2,45 +2,33 @@ package speiger.src.coreengine.math.value;
import speiger.src.coreengine.math.MathUtils; import speiger.src.coreengine.math.MathUtils;
public class LiniarValue extends Value public class LiniarValue extends Value {
{
final float startValue; final float startValue;
final float endValue; final float endValue;
boolean smooth = false; boolean smooth = false;
public LiniarValue(float duration, float startValue, float endValue) public LiniarValue(float duration, float startValue, float endValue) {
{
this(0F, duration, startValue, endValue); this(0F, duration, startValue, endValue);
} }
public LiniarValue(float start, float duration, float startValue, float endValue) public LiniarValue(float start, float duration, float startValue, float endValue) {
{
super(start, duration); super(start, duration);
this.startValue = startValue; this.startValue = startValue;
this.endValue = endValue; this.endValue = endValue;
} }
public LiniarValue setSmooth() public LiniarValue setSmooth() {
{
smooth = true; smooth = true;
return this; return this;
} }
public LiniarValue setSmooth(boolean smooth) public LiniarValue setSmooth(boolean smooth) {
{
this.smooth = smooth; this.smooth = smooth;
return this; return this;
} }
@Override @Override
protected float calculateProgress(float time) protected float calculateProgress(float time) { return smooth ? MathUtils.smoothLerp(startValue, endValue, time) : MathUtils.lerp(startValue, endValue, time); }
{
return smooth ? MathUtils.smoothLerp(startValue, endValue, time) : MathUtils.lerp(startValue, endValue, time);
}
@Override @Override
protected void onFinished() protected void onFinished() { finishProgress(); }
{
finishProgress();
}
} }

View File

@ -2,47 +2,36 @@ package speiger.src.coreengine.math.value;
import speiger.src.coreengine.math.MathUtils; import speiger.src.coreengine.math.MathUtils;
public class QuadraticValue extends Value public class QuadraticValue extends Value {
{
final float startValue; final float startValue;
final float medianValue; final float medianValue;
final float endValue; final float endValue;
boolean smooth; boolean smooth;
public QuadraticValue(float duration, float startValue, float medianValue, float endValue) public QuadraticValue(float duration, float startValue, float medianValue, float endValue) {
{
this(0F, duration, startValue, medianValue, endValue); this(0F, duration, startValue, medianValue, endValue);
} }
public QuadraticValue(float start, float duration, float startValue, float medianValue, float endValue) public QuadraticValue(float start, float duration, float startValue, float medianValue, float endValue) {
{
super(start, duration); super(start, duration);
this.startValue = startValue; this.startValue = startValue;
this.medianValue = medianValue; this.medianValue = medianValue;
this.endValue = endValue; this.endValue = endValue;
} }
public QuadraticValue setSmooth() public QuadraticValue setSmooth() {
{
smooth = true; smooth = true;
return this; return this;
} }
public QuadraticValue setSmooth(boolean smooth) public QuadraticValue setSmooth(boolean smooth) {
{
this.smooth = smooth; this.smooth = smooth;
return this; return this;
} }
@Override @Override
protected float calculateProgress(float time) protected float calculateProgress(float time) { return smooth ? MathUtils.smoothQuadraticCurve(startValue, medianValue, endValue, time) : MathUtils.quadraticCurve(startValue, medianValue, endValue, time); }
{
return smooth ? MathUtils.smoothQuadraticCurve(startValue, medianValue, endValue, time) : MathUtils.quadraticCurve(startValue, medianValue, endValue, time);
}
@Override @Override
protected void onFinished() protected void onFinished() { finishProgress(); }
{
finishProgress();
}
} }

View File

@ -1,78 +1,52 @@
package speiger.src.coreengine.math.value; package speiger.src.coreengine.math.value;
public abstract class Value implements IValue public abstract class Value implements IValue {
{
final float start; final float start;
final float duration; final float duration;
byte flags = 0; byte flags = 0;
int done = 0; int done = 0;
float progress = 0F; float progress = 0F;
float value; float value;
public Value(float duration) public Value(float duration) {
{
this(0F, duration); this(0F, duration);
} }
public Value(float start, float duration) public Value(float start, float duration) {
{
this.duration = duration; this.duration = duration;
this.start = start; this.start = start;
} }
@Override @Override
public float update(float particleTime) public float update(float particleTime) {
{ if((flags & 2) != 0) { return value; }
if((flags & 2) != 0)
{
return value;
}
progress += particleTime; progress += particleTime;
if(progress < start) if(progress < start) {
{ if((flags & 1) == 0) {
if((flags & 1) == 0)
{
value = calculateProgress(0F); value = calculateProgress(0F);
onInitialValueSet(); onInitialValueSet();
} }
return value; return value;
} }
value = calculateProgress((progress - start) / duration); value = calculateProgress((progress - start) / duration);
if(progress >= start + duration) if(progress >= start + duration) { onFinished(); }
{
onFinished();
}
return value; return value;
} }
@Override @Override
public float get() public float get() { return value; }
{
return value;
}
@Override @Override
public boolean isDone() public boolean isDone() { return done > 0; }
{
return done > 0;
}
protected abstract float calculateProgress(float time); protected abstract float calculateProgress(float time);
protected void onFinished() protected void onFinished() {
{
progress = start; progress = start;
done++; done++;
} }
protected void onInitialValueSet() protected void onInitialValueSet() { flags |= 1; }
{
flags |= 1;
}
protected void finishProgress() protected void finishProgress() {
{
flags |= 2; flags |= 2;
done++; done++;
} }

View File

@ -7,10 +7,10 @@ public class VectorUtil
{ {
public static float barryCentric(Vec3f p1, Vec3f p2, Vec3f p3, Vec2f pos) public static float barryCentric(Vec3f p1, Vec3f p2, Vec3f p3, Vec2f pos)
{ {
float det = (p2.getZ() - p3.getZ()) * (p1.getX() - p3.getX()) + (p3.getX() - p2.getX()) * (p1.getZ() - p3.getZ()); float det = (p2.z() - p3.z()) * (p1.x() - p3.x()) + (p3.x() - p2.x()) * (p1.z() - p3.z());
float l1 = ((p2.getZ() - p3.getZ()) * (pos.getX() - p3.getX()) + (p3.getX() - p2.getX()) * (pos.getY() - p3.getZ())) / det; float l1 = ((p2.z() - p3.z()) * (pos.x() - p3.x()) + (p3.x() - p2.x()) * (pos.y() - p3.z())) / det;
float l2 = ((p3.getZ() - p1.getZ()) * (pos.getX() - p3.getX()) + (p1.getX() - p3.getX()) * (pos.getY() - p3.getZ())) / det; float l2 = ((p3.z() - p1.z()) * (pos.x() - p3.x()) + (p1.x() - p3.x()) * (pos.y() - p3.z())) / det;
float l3 = 1.0f - l1 - l2; float l3 = 1.0f - l1 - l2;
return l1 * p1.getY() + l2 * p2.getY() + l3 * p3.getY(); return l1 * p1.y() + l2 * p2.y() + l3 * p3.y();
} }
} }

View File

@ -17,106 +17,106 @@ public interface Vec2b extends Vecb {
public static Vec2b mutable() { return new Vec2bMutable(); } public static Vec2b mutable() { return new Vec2bMutable(); }
public static Vec2b mutable(byte value) { return new Vec2bMutable(value); } public static Vec2b mutable(byte value) { return new Vec2bMutable(value); }
public static Vec2b mutable(byte x, byte y) { return new Vec2bMutable(x, y); } public static Vec2b mutable(byte x, byte y) { return new Vec2bMutable(x, y); }
public static Vec2b mutable(Vec2b value) { return mutable(value.getX(), value.getY()); } public static Vec2b mutable(Vec2b value) { return mutable(value.x(), value.y()); }
public static Vec2b of() { return new Vec2bImmutable(); } public static Vec2b of() { return new Vec2bImmutable(); }
public static Vec2b of(byte value) { return new Vec2bImmutable(value); } public static Vec2b of(byte value) { return new Vec2bImmutable(value); }
public static Vec2b of(byte x, byte y) { return new Vec2bImmutable(x, y); } public static Vec2b of(byte x, byte y) { return new Vec2bImmutable(x, y); }
public static Vec2b of(Vec2b value) { return of(value.getX(), value.getY()); } public static Vec2b of(Vec2b value) { return of(value.x(), value.y()); }
public byte getX(); public byte x();
public byte getY(); public byte y();
public Vec2b setX(byte x); public Vec2b x(byte x);
public Vec2b setY(byte y); public Vec2b y(byte y);
@Override @Override
public default byte[] asArray() { return new byte[] {getX(), getY()}; } public default byte[] asArray() { return new byte[] {x(), y()}; }
@Override @Override
public Vec2b copy(); public Vec2b copy();
@Override @Override
public default Vec2b abs() { return set((byte)Math.abs(getX()), (byte)Math.abs(getY())); } public default Vec2b abs() { return set((byte)Math.abs(x()), (byte)Math.abs(y())); }
@Override @Override
public default Vec2b negate() { return set((byte)0, (byte)0); } public default Vec2b negate() { return set((byte)0, (byte)0); }
@Override @Override
public default Vec2b invert() { return set((byte)(-getX()), (byte)(-getY())); }; public default Vec2b invert() { return set((byte)(-x()), (byte)(-y())); };
@Override @Override
public default Vec2b add(byte value) { return add(value, value); } public default Vec2b add(byte value) { return add(value, value); }
public default Vec2b add(Vec2b value) { return add(value.getX(), value.getY()); } public default Vec2b add(Vec2b value) { return add(value.x(), value.y()); }
public default Vec2b add(byte x, byte y) { return set((byte)(x + getX()), (byte)(y + getY())); } public default Vec2b add(byte x, byte y) { return set((byte)(x + x()), (byte)(y + y())); }
@Override @Override
public default Vec2b sub(byte value) { return sub(value, value); } public default Vec2b sub(byte value) { return sub(value, value); }
public default Vec2b sub(Vec2b value) { return sub(value.getX(), value.getY()); } public default Vec2b sub(Vec2b value) { return sub(value.x(), value.y()); }
public default Vec2b sub(byte x, byte y) { return set((byte)(getX() - x), (byte)(getY() - y)); } public default Vec2b sub(byte x, byte y) { return set((byte)(x() - x), (byte)(y() - y)); }
@Override @Override
public default Vec2b multiply(byte value) { return multiply(value, value); } public default Vec2b multiply(byte value) { return multiply(value, value); }
public default Vec2b multiply(Vec2b value) { return multiply(value.getX(), value.getY()); } public default Vec2b multiply(Vec2b value) { return multiply(value.x(), value.y()); }
public default Vec2b multiply(byte x, byte y) { return set((byte)(x * getX()), (byte)(y * getY())); } public default Vec2b multiply(byte x, byte y) { return set((byte)(x * x()), (byte)(y * y())); }
@Override @Override
public default Vec2b devide(byte value) { return devide(value, value); } public default Vec2b devide(byte value) { return devide(value, value); }
public default Vec2b devide(Vec2b value) { return devide(value.getX(), value.getY()); } public default Vec2b devide(Vec2b value) { return devide(value.x(), value.y()); }
public default Vec2b devide(byte x, byte y) { return set((byte)(getX() / x), (byte)(getY() / y)); } public default Vec2b devide(byte x, byte y) { return set((byte)(x() / x), (byte)(y() / y)); }
@Override @Override
public default Vec2b set(byte value) { return set(value, value); }; public default Vec2b set(byte value) { return set(value, value); };
public default Vec2b set(Vec2b value) { return set(value.getX(), value.getY()); } public default Vec2b set(Vec2b value) { return set(value.x(), value.y()); }
public Vec2b set(byte x, byte y); public Vec2b set(byte x, byte y);
public default double distanceTo(Vec2b value) { return distanceTo(value.getX(), value.getY()); } public default double distanceTo(Vec2b value) { return distanceTo(value.x(), value.y()); }
public default double distanceTo(byte x, byte y) { return Math.sqrt(distanceToSquared(x, y)); } public default double distanceTo(byte x, byte y) { return Math.sqrt(distanceToSquared(x, y)); }
public default long distanceToSquared(Vec2b value) { return distanceToSquared(value.getX(), value.getY()); } public default long distanceToSquared(Vec2b value) { return distanceToSquared(value.x(), value.y()); }
public default long distanceToSquared(byte x, byte y) { public default long distanceToSquared(byte x, byte y) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
return (xPos * xPos) + (yPos * yPos); return (xPos * xPos) + (yPos * yPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()); } public default long lengthSquared() { return (x() * x()) + (y() * y()); }
public default long dotProduct(Vec2b value) { return dotProduct(value.getX(), value.getY()); } public default long dotProduct(Vec2b value) { return dotProduct(value.x(), value.y()); }
public default long dotProduct(byte x, byte y) { return (getX() * x) + (getY() * y); } public default long dotProduct(byte x, byte y) { return (x() * x) + (y() * y); }
public default Vec2b rotate(byte angle, Vec2b center) { return rotate(angle, center.getX(), center.getY()); } public default Vec2b rotate(byte angle, Vec2b center) { return rotate(angle, center.x(), center.y()); }
public default Vec2b rotate(byte angle, byte x, byte y) { public default Vec2b rotate(byte angle, byte x, byte y) {
byte xPos = (byte)(getX() - x); byte xPos = (byte)(x() - x);
byte yPos = (byte)(getY() - y); byte yPos = (byte)(y() - y);
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
return set((byte)((xPos * cos) + (yPos * sin) + x), (byte)(-(xPos * sin) + (yPos * cos) + y)); return set((byte)((xPos * cos) + (yPos * sin) + x), (byte)(-(xPos * sin) + (yPos * cos) + y));
} }
public default Vec2b min(Vec2b other) { return min(other, this); } public default Vec2b min(Vec2b other) { return min(other, this); }
public default Vec2b min(Vec2b other, Vec2b result) { return min(other.getX(), other.getY(), result); } public default Vec2b min(Vec2b other, Vec2b result) { return min(other.x(), other.y(), result); }
public default Vec2b min(byte x, byte y) { return min(x, y, this); } public default Vec2b min(byte x, byte y) { return min(x, y, this); }
public default Vec2b min(byte x, byte y, Vec2b result) { return result.set((byte)Math.min(getX(), x), (byte)Math.min(getY(), y)); } public default Vec2b min(byte x, byte y, Vec2b result) { return result.set((byte)Math.min(x(), x), (byte)Math.min(y(), y)); }
public default Vec2b max(Vec2b other) { return max(other, this); } public default Vec2b max(Vec2b other) { return max(other, this); }
public default Vec2b max(Vec2b other, Vec2b result) { return max(other.getX(), other.getY(), result); } public default Vec2b max(Vec2b other, Vec2b result) { return max(other.x(), other.y(), result); }
public default Vec2b max(byte x, byte y) { return max(x, y, this); } public default Vec2b max(byte x, byte y) { return max(x, y, this); }
public default Vec2b max(byte x, byte y, Vec2b result) { return result.set((byte)Math.max(getX(), x), (byte)Math.max(getY(), y)); } public default Vec2b max(byte x, byte y, Vec2b result) { return result.set((byte)Math.max(x(), x), (byte)Math.max(y(), y)); }
public default Vec2b difference(Vec2b other) { return difference(other, this); } public default Vec2b difference(Vec2b other) { return difference(other, this); }
public default Vec2b difference(Vec2b other, Vec2b result) { return difference(other.getX(), other.getY(), result); } public default Vec2b difference(Vec2b other, Vec2b result) { return difference(other.x(), other.y(), result); }
public default Vec2b difference(byte x, byte y) { return difference(x, y, this); } public default Vec2b difference(byte x, byte y) { return difference(x, y, this); }
public default Vec2b difference(byte x, byte y, Vec2b result) { return result.set((byte)(getX() - x), (byte)(getY() - y)); } public default Vec2b difference(byte x, byte y, Vec2b result) { return result.set((byte)(x() - x), (byte)(y() - y)); }
@Override @Override
public default Vec2b clamp(byte min, byte max) { return clamp(min, max, ALL); } public default Vec2b clamp(byte min, byte max) { return clamp(min, max, ALL); }
public default Vec2b clamp(byte min, byte max, Vec2b result) { return clamp(min, max, result, ALL); } public default Vec2b clamp(byte min, byte max, Vec2b result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec2b clamp(byte min, byte max, int filter) { return clamp(min, max, this, filter); } public default Vec2b clamp(byte min, byte max, int filter) { return clamp(min, max, this, filter); }
public default Vec2b clamp(byte min, byte max, Vec2b result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY())); } public default Vec2b clamp(byte min, byte max, Vec2b result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y())); }
@Override @Override
public default Vec2b store(ByteBuffer buffer) { public default Vec2b store(ByteBuffer buffer) {
buffer.put(getX()).put(getY()); buffer.put(x()).put(y());
return this; return this;
} }
@Override @Override
public default Vec2b load(ByteBuffer buffer) { return set(buffer.get(), buffer.get()); } public default Vec2b load(ByteBuffer buffer) { return set(buffer.get(), buffer.get()); }
@Override @Override
public default Vec2s asShort() { return isMutable() ? Vec2s.mutable(getX(), getY()) : Vec2s.of(getX(), getY()); } public default Vec2s asShort() { return isMutable() ? Vec2s.mutable(x(), y()) : Vec2s.of(x(), y()); }
@Override @Override
public default Vec2i asInt() { return isMutable() ? Vec2i.mutable(getX(), getY()) : Vec2i.of(getX(), getY()); } public default Vec2i asInt() { return isMutable() ? Vec2i.mutable(x(), y()) : Vec2i.of(x(), y()); }
@Override @Override
public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(getX(), getY()) : Vec2l.of(getX(), getY()); } public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(x(), y()) : Vec2l.of(x(), y()); }
@Override @Override
public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable(getX(), getY()) : Vec2f.of(getX(), getY()); } public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable(x(), y()) : Vec2f.of(x(), y()); }
@Override @Override
public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(getX(), getY()) : Vec2d.of(getX(), getY()); } public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(x(), y()) : Vec2d.of(x(), y()); }
@Override @Override
public default Vec2b asMutable() { return isMutable() ? this : mutable(this); } public default Vec2b asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -24,13 +24,13 @@ public class Vec2bImmutable implements Vec2b {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public byte getX() { return x; } public byte x() { return x; }
@Override @Override
public byte getY() { return y; } public byte y() { return y; }
@Override @Override
public Vec2b setX(byte x) { return this.x == x ? this : Vec2b.of(x, y); } public Vec2b x(byte x) { return this.x == x ? this : Vec2b.of(x, y); }
@Override @Override
public Vec2b setY(byte y) { return this.y == y ? this : Vec2b.of(x, y); } public Vec2b y(byte y) { return this.y == y ? this : Vec2b.of(x, y); }
@Override @Override
public Vec2b copy() { return Vec2b.of(this); } public Vec2b copy() { return Vec2b.of(this); }
@Override @Override
@ -41,7 +41,7 @@ public class Vec2bImmutable implements Vec2b {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2b) { if(obj instanceof Vec2b) {
Vec2b vec = (Vec2b)obj; Vec2b vec = (Vec2b)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -21,18 +21,18 @@ public class Vec2bMutable implements Vec2b {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public byte getX() { return x; } public byte x() { return x; }
@Override @Override
public byte getY() { return y; } public byte y() { return y; }
@Override @Override
public Vec2b setX(byte x) { public Vec2b x(byte x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec2b setY(byte y) { public Vec2b y(byte y) {
this.y = y; this.y = y;
return this; return this;
} }
@ -54,7 +54,7 @@ public class Vec2bMutable implements Vec2b {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2b) { if(obj instanceof Vec2b) {
Vec2b vec = (Vec2b)obj; Vec2b vec = (Vec2b)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -17,101 +17,101 @@ public interface Vec3b extends Vecb {
public static Vec3b mutable() { return new Vec3bMutable(); } public static Vec3b mutable() { return new Vec3bMutable(); }
public static Vec3b mutable(byte value) { return new Vec3bMutable(value); } public static Vec3b mutable(byte value) { return new Vec3bMutable(value); }
public static Vec3b mutable(byte x, byte y, byte z) { return new Vec3bMutable(x, y, z); } public static Vec3b mutable(byte x, byte y, byte z) { return new Vec3bMutable(x, y, z); }
public static Vec3b mutable(Vec3b vec) { return mutable(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3b mutable(Vec3b vec) { return mutable(vec.x(), vec.y(), vec.z()); }
public static Vec3b of() { return new Vec3bImmutable(); } public static Vec3b of() { return new Vec3bImmutable(); }
public static Vec3b of(byte value) { return new Vec3bImmutable(value); } public static Vec3b of(byte value) { return new Vec3bImmutable(value); }
public static Vec3b of(byte x, byte y, byte z) { return new Vec3bImmutable(x, y, z); } public static Vec3b of(byte x, byte y, byte z) { return new Vec3bImmutable(x, y, z); }
public static Vec3b of(Vec3b vec) { return of(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3b of(Vec3b vec) { return of(vec.x(), vec.y(), vec.z()); }
public byte getX(); public byte x();
public byte getY(); public byte y();
public byte getZ(); public byte z();
public Vec3b setX(byte x); public Vec3b x(byte x);
public Vec3b setY(byte y); public Vec3b y(byte y);
public Vec3b setZ(byte z); public Vec3b z(byte z);
@Override @Override
public default byte[] asArray() { return new byte[] {getX(), getY(), getZ()}; } public default byte[] asArray() { return new byte[] {x(), y(), z()}; }
@Override @Override
public Vec3b copy(); public Vec3b copy();
@Override @Override
public default Vec3b abs() { return set((byte)Math.abs(getX()), (byte)Math.abs(getY()), (byte)Math.abs(getZ())); } public default Vec3b abs() { return set((byte)Math.abs(x()), (byte)Math.abs(y()), (byte)Math.abs(z())); }
@Override @Override
public default Vec3b negate() { return set((byte)0, (byte)0, (byte)0); } public default Vec3b negate() { return set((byte)0, (byte)0, (byte)0); }
@Override @Override
public default Vec3b invert() { return set((byte)-getX(), (byte)-getY(), (byte)-getZ()); } public default Vec3b invert() { return set((byte)-x(), (byte)-y(), (byte)-z()); }
@Override @Override
public default Vec3b add(byte value) { return add(value, value, value); } public default Vec3b add(byte value) { return add(value, value, value); }
public default Vec3b add(Vec3b value) { return add(value.getX(), value.getY(), value.getZ()); } public default Vec3b add(Vec3b value) { return add(value.x(), value.y(), value.z()); }
public default Vec3b add(byte x, byte y, byte z) { return set((byte)(getX() + x), (byte)(getY() + y), (byte)(getZ() + z)); } public default Vec3b add(byte x, byte y, byte z) { return set((byte)(x() + x), (byte)(y() + y), (byte)(z() + z)); }
@Override @Override
public default Vec3b sub(byte value) { return sub(value, value, value); } public default Vec3b sub(byte value) { return sub(value, value, value); }
public default Vec3b sub(Vec3b value) { return sub(value.getX(), value.getY(), value.getZ()); } public default Vec3b sub(Vec3b value) { return sub(value.x(), value.y(), value.z()); }
public default Vec3b sub(byte x, byte y, byte z) { return set((byte)(getX() - x), (byte)(getY() - y), (byte)(getZ() - z)); } public default Vec3b sub(byte x, byte y, byte z) { return set((byte)(x() - x), (byte)(y() - y), (byte)(z() - z)); }
@Override @Override
public default Vec3b multiply(byte value) { return multiply(value, value, value); } public default Vec3b multiply(byte value) { return multiply(value, value, value); }
public default Vec3b multiply(Vec3b value) { return multiply(value.getX(), value.getY(), value.getZ()); } public default Vec3b multiply(Vec3b value) { return multiply(value.x(), value.y(), value.z()); }
public default Vec3b multiply(byte x, byte y, byte z) { return set((byte)(getX() * x), (byte)(getY() * y), (byte)(getZ() * z)); } public default Vec3b multiply(byte x, byte y, byte z) { return set((byte)(x() * x), (byte)(y() * y), (byte)(z() * z)); }
@Override @Override
public default Vec3b devide(byte value) { return devide(value, value, value); } public default Vec3b devide(byte value) { return devide(value, value, value); }
public default Vec3b devide(Vec3b value) { return devide(value.getX(), value.getY(), value.getZ()); } public default Vec3b devide(Vec3b value) { return devide(value.x(), value.y(), value.z()); }
public default Vec3b devide(byte x, byte y, byte z) { return set((byte)(getX() / x), (byte)(getY() / y), (byte)(getZ() / z)); } public default Vec3b devide(byte x, byte y, byte z) { return set((byte)(x() / x), (byte)(y() / y), (byte)(z() / z)); }
@Override @Override
public default Vec3b set(byte value) { return set(value, value, value); } public default Vec3b set(byte value) { return set(value, value, value); }
public default Vec3b set(Vec3b value) { return set(value.getX(), value.getY(), value.getZ()); } public default Vec3b set(Vec3b value) { return set(value.x(), value.y(), value.z()); }
public Vec3b set(byte x, byte y, byte z); public Vec3b set(byte x, byte y, byte z);
public default double distanceTo(Vec3b value) { return distanceTo(value.getX(), value.getY(), value.getZ()); } public default double distanceTo(Vec3b value) { return distanceTo(value.x(), value.y(), value.z()); }
public default double distanceTo(byte x, byte y, byte z) { return Math.sqrt(distanceToSquared(x, y, z)); } public default double distanceTo(byte x, byte y, byte z) { return Math.sqrt(distanceToSquared(x, y, z)); }
public default long distanceToSquared(Vec3b value) { return distanceToSquared(value.getX(), value.getY(), value.getZ()); } public default long distanceToSquared(Vec3b value) { return distanceToSquared(value.x(), value.y(), value.z()); }
public default long distanceToSquared(byte x, byte y, byte z) { public default long distanceToSquared(byte x, byte y, byte z) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
long zPos = getZ() - z; long zPos = z() - z;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); } public default long lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()); }
public default long dotProduct(Vec3b value) { return dotProduct(value.getX(), value.getY(), value.getZ()); } public default long dotProduct(Vec3b value) { return dotProduct(value.x(), value.y(), value.z()); }
public default long dotProduct(byte x, byte y, byte z) { return (getX() * x) + (getY() * y) + (getZ() * z); } public default long dotProduct(byte x, byte y, byte z) { return (x() * x) + (y() * y) + (z() * z); }
public default Vec3b min(Vec3b other) { return min(other, this); } public default Vec3b min(Vec3b other) { return min(other, this); }
public default Vec3b min(Vec3b other, Vec3b result) { return min(other.getX(), other.getY(), other.getZ(), result); } public default Vec3b min(Vec3b other, Vec3b result) { return min(other.x(), other.y(), other.z(), result); }
public default Vec3b min(byte x, byte y, byte z) { return min(x, y, z, this); } public default Vec3b min(byte x, byte y, byte z) { return min(x, y, z, this); }
public default Vec3b min(byte x, byte y, byte z, Vec3b result) { return result.set((byte)Math.min(getX(), x), (byte)Math.min(getY(), y), (byte)Math.min(getZ(), z)); } public default Vec3b min(byte x, byte y, byte z, Vec3b result) { return result.set((byte)Math.min(x(), x), (byte)Math.min(y(), y), (byte)Math.min(z(), z)); }
public default Vec3b max(Vec3b other) { return max(other, this); } public default Vec3b max(Vec3b other) { return max(other, this); }
public default Vec3b max(Vec3b other, Vec3b result) { return max(other.getX(), other.getY(), other.getZ(), result); } public default Vec3b max(Vec3b other, Vec3b result) { return max(other.x(), other.y(), other.z(), result); }
public default Vec3b max(byte x, byte y, byte z) { return max(x, y, z, this); } public default Vec3b max(byte x, byte y, byte z) { return max(x, y, z, this); }
public default Vec3b max(byte x, byte y, byte z, Vec3b result) { return result.set((byte)Math.max(getX(), x), (byte)Math.max(getY(), y), (byte)Math.max(getZ(), z)); } public default Vec3b max(byte x, byte y, byte z, Vec3b result) { return result.set((byte)Math.max(x(), x), (byte)Math.max(y(), y), (byte)Math.max(z(), z)); }
public default Vec3b difference(Vec3b other) { return difference(other, this); } public default Vec3b difference(Vec3b other) { return difference(other, this); }
public default Vec3b difference(Vec3b other, Vec3b result) { return difference(other.getX(), other.getY(), other.getZ(), result); } public default Vec3b difference(Vec3b other, Vec3b result) { return difference(other.x(), other.y(), other.z(), result); }
public default Vec3b difference(byte x, byte y, byte z) { return difference(x, y, z, this); } public default Vec3b difference(byte x, byte y, byte z) { return difference(x, y, z, this); }
public default Vec3b difference(byte x, byte y, byte z, Vec3b result) { return result.set((byte)(getX() - x), (byte)(getY() - y), (byte)(getZ() - z)); } public default Vec3b difference(byte x, byte y, byte z, Vec3b result) { return result.set((byte)(x() - x), (byte)(y() - y), (byte)(z() - z)); }
@Override @Override
public default Vec3b clamp(byte min, byte max) { return clamp(min, max, ALL); } public default Vec3b clamp(byte min, byte max) { return clamp(min, max, ALL); }
public default Vec3b clamp(byte min, byte max, Vec3b result) { return clamp(min, max, result, ALL); } public default Vec3b clamp(byte min, byte max, Vec3b result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec3b clamp(byte min, byte max, int filter) { return clamp(min, max, this, filter); } public default Vec3b clamp(byte min, byte max, int filter) { return clamp(min, max, this, filter); }
public default Vec3b clamp(byte min, byte max, Vec3b result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ())); } public default Vec3b clamp(byte min, byte max, Vec3b result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z())); }
@Override @Override
public default Vec3b store(ByteBuffer buffer) { public default Vec3b store(ByteBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()); buffer.put(x()).put(y()).put(z());
return this; return this;
} }
@Override @Override
public default Vec3b load(ByteBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); } public default Vec3b load(ByteBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec3s asShort() { return isMutable() ? Vec3s.mutable(getX(), getY(), getZ()) : Vec3s.of(getX(), getY(), getZ()); } public default Vec3s asShort() { return isMutable() ? Vec3s.mutable(x(), y(), z()) : Vec3s.of(x(), y(), z()); }
@Override @Override
public default Vec3i asInt() { return isMutable() ? Vec3i.mutable(getX(), getY(), getZ()) : Vec3i.of(getX(), getY(), getZ()); } public default Vec3i asInt() { return isMutable() ? Vec3i.mutable(x(), y(), z()) : Vec3i.of(x(), y(), z()); }
@Override @Override
public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(getX(), getY(), getZ()) : Vec3l.of(getX(), getY(), getZ()); } public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(x(), y(), z()) : Vec3l.of(x(), y(), z()); }
@Override @Override
public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable(getX(), getY(), getZ()) : Vec3f.of(getX(), getY(), getZ()); } public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable(x(), y(), z()) : Vec3f.of(x(), y(), z()); }
@Override @Override
public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(getX(), getY(), getZ()) : Vec3d.of(getX(), getY(), getZ()); } public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(x(), y(), z()) : Vec3d.of(x(), y(), z()); }
@Override @Override
public default Vec3b asMutable() { return isMutable() ? this : mutable(this); } public default Vec3b asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -28,17 +28,17 @@ public class Vec3bImmutable implements Vec3b {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public byte getX() { return x; } public byte x() { return x; }
@Override @Override
public byte getY() { return y; } public byte y() { return y; }
@Override @Override
public byte getZ() { return z; } public byte z() { return z; }
@Override @Override
public Vec3b setX(byte x) { return this.x == x ? this : Vec3b.of(x, y, z); } public Vec3b x(byte x) { return this.x == x ? this : Vec3b.of(x, y, z); }
@Override @Override
public Vec3b setY(byte y) { return this.y == y ? this : Vec3b.of(x, y, z); } public Vec3b y(byte y) { return this.y == y ? this : Vec3b.of(x, y, z); }
@Override @Override
public Vec3b setZ(byte z) { return this.z == z ? this : Vec3b.of(x, y, z); } public Vec3b z(byte z) { return this.z == z ? this : Vec3b.of(x, y, z); }
@Override @Override
public Vec3b copy() { return Vec3b.of(this); } public Vec3b copy() { return Vec3b.of(this); }
@Override @Override
@ -49,7 +49,7 @@ public class Vec3bImmutable implements Vec3b {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3b) { if(obj instanceof Vec3b) {
Vec3b vec = (Vec3b)obj; Vec3b vec = (Vec3b)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -24,26 +24,26 @@ public class Vec3bMutable implements Vec3b {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public byte getX() { return x; } public byte x() { return x; }
@Override @Override
public byte getY() { return y; } public byte y() { return y; }
@Override @Override
public byte getZ() { return z; } public byte z() { return z; }
@Override @Override
public Vec3b setX(byte x) { public Vec3b x(byte x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec3b setY(byte y) { public Vec3b y(byte y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec3b setZ(byte z) { public Vec3b z(byte z) {
this.z = z; this.z = z;
return this; return this;
} }
@ -66,7 +66,7 @@ public class Vec3bMutable implements Vec3b {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3b) { if(obj instanceof Vec3b) {
Vec3b vec = (Vec3b)obj; Vec3b vec = (Vec3b)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -17,101 +17,101 @@ public interface Vec4b extends Vecb {
public static Vec4b mutable() { return new Vec4bMutable(); } public static Vec4b mutable() { return new Vec4bMutable(); }
public static Vec4b mutable(byte value) { return new Vec4bMutable(value); } public static Vec4b mutable(byte value) { return new Vec4bMutable(value); }
public static Vec4b mutable(byte x, byte y, byte z, byte w) { return new Vec4bMutable(x, y, z, w); } public static Vec4b mutable(byte x, byte y, byte z, byte w) { return new Vec4bMutable(x, y, z, w); }
public static Vec4b mutable(Vec4b vec) { return mutable(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4b mutable(Vec4b vec) { return mutable(vec.x(), vec.y(), vec.z(), vec.w()); }
public static Vec4b of() { return new Vec4bImmutable(); } public static Vec4b of() { return new Vec4bImmutable(); }
public static Vec4b of(byte value) { return new Vec4bImmutable(value); } public static Vec4b of(byte value) { return new Vec4bImmutable(value); }
public static Vec4b of(byte x, byte y, byte z, byte w) { return new Vec4bImmutable(x, y, z, w); } public static Vec4b of(byte x, byte y, byte z, byte w) { return new Vec4bImmutable(x, y, z, w); }
public static Vec4b of(Vec4b vec) { return of(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4b of(Vec4b vec) { return of(vec.x(), vec.y(), vec.z(), vec.w()); }
public byte getX(); public byte x();
public byte getY(); public byte y();
public byte getZ(); public byte z();
public byte getW(); public byte w();
public Vec4b setX(byte x); public Vec4b x(byte x);
public Vec4b setY(byte y); public Vec4b y(byte y);
public Vec4b setZ(byte z); public Vec4b z(byte z);
public Vec4b setW(byte w); public Vec4b w(byte w);
@Override @Override
public default byte[] asArray() { return new byte[] {getX(), getY(), getZ(), getW()}; } public default byte[] asArray() { return new byte[] {x(), y(), z(), w()}; }
@Override @Override
public Vec4b copy(); public Vec4b copy();
@Override @Override
public default Vec4b abs() { return set((byte)Math.abs(getX()), (byte)Math.abs(getY()), (byte)Math.abs(getZ()), (byte)Math.abs(getW())); } public default Vec4b abs() { return set((byte)Math.abs(x()), (byte)Math.abs(y()), (byte)Math.abs(z()), (byte)Math.abs(w())); }
@Override @Override
public default Vec4b negate() { return set((byte)0, (byte)0, (byte)0, (byte)0); } public default Vec4b negate() { return set((byte)0, (byte)0, (byte)0, (byte)0); }
@Override @Override
public default Vec4b invert() { return set((byte)-getX(), (byte)-getY(), (byte)-getZ(), (byte)-getW()); } public default Vec4b invert() { return set((byte)-x(), (byte)-y(), (byte)-z(), (byte)-w()); }
@Override @Override
public default Vec4b add(byte value) { return add(value, value, value, value); } public default Vec4b add(byte value) { return add(value, value, value, value); }
public default Vec4b add(Vec4b value) { return add(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4b add(Vec4b value) { return add(value.x(), value.y(), value.z(), value.w()); }
public default Vec4b add(byte x, byte y, byte z, byte w) { return set((byte)(getX() + x), (byte)(getY() + y), (byte)(getZ() + z), (byte)(getW() + w)); } public default Vec4b add(byte x, byte y, byte z, byte w) { return set((byte)(x() + x), (byte)(y() + y), (byte)(z() + z), (byte)(w() + w)); }
@Override @Override
public default Vec4b sub(byte value) { return sub(value, value, value, value); } public default Vec4b sub(byte value) { return sub(value, value, value, value); }
public default Vec4b sub(Vec4b value) { return sub(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4b sub(Vec4b value) { return sub(value.x(), value.y(), value.z(), value.w()); }
public default Vec4b sub(byte x, byte y, byte z, byte w) { return set((byte)(getX() - x), (byte)(getY() - y), (byte)(getZ() - z), (byte)(getW() - w)); } public default Vec4b sub(byte x, byte y, byte z, byte w) { return set((byte)(x() - x), (byte)(y() - y), (byte)(z() - z), (byte)(w() - w)); }
@Override @Override
public default Vec4b multiply(byte value) { return multiply(value, value, value, value); } public default Vec4b multiply(byte value) { return multiply(value, value, value, value); }
public default Vec4b multiply(Vec4b value) { return multiply(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4b multiply(Vec4b value) { return multiply(value.x(), value.y(), value.z(), value.w()); }
public default Vec4b multiply(byte x, byte y, byte z, byte w) { return set((byte)(getX() * x), (byte)(getY() * y), (byte)(getZ() * z), (byte)(getW() * w)); } public default Vec4b multiply(byte x, byte y, byte z, byte w) { return set((byte)(x() * x), (byte)(y() * y), (byte)(z() * z), (byte)(w() * w)); }
@Override @Override
public default Vec4b devide(byte value) { return devide(value, value, value, value); } public default Vec4b devide(byte value) { return devide(value, value, value, value); }
public default Vec4b devide(Vec4b value) { return devide(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4b devide(Vec4b value) { return devide(value.x(), value.y(), value.z(), value.w()); }
public default Vec4b devide(byte x, byte y, byte z, byte w) { return set((byte)(getX() / x), (byte)(getY() / y), (byte)(getZ() / z), (byte)(getW() / w)); } public default Vec4b devide(byte x, byte y, byte z, byte w) { return set((byte)(x() / x), (byte)(y() / y), (byte)(z() / z), (byte)(w() / w)); }
@Override @Override
public default Vec4b set(byte value) { return set(value, value, value, value); } public default Vec4b set(byte value) { return set(value, value, value, value); }
public default Vec4b set(Vec4b value) { return set(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4b set(Vec4b value) { return set(value.x(), value.y(), value.z(), value.w()); }
public Vec4b set(byte x, byte y, byte z, byte w); public Vec4b set(byte x, byte y, byte z, byte w);
public default double distanceTo(Vec4b value) { return distanceTo(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceTo(Vec4b value) { return distanceTo(value.x(), value.y(), value.z(), value.w()); }
public default double distanceTo(byte x, byte y, byte z, byte w) { return Math.sqrt(distanceTo(x, y, z, w)); } public default double distanceTo(byte x, byte y, byte z, byte w) { return Math.sqrt(distanceTo(x, y, z, w)); }
public default long distanceToSquared(Vec4b value) { return distanceToSquared(value.getX(), value.getY(), value.getZ(), value.getW()); } public default long distanceToSquared(Vec4b value) { return distanceToSquared(value.x(), value.y(), value.z(), value.w()); }
public default long distanceToSquared(byte x, byte y, byte z, byte w) { public default long distanceToSquared(byte x, byte y, byte z, byte w) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
long zPos = getZ() - z; long zPos = z() - z;
long wPos = getW() - w; long wPos = w() - w;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()) + (getW() * getW()); } public default long lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()) + (w() * w()); }
public default long dotProduct(Vec4b value) { return dotProduct(value.getX(), value.getY(), value.getZ(), value.getW()); } public default long dotProduct(Vec4b value) { return dotProduct(value.x(), value.y(), value.z(), value.w()); }
public default long dotProduct(byte x, byte y, byte z, byte w) { return (getX() * x) + (getY() * y) + (getZ() * z) + (getW() * w); }; public default long dotProduct(byte x, byte y, byte z, byte w) { return (x() * x) + (y() * y) + (z() * z) + (w() * w); };
public default Vec4b min(Vec4b other) { return min(other, this); } public default Vec4b min(Vec4b other) { return min(other, this); }
public default Vec4b min(Vec4b other, Vec4b result) { return min(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4b min(Vec4b other, Vec4b result) { return min(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4b min(byte x, byte y, byte z, byte w) { return min(x, y, z, w, this); } public default Vec4b min(byte x, byte y, byte z, byte w) { return min(x, y, z, w, this); }
public default Vec4b min(byte x, byte y, byte z, byte w, Vec4b result) { return result.set((byte)Math.min(getX(), x), (byte)Math.min(getY(), y), (byte)Math.min(getZ(), z), (byte)Math.min(getW(), w)); } public default Vec4b min(byte x, byte y, byte z, byte w, Vec4b result) { return result.set((byte)Math.min(x(), x), (byte)Math.min(y(), y), (byte)Math.min(z(), z), (byte)Math.min(w(), w)); }
public default Vec4b max(Vec4b other) { return max(other, this); } public default Vec4b max(Vec4b other) { return max(other, this); }
public default Vec4b max(Vec4b other, Vec4b result) { return max(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4b max(Vec4b other, Vec4b result) { return max(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4b max(byte x, byte y, byte z, byte w) { return max(x, y, z, w, this); } public default Vec4b max(byte x, byte y, byte z, byte w) { return max(x, y, z, w, this); }
public default Vec4b max(byte x, byte y, byte z, byte w, Vec4b result) { return result.set((byte)Math.max(getX(), x), (byte)Math.max(getY(), y), (byte)Math.max(getZ(), z), (byte)Math.max(getZ(), z)); } public default Vec4b max(byte x, byte y, byte z, byte w, Vec4b result) { return result.set((byte)Math.max(x(), x), (byte)Math.max(y(), y), (byte)Math.max(z(), z), (byte)Math.max(z(), z)); }
public default Vec4b difference(Vec4b other) { return difference(other, this); } public default Vec4b difference(Vec4b other) { return difference(other, this); }
public default Vec4b difference(Vec4b other, Vec4b result) { return difference(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4b difference(Vec4b other, Vec4b result) { return difference(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4b difference(byte x, byte y, byte z, byte w) { return difference(x, y, z, w, this); } public default Vec4b difference(byte x, byte y, byte z, byte w) { return difference(x, y, z, w, this); }
public default Vec4b difference(byte x, byte y, byte z, byte w, Vec4b result) { return result.set((byte)(getX() - x), (byte)(getY() - y), (byte)(getZ() - z), (byte)(getW() - w)); } public default Vec4b difference(byte x, byte y, byte z, byte w, Vec4b result) { return result.set((byte)(x() - x), (byte)(y() - y), (byte)(z() - z), (byte)(w() - w)); }
@Override @Override
public default Vec4b clamp(byte min, byte max) { return clamp(min, max, ALL); } public default Vec4b clamp(byte min, byte max) { return clamp(min, max, ALL); }
public default Vec4b clamp(byte min, byte max, Vec4b result) { return clamp(min, max, result, ALL); } public default Vec4b clamp(byte min, byte max, Vec4b result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec4b clamp(byte min, byte max, int filter) { return clamp(min, max, this, filter); } public default Vec4b clamp(byte min, byte max, int filter) { return clamp(min, max, this, filter); }
public default Vec4b clamp(byte min, byte max, Vec4b result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ()), (filter & W) == 0 ? getW() : MathUtils.clamp(min, max, getW())); } public default Vec4b clamp(byte min, byte max, Vec4b result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z()), (filter & W) == 0 ? w() : MathUtils.clamp(min, max, w())); }
@Override @Override
public default Vec4b store(ByteBuffer buffer) { public default Vec4b store(ByteBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()).put(getW()); buffer.put(x()).put(y()).put(z()).put(w());
return this; return this;
} }
@Override @Override
public default Vec4b load(ByteBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); } public default Vec4b load(ByteBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec4s asShort() { return isMutable() ? Vec4s.mutable(getX(), getY(), getZ(), getW()) : Vec4s.of(getX(), getY(), getZ(), getW()); } public default Vec4s asShort() { return isMutable() ? Vec4s.mutable(x(), y(), z(), w()) : Vec4s.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4i asInt() { return isMutable() ? Vec4i.mutable(getX(), getY(), getZ(), getW()) : Vec4i.of(getX(), getY(), getZ(), getW()); } public default Vec4i asInt() { return isMutable() ? Vec4i.mutable(x(), y(), z(), w()) : Vec4i.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(getX(), getY(), getZ(), getW()) : Vec4l.of(getX(), getY(), getZ(), getW()); } public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(x(), y(), z(), w()) : Vec4l.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable(getX(), getY(), getZ(), getW()) : Vec4f.of(getX(), getY(), getZ(), getW()); } public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable(x(), y(), z(), w()) : Vec4f.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4d asDouble() {return isMutable() ? Vec4d.mutable(getX(), getY(), getZ(), getW()) : Vec4d.of(getX(), getY(), getZ(), getW()); } public default Vec4d asDouble() {return isMutable() ? Vec4d.mutable(x(), y(), z(), w()) : Vec4d.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4b asMutable() { return isMutable() ? this : mutable(this); } public default Vec4b asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -32,21 +32,21 @@ public class Vec4bImmutable implements Vec4b {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public byte getX() { return x; } public byte x() { return x; }
@Override @Override
public byte getY() { return y; } public byte y() { return y; }
@Override @Override
public byte getZ() { return z; } public byte z() { return z; }
@Override @Override
public byte getW() { return w; } public byte w() { return w; }
@Override @Override
public Vec4b setX(byte x) { return this.x == x ? this : Vec4b.of(x, y, z, w); } public Vec4b x(byte x) { return this.x == x ? this : Vec4b.of(x, y, z, w); }
@Override @Override
public Vec4b setY(byte y) { return this.y == y ? this : Vec4b.of(x, y, z, w); } public Vec4b y(byte y) { return this.y == y ? this : Vec4b.of(x, y, z, w); }
@Override @Override
public Vec4b setZ(byte z) { return this.z == z ? this : Vec4b.of(x, y, z, w); } public Vec4b z(byte z) { return this.z == z ? this : Vec4b.of(x, y, z, w); }
@Override @Override
public Vec4b setW(byte w) { return this.w == w ? this : Vec4b.of(x, y, z, w); } public Vec4b w(byte w) { return this.w == w ? this : Vec4b.of(x, y, z, w); }
@Override @Override
public Vec4b copy() { return Vec4b.of(this); } public Vec4b copy() { return Vec4b.of(this); }
@Override @Override
@ -58,7 +58,7 @@ public class Vec4bImmutable implements Vec4b {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4b) { if(obj instanceof Vec4b) {
Vec4b vec = (Vec4b)obj; Vec4b vec = (Vec4b)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -27,34 +27,34 @@ public class Vec4bMutable implements Vec4b {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public byte getX() { return x; } public byte x() { return x; }
@Override @Override
public byte getY() { return y; } public byte y() { return y; }
@Override @Override
public byte getZ() { return z; } public byte z() { return z; }
@Override @Override
public byte getW() { return w; } public byte w() { return w; }
@Override @Override
public Vec4b setX(byte x) { public Vec4b x(byte x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec4b setY(byte y) { public Vec4b y(byte y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec4b setZ(byte z) { public Vec4b z(byte z) {
this.z = z; this.z = z;
return this; return this;
} }
@Override @Override
public Vec4b setW(byte w) { public Vec4b w(byte w) {
this.w = w; this.w = w;
return this; return this;
} }
@ -78,7 +78,7 @@ public class Vec4bMutable implements Vec4b {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4b) { if(obj instanceof Vec4b) {
Vec4b vec = (Vec4b)obj; Vec4b vec = (Vec4b)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -18,26 +18,26 @@ public interface Vec2d extends Vecd {
public static Vec2d mutable() { return new Vec2dMutable(); } public static Vec2d mutable() { return new Vec2dMutable(); }
public static Vec2d mutable(double value) { return new Vec2dMutable(value); } public static Vec2d mutable(double value) { return new Vec2dMutable(value); }
public static Vec2d mutable(double x, double y) { return new Vec2dMutable(x, y); } public static Vec2d mutable(double x, double y) { return new Vec2dMutable(x, y); }
public static Vec2d mutable(Vec2d value) { return mutable(value.getX(), value.getY()); } public static Vec2d mutable(Vec2d value) { return mutable(value.x(), value.y()); }
public static Vec2d of() { return new Vec2dImmutable(); } public static Vec2d of() { return new Vec2dImmutable(); }
public static Vec2d of(double value) { return new Vec2dImmutable(value); } public static Vec2d of(double value) { return new Vec2dImmutable(value); }
public static Vec2d of(double x, double y) { return new Vec2dImmutable(x, y); } public static Vec2d of(double x, double y) { return new Vec2dImmutable(x, y); }
public static Vec2d of(Vec2d value) { return of(value.getX(), value.getY()); } public static Vec2d of(Vec2d value) { return of(value.x(), value.y()); }
public double getX(); public double x();
public double getY(); public double y();
public Vec2d setX(double x); public Vec2d x(double x);
public Vec2d setY(double y); public Vec2d y(double y);
@Override @Override
public default double[] asArray() { return new double[] {getX(), getY()}; } public default double[] asArray() { return new double[] {x(), y()}; }
@Override @Override
public Vec2d copy(); public Vec2d copy();
@Override @Override
public default Vec2d abs() { return set(Math.abs(getX()), Math.abs(getY())); } public default Vec2d abs() { return set(Math.abs(x()), Math.abs(y())); }
@Override @Override
public default Vec2d negate() { return set(0D, 0D); } public default Vec2d negate() { return set(0D, 0D); }
@Override @Override
public default Vec2d invert() { return set(-getX(), -getY()); }; public default Vec2d invert() { return set(-x(), -y()); };
public default Vec2d normalize() { public default Vec2d normalize() {
double l = length(); double l = length();
return l == 0D ? this : multiply(1D / l); return l == 0D ? this : multiply(1D / l);
@ -45,106 +45,106 @@ public interface Vec2d extends Vecd {
@Override @Override
public default Vec2d add(double value) { return add(value, value); } public default Vec2d add(double value) { return add(value, value); }
public default Vec2d add(Vec2d value) { return add(value.getX(), value.getY()); } public default Vec2d add(Vec2d value) { return add(value.x(), value.y()); }
public default Vec2d add(double x, double y) { return set(x + getX(), y + getY()); } public default Vec2d add(double x, double y) { return set(x + x(), y + y()); }
@Override @Override
public default Vec2d sub(double value) { return sub(value, value); } public default Vec2d sub(double value) { return sub(value, value); }
public default Vec2d sub(Vec2d value) { return sub(value.getX(), value.getY()); } public default Vec2d sub(Vec2d value) { return sub(value.x(), value.y()); }
public default Vec2d sub(double x, double y) { return set(getX() - x, getY() - y); } public default Vec2d sub(double x, double y) { return set(x() - x, y() - y); }
@Override @Override
public default Vec2d multiply(double value) { return multiply(value, value); } public default Vec2d multiply(double value) { return multiply(value, value); }
public default Vec2d multiply(Vec2d value) { return multiply(value.getX(), value.getY()); } public default Vec2d multiply(Vec2d value) { return multiply(value.x(), value.y()); }
public default Vec2d multiply(double x, double y) { return set(x * getX(), y * getY()); } public default Vec2d multiply(double x, double y) { return set(x * x(), y * y()); }
@Override @Override
public default Vec2d devide(double value) { return devide(value, value); } public default Vec2d devide(double value) { return devide(value, value); }
public default Vec2d devide(Vec2d value) { return devide(value.getX(), value.getY()); } public default Vec2d devide(Vec2d value) { return devide(value.x(), value.y()); }
public default Vec2d devide(double x, double y) { return set(getX() / x, getY() / y); } public default Vec2d devide(double x, double y) { return set(x() / x, y() / y); }
@Override @Override
public default Vec2d set(double value) { return set(value, value); }; public default Vec2d set(double value) { return set(value, value); };
public default Vec2d set(Vec2d value) { return set(value.getX(), value.getY()); } public default Vec2d set(Vec2d value) { return set(value.x(), value.y()); }
public Vec2d set(double x, double y); public Vec2d set(double x, double y);
public default double distanceTo(Vec2d value) { return distanceTo(value.getX(), value.getY()); } public default double distanceTo(Vec2d value) { return distanceTo(value.x(), value.y()); }
public default double distanceTo(double x, double y) { return Math.sqrt(distanceToSquared(x, y)); } public default double distanceTo(double x, double y) { return Math.sqrt(distanceToSquared(x, y)); }
public default double distanceToSquared(Vec2d value) { return distanceToSquared(value.getX(), value.getY()); } public default double distanceToSquared(Vec2d value) { return distanceToSquared(value.x(), value.y()); }
public default double distanceToSquared(double x, double y) { public default double distanceToSquared(double x, double y) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
return (xPos * xPos) + (yPos * yPos); return (xPos * xPos) + (yPos * yPos);
} }
@Override @Override
public default double lengthSquared() { return (getX() * getX()) + (getY() * getY()); } public default double lengthSquared() { return (x() * x()) + (y() * y()); }
public default double dotProduct(Vec2d value) { return dotProduct(value.getX(), value.getY()); } public default double dotProduct(Vec2d value) { return dotProduct(value.x(), value.y()); }
public default double dotProduct(double x, double y) { return (getX() * x) + (getY() * y); } public default double dotProduct(double x, double y) { return (x() * x) + (y() * y); }
public default Vec2d lerp(Vec2d value, float progress, Vec2d result) { return lerp(value.getX(), value.getY(), progress, result); } public default Vec2d lerp(Vec2d value, float progress, Vec2d result) { return lerp(value.x(), value.y(), progress, result); }
public default Vec2d lerp(double x, double y, float progress, Vec2d result) { return result.set(MathUtils.lerp(getX(), x, progress), MathUtils.lerp(getY(), y, progress)); }; public default Vec2d lerp(double x, double y, float progress, Vec2d result) { return result.set(MathUtils.lerp(x(), x, progress), MathUtils.lerp(y(), y, progress)); };
public default double angle(Vec2d value) { return angle(value.getX(), value.getY()); } public default double angle(Vec2d value) { return angle(value.x(), value.y()); }
public default double angle(double x, double y) { return (float)Math.atan2((getX() * y) - (getY() * x), (getX() * x) + (getY() * y)); } public default double angle(double x, double y) { return (float)Math.atan2((x() * y) - (y() * x), (x() * x) + (y() * y)); }
public default double directionAngle(Vec2d value) { return directionAngle(value.getX(), value.getY()); } public default double directionAngle(Vec2d value) { return directionAngle(value.x(), value.y()); }
public default double directionAngle(double x, double y) { return (float)(-Math.toDegrees(Math.atan2(getX() - x, getY() - y)) % 360D); } public default double directionAngle(double x, double y) { return (float)(-Math.toDegrees(Math.atan2(x() - x, y() - y)) % 360D); }
public default Vec2d reflect(Vec2d value) { return reflect(value.getX(), value.getY(), this); } public default Vec2d reflect(Vec2d value) { return reflect(value.x(), value.y(), this); }
public default Vec2d reflect(double x, double y) { return reflect(x, y, this); }; public default Vec2d reflect(double x, double y) { return reflect(x, y, this); };
public default Vec2d reflect(Vec2d value, Vec2d result) { return reflect(value.getX(), value.getY(), result); } public default Vec2d reflect(Vec2d value, Vec2d result) { return reflect(value.x(), value.y(), result); }
public default Vec2d reflect(double x, double y, Vec2d result) { public default Vec2d reflect(double x, double y, Vec2d result) {
double dot = dotProduct(x, y); double dot = dotProduct(x, y);
double x2 = (float)((dot + dot) * x); double x2 = (float)((dot + dot) * x);
double y2 = (float)((dot + dot) * y); double y2 = (float)((dot + dot) * y);
return result.set(getX() - x2, getY() - y2); return result.set(x() - x2, y() - y2);
} }
public default Vec2d rotate(double angle, Vec2d center) { return rotate(angle, center.getX(), center.getY()); } public default Vec2d rotate(double angle, Vec2d center) { return rotate(angle, center.x(), center.y()); }
public default Vec2d rotate(double angle, double x, double y) { public default Vec2d rotate(double angle, double x, double y) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
return set((float)((xPos * cos) + (yPos * sin) + x), (float)(-(xPos * sin) + (yPos * cos) + y)); return set((float)((xPos * cos) + (yPos * sin) + x), (float)(-(xPos * sin) + (yPos * cos) + y));
} }
public default Vec2d min(Vec2d other) { return min(other, this); } public default Vec2d min(Vec2d other) { return min(other, this); }
public default Vec2d min(Vec2d other, Vec2d result) { return min(other.getX(), other.getY(), result); } public default Vec2d min(Vec2d other, Vec2d result) { return min(other.x(), other.y(), result); }
public default Vec2d min(double x, double y) { return min(x, y, this); } public default Vec2d min(double x, double y) { return min(x, y, this); }
public default Vec2d min(double x, double y, Vec2d result) { return result.set(Math.min(getX(), x), Math.min(getY(), y)); } public default Vec2d min(double x, double y, Vec2d result) { return result.set(Math.min(x(), x), Math.min(y(), y)); }
public default Vec2d max(Vec2d other) { return max(other, this); } public default Vec2d max(Vec2d other) { return max(other, this); }
public default Vec2d max(Vec2d other, Vec2d result) { return max(other.getX(), other.getY(), result); } public default Vec2d max(Vec2d other, Vec2d result) { return max(other.x(), other.y(), result); }
public default Vec2d max(double x, double y) { return max(x, y, this); } public default Vec2d max(double x, double y) { return max(x, y, this); }
public default Vec2d max(double x, double y, Vec2d result) { return result.set(Math.max(getX(), x), Math.max(getY(), y)); } public default Vec2d max(double x, double y, Vec2d result) { return result.set(Math.max(x(), x), Math.max(y(), y)); }
public default Vec2d difference(Vec2d other) { return difference(other, this); } public default Vec2d difference(Vec2d other) { return difference(other, this); }
public default Vec2d difference(Vec2d other, Vec2d result) { return difference(other.getX(), other.getY(), result); } public default Vec2d difference(Vec2d other, Vec2d result) { return difference(other.x(), other.y(), result); }
public default Vec2d difference(double x, double y) { return difference(x, y, this); } public default Vec2d difference(double x, double y) { return difference(x, y, this); }
public default Vec2d difference(double x, double y, Vec2d result) { return result.set(getX() - x, getY() - y); } public default Vec2d difference(double x, double y, Vec2d result) { return result.set(x() - x, y() - y); }
@Override @Override
public default Vec2d clamp(double min, double max) { return clamp(min, max, ALL); } public default Vec2d clamp(double min, double max) { return clamp(min, max, ALL); }
public default Vec2d clamp(double min, double max, Vec2d result) { return clamp(min, max, result, ALL); } public default Vec2d clamp(double min, double max, Vec2d result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec2d clamp(double min, double max, int filter) { return clamp(min, max, this, filter); } public default Vec2d clamp(double min, double max, int filter) { return clamp(min, max, this, filter); }
public default Vec2d clamp(double min, double max, Vec2d result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY())); } public default Vec2d clamp(double min, double max, Vec2d result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y())); }
@Override @Override
public default Vec2d store(ByteBuffer buffer) { public default Vec2d store(ByteBuffer buffer) {
buffer.putDouble(getX()).putDouble(getY()); buffer.putDouble(x()).putDouble(y());
return this; return this;
} }
@Override @Override
public default Vec2d load(ByteBuffer buffer) { return set(buffer.getDouble(), buffer.getDouble()); } public default Vec2d load(ByteBuffer buffer) { return set(buffer.getDouble(), buffer.getDouble()); }
@Override @Override
public default Vec2d store(DoubleBuffer buffer) { public default Vec2d store(DoubleBuffer buffer) {
buffer.put(getX()).put(getY()); buffer.put(x()).put(y());
return this; return this;
} }
@Override @Override
public default Vec2d load(DoubleBuffer buffer) { return set(buffer.get(), buffer.get()); } public default Vec2d load(DoubleBuffer buffer) { return set(buffer.get(), buffer.get()); }
@Override @Override
public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY())) : Vec2b.of((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY())); } public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y())) : Vec2b.of((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y())); }
@Override @Override
public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY())) : Vec2s.of((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY())); } public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)MathUtils.floor(x()), (short)MathUtils.floor(y())) : Vec2s.of((short)MathUtils.floor(x()), (short)MathUtils.floor(y())); }
@Override @Override
public default Vec2i asInt() { return isMutable() ? Vec2i.mutable(MathUtils.floor(getX()), MathUtils.floor(getY())) : Vec2i.of(MathUtils.floor(getX()), MathUtils.floor(getY())); } public default Vec2i asInt() { return isMutable() ? Vec2i.mutable(MathUtils.floor(x()), MathUtils.floor(y())) : Vec2i.of(MathUtils.floor(x()), MathUtils.floor(y())); }
@Override @Override
public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(MathUtils.floor(getX()), MathUtils.floor(getY())) : Vec2l.of(MathUtils.floor(getX()), MathUtils.floor(getY())); } public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(MathUtils.floor(x()), MathUtils.floor(y())) : Vec2l.of(MathUtils.floor(x()), MathUtils.floor(y())); }
@Override @Override
public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable((float)getX(), (float)getY()) : Vec2f.of((float)getX(), (float)getY()); } public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable((float)x(), (float)y()) : Vec2f.of((float)x(), (float)y()); }
@Override @Override
public default Vec2d asMutable() { return isMutable() ? this : mutable(this); } public default Vec2d asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -24,13 +24,13 @@ public class Vec2dImmutable implements Vec2d {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public double getX() { return x; } public double x() { return x; }
@Override @Override
public double getY() { return y; } public double y() { return y; }
@Override @Override
public Vec2d setX(double x) { return this.x == x ? this : Vec2d.of(x, y); } public Vec2d x(double x) { return this.x == x ? this : Vec2d.of(x, y); }
@Override @Override
public Vec2d setY(double y) { return this.y == y ? this : Vec2d.of(x, y); } public Vec2d y(double y) { return this.y == y ? this : Vec2d.of(x, y); }
@Override @Override
public Vec2d copy() { return Vec2d.of(this); } public Vec2d copy() { return Vec2d.of(this); }
@Override @Override
@ -42,7 +42,7 @@ public class Vec2dImmutable implements Vec2d {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2d) { if(obj instanceof Vec2d) {
Vec2d vec = (Vec2d)obj; Vec2d vec = (Vec2d)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -24,18 +24,18 @@ public class Vec2dMutable implements Vec2d {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public double getX() { return x; } public double x() { return x; }
@Override @Override
public double getY() { return y; } public double y() { return y; }
@Override @Override
public Vec2d setX(double x) { public Vec2d x(double x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec2d setY(double y) { public Vec2d y(double y) {
this.y = y; this.y = y;
return this; return this;
} }
@ -57,7 +57,7 @@ public class Vec2dMutable implements Vec2d {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2d) { if(obj instanceof Vec2d) {
Vec2d vec = (Vec2d)obj; Vec2d vec = (Vec2d)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -21,7 +21,7 @@ public interface Vec3d extends Vecd {
public static Vec3d mutable(double x, double y, double z) { return new Vec3dMutable(x, y, z); } public static Vec3d mutable(double x, double y, double z) { return new Vec3dMutable(x, y, z); }
public static Vec3d mutable(Vec3d vec) { return mutable(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3d mutable(Vec3d vec) { return mutable(vec.x(), vec.y(), vec.z()); }
public static Vec3d of() { return new Vec3dImmutable(); } public static Vec3d of() { return new Vec3dImmutable(); }
@ -29,30 +29,26 @@ public interface Vec3d extends Vecd {
public static Vec3d of(double x, double y, double z) { return new Vec3dImmutable(x, y, z); } public static Vec3d of(double x, double y, double z) { return new Vec3dImmutable(x, y, z); }
public static Vec3d of(Vec3d vec) { return of(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3d of(Vec3d vec) { return of(vec.x(), vec.y(), vec.z()); }
public double getX(); public double x();
public double getY(); public double y();
public double getZ(); public double z();
public Vec3d setX(double x); public Vec3d x(double x);
public Vec3d setY(double y); public Vec3d y(double y);
public Vec3d setZ(double z); public Vec3d z(double z);
@Override @Override
public default double[] asArray() { return new double[] {getX(), getY(), getZ()}; } public default double[] asArray() { return new double[] {x(), y(), z()}; }
@Override @Override
public Vec3d copy(); public Vec3d copy();
@Override @Override
public default Vec3d abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ())); } public default Vec3d abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z())); }
@Override @Override
public default Vec3d negate() { return set(0D, 0D, 0D); } public default Vec3d negate() { return set(0D, 0D, 0D); }
@Override @Override
public default Vec3d invert() { return set(-getX(), -getY(), -getZ()); } public default Vec3d invert() { return set(-x(), -y(), -z()); }
public default Vec3d normalize() { public default Vec3d normalize() {
double l = length(); double l = length();
return l == 0D ? this : multiply(1.0D / l); return l == 0D ? this : multiply(1.0D / l);
@ -60,316 +56,165 @@ public interface Vec3d extends Vecd {
@Override @Override
public default Vec3d add(double value) { return add(value, value, value); } public default Vec3d add(double value) { return add(value, value, value); }
public default Vec3d add(Vec3d value) { return add(value.x(), value.y(), value.z()); }
public default Vec3d add(Vec3d value) { return add(value.getX(), value.getY(), value.getZ()); } public default Vec3d add(double x, double y, double z) { return set(x() + x, y() + y, z() + z); }
public default Vec3d add(double x, double y, double z) {
return set(getX() + x, getY() + y, getZ() + z);
}
@Override @Override
public default Vec3d sub(double value) { return sub(value, value, value); } public default Vec3d sub(double value) { return sub(value, value, value); }
public default Vec3d sub(Vec3d value) { return sub(value.x(), value.y(), value.z()); }
public default Vec3d sub(Vec3d value) { return sub(value.getX(), value.getY(), value.getZ()); } public default Vec3d sub(double x, double y, double z) { return set(x() - x, y() - y, z() - z); }
public default Vec3d sub(double x, double y, double z) {
return set(getX() - x, getY() - y, getZ() - z);
}
@Override @Override
public default Vec3d multiply(double value) { return multiply(value, value, value); } public default Vec3d multiply(double value) { return multiply(value, value, value); }
public default Vec3d multiply(Vec3d value) { return multiply(value.x(), value.y(), value.z()); }
public default Vec3d multiply(Vec3d value) { public default Vec3d multiply(double x, double y, double z) { return set(x() * x, y() * y, z() * z); }
return multiply(value.getX(), value.getY(), value.getZ());
}
public default Vec3d multiply(double x, double y, double z) {
return set(getX() * x, getY() * y, getZ() * z);
}
@Override @Override
public default Vec3d devide(double value) { return devide(value, value, value); } public default Vec3d devide(double value) { return devide(value, value, value); }
public default Vec3d devide(Vec3d value) { return devide(value.x(), value.y(), value.z()); }
public default Vec3d devide(Vec3d value) { public default Vec3d devide(double x, double y, double z) { return set(x() / x, y() / y, z() / z); }
return devide(value.getX(), value.getY(), value.getZ());
}
public default Vec3d devide(double x, double y, double z) {
return set(getX() / x, getY() / y, getZ() / z);
}
@Override @Override
public default Vec3d set(double value) { return set(value, value, value); } public default Vec3d set(double value) { return set(value, value, value); }
public default Vec3d set(Vec3d value) { return set(value.x(), value.y(), value.z()); }
public default Vec3d set(Vec3d value) { return set(value.getX(), value.getY(), value.getZ()); }
public Vec3d set(double x, double y, double z); public Vec3d set(double x, double y, double z);
public default double distanceTo(Vec3d value) { return distanceTo(value.x(), value.y(), value.z()); }
public default double distanceTo(Vec3d value) { public default double distanceTo(double x, double y, double z) { return Math.sqrt(distanceToSquared(x, y, z)); }
return distanceTo(value.getX(), value.getY(), value.getZ()); public default double distanceToSquared(Vec3d value) { return distanceToSquared(value.x(), value.y(), value.z()); }
}
public default double distanceTo(double x, double y, double z) {
return Math.sqrt(distanceToSquared(x, y, z));
}
public default double distanceToSquared(Vec3d value) {
return distanceToSquared(value.getX(), value.getY(), value.getZ());
}
public default double distanceToSquared(double x, double y, double z) { public default double distanceToSquared(double x, double y, double z) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
double zPos = getZ() - z; double zPos = z() - z;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos);
} }
@Override @Override
public default double lengthSquared() { public default double lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()); }
return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); public default double dotProduct(Vec3d value) { return dotProduct(value.x(), value.y(), value.z()); }
} public default double dotProduct(double x, double y, double z) { return (x() * x) + (y() * y) + (z() * z); }
public default Vec3d lerp(Vec3d value, float progress, Vec3d result) { return lerp(value.x(), value.y(), value.z(), progress, result); }
public default double dotProduct(Vec3d value) { public default Vec3d lerp(double x, double y, double z, float progress, Vec3d result) { return result.set(MathUtils.lerp(x(), x, progress), MathUtils.lerp(y(), y, progress), MathUtils.lerp(z(), z, progress)); }
return dotProduct(value.getX(), value.getY(), value.getZ()); public default double angle(Vec3d value) { return angle(value.x(), value.y(), value.z()); }
} public default double angle(double x, double y, double z) { return Math.acos(MathUtils.clamp(-1, 1, angleCos(x, y, z))); }
public default double angleCos(Vec3d value) { return angleCos(value.x(), value.y(), value.z()); }
public default double dotProduct(double x, double y, double z) {
return (getX() * x) + (getY() * y) + (getZ() * z);
}
public default Vec3d lerp(Vec3d value, float progress, Vec3d result) {
return lerp(value.getX(), value.getY(), value.getZ(), progress, result);
}
public default Vec3d lerp(double x, double y, double z, float progress, Vec3d result) {
return result.set(MathUtils.lerp(getX(), x, progress), MathUtils.lerp(getY(), y, progress), MathUtils.lerp(getZ(), z, progress));
}
public default double angle(Vec3d value) {
return angle(value.getX(), value.getY(), value.getZ());
}
public default double angle(double x, double y, double z) {
return Math.acos(MathUtils.clamp(-1, 1, angleCos(x, y, z)));
}
public default double angleCos(Vec3d value) {
return angleCos(value.getX(), value.getY(), value.getZ());
}
public default double angleCos(double x, double y, double z) { public default double angleCos(double x, double y, double z) {
double myLength = (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); double myLength = (x() * x()) + (y() * y()) + (z() * z());
double otherLength = (x * x) + (y * y) + (z * z); double otherLength = (x * x) + (y * y) + (z * z);
double dot = (getX() * x) + (getY() * y) + (getZ() * z); double dot = (x() * x) + (y() * y) + (z() * z);
return dot / (Math.sqrt(myLength * otherLength)); return dot / (Math.sqrt(myLength * otherLength));
} }
public default Vec3d crossProduct(Vec3d value) { public default Vec3d crossProduct(Vec3d value) { return crossProduct(value.x(), value.y(), value.z(), this); }
return crossProduct(value.getX(), value.getY(), value.getZ(), this); public default Vec3d crossProduct(Vec3d value, Vec3d result) { return crossProduct(value.x(), value.y(), value.z(), result); }
} public default Vec3d crossProduct(double x, double y, double z) { return crossProduct(x, y, z, this); }
public default Vec3d crossProduct(double x, double y, double z, Vec3d result) { return result.set((y() * z) - (z() * y), (z() * x) - (x() * z), (x() * y) - (y() * x)); }
public default Vec3d crossProduct(Vec3d value, Vec3d result) { public default Vec3d reflect(Vec3d value) { return reflect(value.x(), value.y(), value.z(), this); }
return crossProduct(value.getX(), value.getY(), value.getZ(), result); public default Vec3d reflect(Vec3d value, Vec3d result) { return reflect(value.x(), value.y(), value.z(), result); }
}
public default Vec3d crossProduct(double x, double y, double z) {
return crossProduct(x, y, z, this);
}
public default Vec3d crossProduct(double x, double y, double z, Vec3d result) {
return result.set((getY() * z) - (getZ() * y), (getZ() * x) - (getX() * z), (getX() * y) - (getY() * x));
}
public default Vec3d reflect(Vec3d value) {
return reflect(value.getX(), value.getY(), value.getZ(), this);
}
public default Vec3d reflect(Vec3d value, Vec3d result) {
return reflect(value.getX(), value.getY(), value.getZ(), result);
}
public default Vec3d reflect(double x, double y, double z) { return reflect(x, y, z, this); } public default Vec3d reflect(double x, double y, double z) { return reflect(x, y, z, this); }
public default Vec3d reflect(double x, double y, double z, Vec3d result) { public default Vec3d reflect(double x, double y, double z, Vec3d result) {
double dot = dotProduct(x, y, z) * 2D; double dot = dotProduct(x, y, z) * 2D;
return result.set(getX() - dot * x, getY() - dot * y, getZ() - dot * z); return result.set(x() - dot * x, y() - dot * y, z() - dot * z);
}
public default Vec3d rotate(double angle, Vec3d axis) {
return rotate(angle, axis.getX(), axis.getY(), axis.getZ());
}
public default Vec3d rotate(double angle, Vec3d axis, Vec3d result) {
return rotate(angle, axis.getX(), axis.getY(), axis.getZ(), result);
}
public default Vec3d rotate(double angle, double x, double y, double z) {
return rotate(angle, x, y, z, this);
} }
public default Vec3d rotate(double angle, Vec3d axis) { return rotate(angle, axis.x(), axis.y(), axis.z()); }
public default Vec3d rotate(double angle, Vec3d axis, Vec3d result) { return rotate(angle, axis.x(), axis.y(), axis.z(), result); }
public default Vec3d rotate(double angle, double x, double y, double z) { return rotate(angle, x, y, z, this); }
public default Vec3d rotate(double angle, double x, double y, double z, Vec3d result) { public default Vec3d rotate(double angle, double x, double y, double z, Vec3d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double dot = dotProduct(x, y, z); double dot = dotProduct(x, y, z);
double xPos = x * dot * (1D - cos) + (getX() * cos) + (-z * getY() + y * getZ()) * sin; double xPos = x * dot * (1D - cos) + (x() * cos) + (-z * y() + y * z()) * sin;
double yPos = y * dot * (1D - cos) + (getY() * cos) + (z * getX() - x * getZ()) * sin; double yPos = y * dot * (1D - cos) + (y() * cos) + (z * x() - x * z()) * sin;
double zPos = z * dot * (1D - cos) + (getZ() * cos) + (-y * getX() + x * getY()) * sin; double zPos = z * dot * (1D - cos) + (z() * cos) + (-y * x() + x * y()) * sin;
return result.set(xPos, yPos, zPos); return result.set(xPos, yPos, zPos);
} }
public default Vec3d rotateX(double angle) { return rotateX(angle, this); } public default Vec3d rotateX(double angle) { return rotateX(angle, this); }
public default Vec3d rotateX(double angle, Vec3d result) { public default Vec3d rotateX(double angle, Vec3d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double y = getY() * cos + getZ() * sin; double y = y() * cos + z() * sin;
double z = getZ() * cos - getY() * sin; double z = z() * cos - y() * sin;
return result.set(getX(), y, z); return result.set(x(), y, z);
} }
public default Vec3d rotateY(double angle) { return rotateY(angle, this); } public default Vec3d rotateY(double angle) { return rotateY(angle, this); }
public default Vec3d rotateY(double angle, Vec3d result) { public default Vec3d rotateY(double angle, Vec3d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = getX() * cos + getZ() * sin; double x = x() * cos + z() * sin;
double z = getZ() * cos - getX() * sin; double z = z() * cos - x() * sin;
return result.set(x, getY(), z); return result.set(x, y(), z);
} }
public default Vec3d rotateZ(double angle) { return rotateZ(angle, this); } public default Vec3d rotateZ(double angle) { return rotateZ(angle, this); }
public default Vec3d rotateZ(double angle, Vec3d result) { public default Vec3d rotateZ(double angle, Vec3d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = cos * getX() - sin * getY(); double x = cos * x() - sin * y();
double y = sin * getX() + cos * getY(); double y = sin * x() + cos * y();
return result.set(x, y, getZ()); return result.set(x, y, z());
}
public default Vec3d smoothStep(Vec3d value, float progress, Vec3d result) {
return smoothStep(value.getX(), value.getY(), value.getZ(), progress, result);
} }
public default Vec3d smoothStep(Vec3d value, float progress, Vec3d result) { return smoothStep(value.x(), value.y(), value.z(), progress, result); }
public default Vec3d smoothStep(double x, double y, double z, float progress, Vec3d result) { public default Vec3d smoothStep(double x, double y, double z, float progress, Vec3d result) {
double t2 = progress * progress; double t2 = progress * progress;
double t3 = t2 * progress; double t3 = t2 * progress;
double xPos = ((getX() + getX() - x - x) * t3 + (3.0D * x - 3.0D * getX()) * t2 + getX() * progress + getX()); double xPos = ((x() + x() - x - x) * t3 + (3.0D * x - 3.0D * x()) * t2 + x() * progress + x());
double yPos = ((getY() + getY() - y - y) * t3 + (3.0D * y - 3.0D * getY()) * t2 + getY() * progress + getY()); double yPos = ((y() + y() - y - y) * t3 + (3.0D * y - 3.0D * y()) * t2 + y() * progress + y());
double zPos = ((getZ() + getZ() - z - z) * t3 + (3.0D * z - 3.0D * getZ()) * t2 + getZ() * progress + getZ()); double zPos = ((z() + z() - z - z) * t3 + (3.0D * z - 3.0D * z()) * t2 + z() * progress + z());
return result.set(xPos, yPos, zPos); return result.set(xPos, yPos, zPos);
} }
public default Vec3d min(Vec3d other) { return min(other, this); } public default Vec3d min(Vec3d other) { return min(other, this); }
public default Vec3d min(Vec3d other, Vec3d result) { return min(other.x(), other.y(), other.z(), result); }
public default Vec3d min(Vec3d other, Vec3d result) {
return min(other.getX(), other.getY(), other.getZ(), result);
}
public default Vec3d min(double x, double y, double z) { return min(x, y, z, this); } public default Vec3d min(double x, double y, double z) { return min(x, y, z, this); }
public default Vec3d min(double x, double y, double z, Vec3d result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z)); }
public default Vec3d min(double x, double y, double z, Vec3d result) {
return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z));
}
public default Vec3d max(Vec3d other) { return max(other, this); } public default Vec3d max(Vec3d other) { return max(other, this); }
public default Vec3d max(Vec3d other, Vec3d result) { return max(other.x(), other.y(), other.z(), result); }
public default Vec3d max(Vec3d other, Vec3d result) {
return max(other.getX(), other.getY(), other.getZ(), result);
}
public default Vec3d max(double x, double y, double z) { return max(x, y, z, this); } public default Vec3d max(double x, double y, double z) { return max(x, y, z, this); }
public default Vec3d max(double x, double y, double z, Vec3d result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z)); }
public default Vec3d max(double x, double y, double z, Vec3d result) {
return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z));
}
public default Vec3d difference(Vec3d other) { return difference(other, this); } public default Vec3d difference(Vec3d other) { return difference(other, this); }
public default Vec3d difference(Vec3d other, Vec3d result) { public default Vec3d difference(Vec3d other, Vec3d result) { return difference(other.x(), other.y(), other.z(), result); }
return difference(other.getX(), other.getY(), other.getZ(), result); public default Vec3d difference(double x, double y, double z) { return difference(x, y, z, this); }
} public default Vec3d difference(double x, double y, double z, Vec3d result) { return result.set(x() - x, y() - y, z() - z); }
public default Vec3d difference(double x, double y, double z) {
return difference(x, y, z, this);
}
public default Vec3d difference(double x, double y, double z, Vec3d result) {
return result.set(getX() - x, getY() - y, getZ() - z);
}
@Override @Override
public default Vec3d clamp(double min, double max) { return clamp(min, max, ALL); } public default Vec3d clamp(double min, double max) { return clamp(min, max, ALL); }
public default Vec3d clamp(double min, double max, Vec3d result) { return clamp(min, max, result, ALL); }
public default Vec3d clamp(double min, double max, Vec3d result) {
return clamp(min, max, result, ALL);
}
@Override @Override
public default Vec3d clamp(double min, double max, int filter) { public default Vec3d clamp(double min, double max, int filter) { return clamp(min, max, this, filter); }
return clamp(min, max, this, filter); public default Vec3d clamp(double min, double max, Vec3d result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z())); }
}
public default Vec3d clamp(double min, double max, Vec3d result, int filter) {
return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ()));
}
@Override @Override
public default Vec3d store(ByteBuffer buffer) { public default Vec3d store(ByteBuffer buffer) {
buffer.putDouble(getX()).putDouble(getY()).putDouble(getZ()); buffer.putDouble(x()).putDouble(y()).putDouble(z());
return this; return this;
} }
@Override @Override
public default Vec3d load(ByteBuffer buffer) { public default Vec3d load(ByteBuffer buffer) { return set(buffer.getDouble(), buffer.getDouble(), buffer.getDouble()); }
return set(buffer.getDouble(), buffer.getDouble(), buffer.getDouble());
}
@Override @Override
public default Vec3d store(DoubleBuffer buffer) { public default Vec3d store(DoubleBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()); buffer.put(x()).put(y()).put(z());
return this; return this;
} }
@Override @Override
public default Vec3d load(DoubleBuffer buffer) { public default Vec3d load(DoubleBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); }
return set(buffer.get(), buffer.get(), buffer.get());
}
@Override @Override
public default Vec3b asByte() { public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z())) : Vec3b.of((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z())); }
return isMutable() ? Vec3b.mutable((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ())) : Vec3b.of((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ()));
}
@Override @Override
public default Vec3s asShort() { public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z())) : Vec3s.of((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z())); }
return isMutable() ? Vec3s.mutable((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ())) : Vec3s.of((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ()));
}
@Override @Override
public default Vec3i asInt() { public default Vec3i asInt() { return isMutable() ? Vec3i.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())) : Vec3i.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())); }
return isMutable() ? Vec3i.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ())) : Vec3i.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()));
}
@Override @Override
public default Vec3l asLong() { public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())) : Vec3l.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())); }
return isMutable() ? Vec3l.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ())) : Vec3l.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()));
}
@Override @Override
public default Vec3f asFloat() { public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable((float)x(), (float)y(), (float)z()) : Vec3f.of((float)x(), (float)y(), (float)z()); }
return isMutable() ? Vec3f.mutable((float)getX(), (float)getY(), (float)getZ()) : Vec3f.of((float)getX(), (float)getY(), (float)getZ());
}
@Override @Override
public default Vec3d asMutable() { return isMutable() ? this : mutable(this); } public default Vec3d asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override
public default Vec3d asImmutable() { return isMutable() ? of(this) : this; } public default Vec3d asImmutable() { return isMutable() ? of(this) : this; }
@Override @Override
public default Vec3d copyAsMutable() { return mutable(this); } public default Vec3d copyAsMutable() { return mutable(this); }
@Override @Override
public default Vec3d copyAsImmutable() { return of(this); } public default Vec3d copyAsImmutable() { return of(this); }
} }

View File

@ -28,17 +28,17 @@ public class Vec3dImmutable implements Vec3d {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public double getX() { return x; } public double x() { return x; }
@Override @Override
public double getY() { return y; } public double y() { return y; }
@Override @Override
public double getZ() { return z; } public double z() { return z; }
@Override @Override
public Vec3d setX(double x) { return this.x == x ? this : Vec3d.of(x, y, z); } public Vec3d x(double x) { return this.x == x ? this : Vec3d.of(x, y, z); }
@Override @Override
public Vec3d setY(double y) { return this.y == y ? this : Vec3d.of(x, y, z); } public Vec3d y(double y) { return this.y == y ? this : Vec3d.of(x, y, z); }
@Override @Override
public Vec3d setZ(double z) { return this.z == z ? this : Vec3d.of(x, y, z); } public Vec3d z(double z) { return this.z == z ? this : Vec3d.of(x, y, z); }
@Override @Override
public Vec3d copy() { return Vec3d.of(this); } public Vec3d copy() { return Vec3d.of(this); }
@Override @Override
@ -50,7 +50,7 @@ public class Vec3dImmutable implements Vec3d {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3d) { if(obj instanceof Vec3d) {
Vec3d vec = (Vec3d)obj; Vec3d vec = (Vec3d)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -28,26 +28,26 @@ public class Vec3dMutable implements Vec3d {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public double getX() { return x; } public double x() { return x; }
@Override @Override
public double getY() { return y; } public double y() { return y; }
@Override @Override
public double getZ() { return z; } public double z() { return z; }
@Override @Override
public Vec3d setX(double x) { public Vec3d x(double x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec3d setY(double y) { public Vec3d y(double y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec3d setZ(double z) { public Vec3d z(double z) {
this.z = z; this.z = z;
return this; return this;
} }
@ -70,7 +70,7 @@ public class Vec3dMutable implements Vec3d {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3d) { if(obj instanceof Vec3d) {
Vec3d vec = (Vec3d)obj; Vec3d vec = (Vec3d)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -18,154 +18,154 @@ public interface Vec4d extends Vecd {
public static Vec4d mutable() { return new Vec4dMutable(); } public static Vec4d mutable() { return new Vec4dMutable(); }
public static Vec4d mutable(double value) { return new Vec4dMutable(value); } public static Vec4d mutable(double value) { return new Vec4dMutable(value); }
public static Vec4d mutable(double x, double y, double z, double w) { return new Vec4dMutable(x, y, z, w); } public static Vec4d mutable(double x, double y, double z, double w) { return new Vec4dMutable(x, y, z, w); }
public static Vec4d mutable(Vec4d vec) { return mutable(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4d mutable(Vec4d vec) { return mutable(vec.x(), vec.y(), vec.z(), vec.w()); }
public static Vec4d of() { return new Vec4dImmutable(); } public static Vec4d of() { return new Vec4dImmutable(); }
public static Vec4d of(double value) { return new Vec4dImmutable(value); } public static Vec4d of(double value) { return new Vec4dImmutable(value); }
public static Vec4d of(double x, double y, double z, double w) { return new Vec4dImmutable(x, y, z, w); } public static Vec4d of(double x, double y, double z, double w) { return new Vec4dImmutable(x, y, z, w); }
public static Vec4d of(Vec4d vec) { return of(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4d of(Vec4d vec) { return of(vec.x(), vec.y(), vec.z(), vec.w()); }
public double getX(); public double x();
public double getY(); public double y();
public double getZ(); public double z();
public double getW(); public double w();
public Vec4d setX(double x); public Vec4d x(double x);
public Vec4d setY(double y); public Vec4d y(double y);
public Vec4d setZ(double z); public Vec4d z(double z);
public Vec4d setW(double w); public Vec4d w(double w);
@Override @Override
public default double[] asArray() { return new double[] {getX(), getY(), getZ(), getW()}; } public default double[] asArray() { return new double[] {x(), y(), z(), w()}; }
@Override @Override
public Vec4d copy(); public Vec4d copy();
@Override @Override
public default Vec4d abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ()), Math.abs(getW())); } public default Vec4d abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z()), Math.abs(w())); }
@Override @Override
public default Vec4d negate() { return set(0D, 0D, 0D, 0D); } public default Vec4d negate() { return set(0D, 0D, 0D, 0D); }
@Override @Override
public default Vec4d invert() { return set(-getX(), -getY(), -getZ(), -getW()); } public default Vec4d invert() { return set(-x(), -y(), -z(), -w()); }
public default Vec4d normalize() { public default Vec4d normalize() {
double l = length(); double l = length();
return l == 0D ? this : multiply(1.0D / l); return l == 0D ? this : multiply(1.0D / l);
} }
public default Vec4d normalize3D() { public default Vec4d normalize3D() {
double value = (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); double value = (x() * x()) + (y() * y()) + (z() * z());
return value == 0D ? this : multiply(1D / value); return value == 0D ? this : multiply(1D / value);
} }
@Override @Override
public default Vec4d add(double value) { return add(value, value, value, value); } public default Vec4d add(double value) { return add(value, value, value, value); }
public default Vec4d add(Vec4d value) { return add(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4d add(Vec4d value) { return add(value.x(), value.y(), value.z(), value.w()); }
public default Vec4d add(double x, double y, double z, double w) { return set(getX() + x, getY() + y, getZ() + z, getW() + w); } public default Vec4d add(double x, double y, double z, double w) { return set(x() + x, y() + y, z() + z, w() + w); }
@Override @Override
public default Vec4d sub(double value) { return sub(value, value, value, value); } public default Vec4d sub(double value) { return sub(value, value, value, value); }
public default Vec4d sub(Vec4d value) { return sub(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4d sub(Vec4d value) { return sub(value.x(), value.y(), value.z(), value.w()); }
public default Vec4d sub(double x, double y, double z, double w) { return set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4d sub(double x, double y, double z, double w) { return set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4d multiply(double value) { return multiply(value, value, value, value); } public default Vec4d multiply(double value) { return multiply(value, value, value, value); }
public default Vec4d multiply(Vec4d value) { return multiply(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4d multiply(Vec4d value) { return multiply(value.x(), value.y(), value.z(), value.w()); }
public default Vec4d multiply(double x, double y, double z, double w) { return set(getX() * x, getY() * y, getZ() * z, getW() * w); } public default Vec4d multiply(double x, double y, double z, double w) { return set(x() * x, y() * y, z() * z, w() * w); }
@Override @Override
public default Vec4d devide(double value) { return devide(value, value, value, value); } public default Vec4d devide(double value) { return devide(value, value, value, value); }
public default Vec4d devide(Vec4d value) { return devide(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4d devide(Vec4d value) { return devide(value.x(), value.y(), value.z(), value.w()); }
public default Vec4d devide(double x, double y, double z, double w) { return set(getX() / x, getY() / y, getZ() / z, getW() / w); } public default Vec4d devide(double x, double y, double z, double w) { return set(x() / x, y() / y, z() / z, w() / w); }
@Override @Override
public default Vec4d set(double value) { return set(value, value, value, value); } public default Vec4d set(double value) { return set(value, value, value, value); }
public default Vec4d set(Vec4d value) { return set(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4d set(Vec4d value) { return set(value.x(), value.y(), value.z(), value.w()); }
public Vec4d set(double x, double y, double z, double w); public Vec4d set(double x, double y, double z, double w);
public default double distanceTo(Vec4d value) { return distanceTo(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceTo(Vec4d value) { return distanceTo(value.x(), value.y(), value.z(), value.w()); }
public default double distanceTo(double x, double y, double z, double w) { return Math.sqrt(distanceTo(x, y, z, w)); } public default double distanceTo(double x, double y, double z, double w) { return Math.sqrt(distanceTo(x, y, z, w)); }
public default double distanceToSquared(Vec4d value) { return distanceToSquared(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceToSquared(Vec4d value) { return distanceToSquared(value.x(), value.y(), value.z(), value.w()); }
public default double distanceToSquared(double x, double y, double z, double w) { public default double distanceToSquared(double x, double y, double z, double w) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
double zPos = getZ() - z; double zPos = z() - z;
double wPos = getW() - w; double wPos = w() - w;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos);
} }
@Override @Override
public default double lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()) + (getW() * getW()); } public default double lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()) + (w() * w()); }
public default double dotProduct(Vec4d value) { return dotProduct(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double dotProduct(Vec4d value) { return dotProduct(value.x(), value.y(), value.z(), value.w()); }
public default double dotProduct(double x, double y, double z, double w) { return (getX() * x) + (getY() * y) + (getZ() * z) + (getW() * w); }; public default double dotProduct(double x, double y, double z, double w) { return (x() * x) + (y() * y) + (z() * z) + (w() * w); };
public default Vec4d lerp(Vec4d value, float progress, Vec4d result) { return lerp(value.getX(), value.getY(), value.getZ(), value.getW(), progress, result); } public default Vec4d lerp(Vec4d value, float progress, Vec4d result) { return lerp(value.x(), value.y(), value.z(), value.w(), progress, result); }
public default Vec4d lerp(double x, double y, double z, double w, float progress, Vec4d result) { return result.set(MathUtils.lerp(getX(), x, progress), MathUtils.lerp(getY(), y, progress), MathUtils.lerp(getZ(), z, progress), MathUtils.lerp(getW(), w, progress)); } public default Vec4d lerp(double x, double y, double z, double w, float progress, Vec4d result) { return result.set(MathUtils.lerp(x(), x, progress), MathUtils.lerp(y(), y, progress), MathUtils.lerp(z(), z, progress), MathUtils.lerp(w(), w, progress)); }
public default double angle(Vec4d value) { return angle(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double angle(Vec4d value) { return angle(value.x(), value.y(), value.z(), value.w()); }
public default double angle(double x, double y, double z, double w) { return Math.acos(MathUtils.clamp(-1D, 1D, angleCos(x, y, z, w))); } public default double angle(double x, double y, double z, double w) { return Math.acos(MathUtils.clamp(-1D, 1D, angleCos(x, y, z, w))); }
public default double angleCos(Vec4d value) { return angleCos(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double angleCos(Vec4d value) { return angleCos(value.x(), value.y(), value.z(), value.w()); }
public default double angleCos(double x, double y, double z, double w) { return dotProduct(x, y, z, w) / Math.sqrt(lengthSquared() * (x * x) + (y * y) + (z * z) + (w * w)); } public default double angleCos(double x, double y, double z, double w) { return dotProduct(x, y, z, w) / Math.sqrt(lengthSquared() * (x * x) + (y * y) + (z * z) + (w * w)); }
public default Vec4d rotate(double angle, Vec4d axis) { return rotate(angle, axis.getX(), axis.getY(), axis.getZ(), axis.getW()); } public default Vec4d rotate(double angle, Vec4d axis) { return rotate(angle, axis.x(), axis.y(), axis.z(), axis.w()); }
public default Vec4d rotate(double angle, Vec4d axis, Vec4d result) { return rotate(angle, axis.getX(), axis.getY(), axis.getZ(), axis.getW(), result); } public default Vec4d rotate(double angle, Vec4d axis, Vec4d result) { return rotate(angle, axis.x(), axis.y(), axis.z(), axis.w(), result); }
public default Vec4d rotate(double angle, double x, double y, double z, double w) { return rotate(angle, x, y, z, w, this); } public default Vec4d rotate(double angle, double x, double y, double z, double w) { return rotate(angle, x, y, z, w, this); }
public default Vec4d rotate(double angle, double x, double y, double z, double w, Vec4d result) { public default Vec4d rotate(double angle, double x, double y, double z, double w, Vec4d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double dot = dotProduct(x, y, z, w); double dot = dotProduct(x, y, z, w);
double xPos = x * dot * (1D - cos) + (getX() * cos) + (-z * getY() + y * getZ()) * sin; double xPos = x * dot * (1D - cos) + (x() * cos) + (-z * y() + y * z()) * sin;
double yPos = y * dot * (1D - cos) + (getY() * cos) + (z * getX() - x * getZ()) * sin; double yPos = y * dot * (1D - cos) + (y() * cos) + (z * x() - x * z()) * sin;
double zPos = z * dot * (1D - cos) + (getZ() * cos) + (-y * getX() + x * getY()) * sin; double zPos = z * dot * (1D - cos) + (z() * cos) + (-y * x() + x * y()) * sin;
return result.set(xPos, yPos, zPos, getW()); return result.set(xPos, yPos, zPos, w());
} }
public default Vec4d rotateX(double angle) { return rotateX(angle, this); } public default Vec4d rotateX(double angle) { return rotateX(angle, this); }
public default Vec4d rotateX(double angle, Vec4d result) { public default Vec4d rotateX(double angle, Vec4d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double y = getY() * cos + getZ() * sin; double y = y() * cos + z() * sin;
double z = getZ() * cos - getY() * sin; double z = z() * cos - y() * sin;
return result.set(getX(), y, z, getW()); return result.set(x(), y, z, w());
} }
public default Vec4d rotateY(double angle) { return rotateY(angle, this); } public default Vec4d rotateY(double angle) { return rotateY(angle, this); }
public default Vec4d rotateY(double angle, Vec4d result) { public default Vec4d rotateY(double angle, Vec4d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = getX() * cos + getZ() * sin; double x = x() * cos + z() * sin;
double z = getZ() * cos - getX() * sin; double z = z() * cos - x() * sin;
return result.set(x, getY(), z, getW()); return result.set(x, y(), z, w());
} }
public default Vec4d rotateZ(double angle) { return rotateZ(angle, this); } public default Vec4d rotateZ(double angle) { return rotateZ(angle, this); }
public default Vec4d rotateZ(double angle, Vec4d result) { public default Vec4d rotateZ(double angle, Vec4d result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = cos * getX() - sin * getY(); double x = cos * x() - sin * y();
double y = sin * getX() + cos * getY(); double y = sin * x() + cos * y();
return result.set(x, y, getZ(), getW()); return result.set(x, y, z(), w());
} }
public default Vec4d smoothStep(Vec4d value, float progress, Vec4d result) { return smoothStep(value.getX(), value.getY(), value.getZ(), value.getW(), progress, result); } public default Vec4d smoothStep(Vec4d value, float progress, Vec4d result) { return smoothStep(value.x(), value.y(), value.z(), value.w(), progress, result); }
public default Vec4d smoothStep(double x, double y, double z, double w, float progress, Vec4d result) { public default Vec4d smoothStep(double x, double y, double z, double w, float progress, Vec4d result) {
double t2 = progress * progress; double t2 = progress * progress;
double t3 = t2 * progress; double t3 = t2 * progress;
double xPos = ((getX() + getX() - x - x) * t3 + (3.0D * x - 3.0D * getX()) * t2 + getX() * progress + getX()); double xPos = ((x() + x() - x - x) * t3 + (3.0D * x - 3.0D * x()) * t2 + x() * progress + x());
double yPos = ((getY() + getY() - y - y) * t3 + (3.0D * y - 3.0D * getY()) * t2 + getY() * progress + getY()); double yPos = ((y() + y() - y - y) * t3 + (3.0D * y - 3.0D * y()) * t2 + y() * progress + y());
double zPos = ((getZ() + getZ() - z - z) * t3 + (3.0D * z - 3.0D * getZ()) * t2 + getZ() * progress + getZ()); double zPos = ((z() + z() - z - z) * t3 + (3.0D * z - 3.0D * z()) * t2 + z() * progress + z());
double wPos = ((getW() + getW() - w - w) * t3 + (3.0D * w - 3.0D * getW()) * t2 + getW() * progress + getW()); double wPos = ((w() + w() - w - w) * t3 + (3.0D * w - 3.0D * w()) * t2 + w() * progress + w());
return result.set(xPos, yPos, zPos, wPos); return result.set(xPos, yPos, zPos, wPos);
} }
public default Vec4d min(Vec4d other) { return min(other, this); } public default Vec4d min(Vec4d other) { return min(other, this); }
public default Vec4d min(Vec4d other, Vec4d result) { return min(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4d min(Vec4d other, Vec4d result) { return min(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4d min(double x, double y, double z, double w) { return min(x, y, z, w, this); } public default Vec4d min(double x, double y, double z, double w) { return min(x, y, z, w, this); }
public default Vec4d min(double x, double y, double z, double w, Vec4d result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z), Math.min(getW(), w)); } public default Vec4d min(double x, double y, double z, double w, Vec4d result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z), Math.min(w(), w)); }
public default Vec4d max(Vec4d other) { return max(other, this); } public default Vec4d max(Vec4d other) { return max(other, this); }
public default Vec4d max(Vec4d other, Vec4d result) { return max(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4d max(Vec4d other, Vec4d result) { return max(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4d max(double x, double y, double z, double w) { return max(x, y, z, w, this); } public default Vec4d max(double x, double y, double z, double w) { return max(x, y, z, w, this); }
public default Vec4d max(double x, double y, double z, double w, Vec4d result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z), Math.max(getZ(), z)); } public default Vec4d max(double x, double y, double z, double w, Vec4d result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z), Math.max(z(), z)); }
public default Vec4d difference(Vec4d other) { return difference(other, this); } public default Vec4d difference(Vec4d other) { return difference(other, this); }
public default Vec4d difference(Vec4d other, Vec4d result) { return difference(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4d difference(Vec4d other, Vec4d result) { return difference(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4d difference(double x, double y, double z, double w) { return difference(x, y, z, w, this); } public default Vec4d difference(double x, double y, double z, double w) { return difference(x, y, z, w, this); }
public default Vec4d difference(double x, double y, double z, double w, Vec4d result) { return result.set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4d difference(double x, double y, double z, double w, Vec4d result) { return result.set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4d clamp(double min, double max) { return clamp(min, max, ALL); } public default Vec4d clamp(double min, double max) { return clamp(min, max, ALL); }
public default Vec4d clamp(double min, double max, Vec4d result) { return clamp(min, max, result, ALL); } public default Vec4d clamp(double min, double max, Vec4d result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec4d clamp(double min, double max, int filter) { return clamp(min, max, this, filter); } public default Vec4d clamp(double min, double max, int filter) { return clamp(min, max, this, filter); }
public default Vec4d clamp(double min, double max, Vec4d result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ()), (filter & W) == 0 ? getW() : MathUtils.clamp(min, max, getW())); } public default Vec4d clamp(double min, double max, Vec4d result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z()), (filter & W) == 0 ? w() : MathUtils.clamp(min, max, w())); }
@Override @Override
public default Vec4d store(ByteBuffer buffer) { public default Vec4d store(ByteBuffer buffer) {
buffer.putDouble(getX()).putDouble(getY()).putDouble(getZ()).putDouble(getW()); buffer.putDouble(x()).putDouble(y()).putDouble(z()).putDouble(w());
return this; return this;
} }
@ -174,22 +174,22 @@ public interface Vec4d extends Vecd {
@Override @Override
public default Vec4d store(DoubleBuffer buffer) { public default Vec4d store(DoubleBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()).put(getW()); buffer.put(x()).put(y()).put(z()).put(w());
return this; return this;
} }
@Override @Override
public default Vec4d load(DoubleBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); } public default Vec4d load(DoubleBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ()), (byte)MathUtils.floor(getW())) : Vec4b.of((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ()), (byte)MathUtils.floor(getW())); } public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z()), (byte)MathUtils.floor(w())) : Vec4b.of((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z()), (byte)MathUtils.floor(w())); }
@Override @Override
public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ()), (short)MathUtils.floor(getW())) : Vec4s.of((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ()), (short)MathUtils.floor(getW())); } public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z()), (short)MathUtils.floor(w())) : Vec4s.of((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z()), (short)MathUtils.floor(w())); }
@Override @Override
public default Vec4i asInt() { return isMutable() ? Vec4i.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())) : Vec4i.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())); } public default Vec4i asInt() { return isMutable() ? Vec4i.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())) : Vec4i.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())); }
@Override @Override
public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())) : Vec4l.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())); } public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())) : Vec4l.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())); }
@Override @Override
public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable((float)getX(), (float)getY(), (float)getZ(), (float)getW()) : Vec4f.of((float)getX(), (float)getY(), (float)getZ(), (float)getW()); } public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable((float)x(), (float)y(), (float)z(), (float)w()) : Vec4f.of((float)x(), (float)y(), (float)z(), (float)w()); }
@Override @Override
public default Vec4d asMutable() { return isMutable() ? this : mutable(this); } public default Vec4d asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -32,21 +32,21 @@ public class Vec4dImmutable implements Vec4d {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public double getX() { return x; } public double x() { return x; }
@Override @Override
public double getY() { return y; } public double y() { return y; }
@Override @Override
public double getZ() { return z; } public double z() { return z; }
@Override @Override
public double getW() { return w; } public double w() { return w; }
@Override @Override
public Vec4d setX(double x) { return this.x == x ? this : Vec4d.of(x, y, z, w); } public Vec4d x(double x) { return this.x == x ? this : Vec4d.of(x, y, z, w); }
@Override @Override
public Vec4d setY(double y) { return this.y == y ? this : Vec4d.of(x, y, z, w); } public Vec4d y(double y) { return this.y == y ? this : Vec4d.of(x, y, z, w); }
@Override @Override
public Vec4d setZ(double z) { return this.z == z ? this : Vec4d.of(x, y, z, w); } public Vec4d z(double z) { return this.z == z ? this : Vec4d.of(x, y, z, w); }
@Override @Override
public Vec4d setW(double w) { return this.w == w ? this : Vec4d.of(x, y, z, w); } public Vec4d w(double w) { return this.w == w ? this : Vec4d.of(x, y, z, w); }
@Override @Override
public Vec4d copy() { return Vec4d.of(this); } public Vec4d copy() { return Vec4d.of(this); }
@ -62,7 +62,7 @@ public class Vec4dImmutable implements Vec4d {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4d) { if(obj instanceof Vec4d) {
Vec4d vec = (Vec4d)obj; Vec4d vec = (Vec4d)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -27,34 +27,34 @@ public class Vec4dMutable implements Vec4d {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public double getX() { return x; } public double x() { return x; }
@Override @Override
public double getY() { return y; } public double y() { return y; }
@Override @Override
public double getZ() { return z; } public double z() { return z; }
@Override @Override
public double getW() { return w; } public double w() { return w; }
@Override @Override
public Vec4d setX(double x) { public Vec4d x(double x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec4d setY(double y) { public Vec4d y(double y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec4d setZ(double z) { public Vec4d z(double z) {
this.z = z; this.z = z;
return this; return this;
} }
@Override @Override
public Vec4d setW(double w) { public Vec4d w(double w) {
this.w = w; this.w = w;
return this; return this;
} }
@ -78,7 +78,7 @@ public class Vec4dMutable implements Vec4d {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4d) { if(obj instanceof Vec4d) {
Vec4d vec = (Vec4d)obj; Vec4d vec = (Vec4d)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -18,27 +18,27 @@ public interface Vec2f extends Vecf {
public static Vec2f mutable() { return new Vec2fMutable(); } public static Vec2f mutable() { return new Vec2fMutable(); }
public static Vec2f mutable(float value) { return new Vec2fMutable(value); } public static Vec2f mutable(float value) { return new Vec2fMutable(value); }
public static Vec2f mutable(float x, float y) { return new Vec2fMutable(x, y); } public static Vec2f mutable(float x, float y) { return new Vec2fMutable(x, y); }
public static Vec2f mutable(Vec2f value) { return mutable(value.getX(), value.getY()); } public static Vec2f mutable(Vec2f value) { return mutable(value.x(), value.y()); }
public static Vec2f of() { return new Vec2fImmutable(); } public static Vec2f of() { return new Vec2fImmutable(); }
public static Vec2f of(float value) { return new Vec2fImmutable(value); } public static Vec2f of(float value) { return new Vec2fImmutable(value); }
public static Vec2f of(float x, float y) { return new Vec2fImmutable(x, y); } public static Vec2f of(float x, float y) { return new Vec2fImmutable(x, y); }
public static Vec2f of(Vec2f value) { return of(value.getX(), value.getY()); } public static Vec2f of(Vec2f value) { return of(value.x(), value.y()); }
public float getX(); public float x();
public float getY(); public float y();
public Vec2f setX(float x); public Vec2f x(float x);
public Vec2f setY(float y); public Vec2f y(float y);
@Override @Override
public default float[] asArray() { return new float[] {getX(), getY()}; } public default float[] asArray() { return new float[] {x(), y()}; }
@Override @Override
public Vec2f copy(); public Vec2f copy();
@Override @Override
public default Vec2f abs() { return set(Math.abs(getX()), Math.abs(getY())); } public default Vec2f abs() { return set(Math.abs(x()), Math.abs(y())); }
@Override @Override
public default Vec2f negate() { return set(0F, 0F); } public default Vec2f negate() { return set(0F, 0F); }
@Override @Override
public default Vec2f invert() { return set(-getX(), -getY()); }; public default Vec2f invert() { return set(-x(), -y()); };
public default Vec2f normalize() { public default Vec2f normalize() {
float l = length(); float l = length();
return l == 0F ? this : multiply(1F / l); return l == 0F ? this : multiply(1F / l);
@ -46,83 +46,83 @@ public interface Vec2f extends Vecf {
@Override @Override
public default Vec2f add(float value) { return add(value, value); } public default Vec2f add(float value) { return add(value, value); }
public default Vec2f add(Vec2f value) { return add(value.getX(), value.getY()); } public default Vec2f add(Vec2f value) { return add(value.x(), value.y()); }
public default Vec2f add(float x, float y) { return set(x + getX(), y + getY()); } public default Vec2f add(float x, float y) { return set(x + x(), y + y()); }
@Override @Override
public default Vec2f sub(float value) { return sub(value, value); } public default Vec2f sub(float value) { return sub(value, value); }
public default Vec2f sub(Vec2f value) { return sub(value.getX(), value.getY()); } public default Vec2f sub(Vec2f value) { return sub(value.x(), value.y()); }
public default Vec2f sub(float x, float y) { return set(getX() - x, getY() - y); } public default Vec2f sub(float x, float y) { return set(x() - x, y() - y); }
@Override @Override
public default Vec2f multiply(float value) { return multiply(value, value); } public default Vec2f multiply(float value) { return multiply(value, value); }
public default Vec2f multiply(Vec2f value) { return multiply(value.getX(), value.getY()); } public default Vec2f multiply(Vec2f value) { return multiply(value.x(), value.y()); }
public default Vec2f multiply(float x, float y) { return set(x * getX(), y * getY()); } public default Vec2f multiply(float x, float y) { return set(x * x(), y * y()); }
@Override @Override
public default Vec2f devide(float value) { return devide(value, value); } public default Vec2f devide(float value) { return devide(value, value); }
public default Vec2f devide(Vec2f value) { return devide(value.getX(), value.getY()); } public default Vec2f devide(Vec2f value) { return devide(value.x(), value.y()); }
public default Vec2f devide(float x, float y) { return set(getX() / x, getY() / y); } public default Vec2f devide(float x, float y) { return set(x() / x, y() / y); }
@Override @Override
public default Vec2f set(float value) { return set(value, value); }; public default Vec2f set(float value) { return set(value, value); };
public default Vec2f set(Vec2f value) { return set(value.getX(), value.getY()); } public default Vec2f set(Vec2f value) { return set(value.x(), value.y()); }
public Vec2f set(float x, float y); public Vec2f set(float x, float y);
public default double distanceTo(Vec2f value) { return distanceTo(value.getX(), value.getY()); } public default double distanceTo(Vec2f value) { return distanceTo(value.x(), value.y()); }
public default double distanceTo(float x, float y) { return Math.sqrt(distanceToSquared(x, y)); } public default double distanceTo(float x, float y) { return Math.sqrt(distanceToSquared(x, y)); }
public default double distanceToSquared(Vec2f value) { return distanceToSquared(value.getX(), value.getY()); } public default double distanceToSquared(Vec2f value) { return distanceToSquared(value.x(), value.y()); }
public default double distanceToSquared(float x, float y) { public default double distanceToSquared(float x, float y) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
return (xPos * xPos) + (yPos * yPos); return (xPos * xPos) + (yPos * yPos);
} }
@Override @Override
public default float lengthSquared() { return (getX() * getX()) + (getY() * getY()); } public default float lengthSquared() { return (x() * x()) + (y() * y()); }
public default double dotProduct(Vec2f value) { return dotProduct(value.getX(), value.getY()); } public default double dotProduct(Vec2f value) { return dotProduct(value.x(), value.y()); }
public default double dotProduct(float x, float y) { return (getX() * x) + (getY() * y); } public default double dotProduct(float x, float y) { return (x() * x) + (y() * y); }
public default Vec2f lerp(Vec2f value, float progress, Vec2f result) { return lerp(value.getX(), value.getY(), progress, result); } public default Vec2f lerp(Vec2f value, float progress, Vec2f result) { return lerp(value.x(), value.y(), progress, result); }
public default Vec2f lerp(float x, float y, float progress, Vec2f result) { return result.set(MathUtils.lerp(getX(), x, progress), MathUtils.lerp(getY(), y, progress)); }; public default Vec2f lerp(float x, float y, float progress, Vec2f result) { return result.set(MathUtils.lerp(x(), x, progress), MathUtils.lerp(y(), y, progress)); };
public default float angle(Vec2f value) { return angle(value.getX(), value.getY()); } public default float angle(Vec2f value) { return angle(value.x(), value.y()); }
public default float angle(float x, float y) { return (float)Math.atan2((getX() * y) - (getY() * x), (getX() * x) + (getY() * y)); } public default float angle(float x, float y) { return (float)Math.atan2((x() * y) - (y() * x), (x() * x) + (y() * y)); }
public default float directionAngle(Vec2f value) { return directionAngle(value.getX(), value.getY()); } public default float directionAngle(Vec2f value) { return directionAngle(value.x(), value.y()); }
public default float directionAngle(float x, float y) { return (float)(-Math.toDegrees(Math.atan2(getX() - x, getY() - y)) % 360D); } public default float directionAngle(float x, float y) { return (float)(-Math.toDegrees(Math.atan2(x() - x, y() - y)) % 360D); }
public default Vec2f reflect(Vec2f value) { return reflect(value.getX(), value.getY(), this); } public default Vec2f reflect(Vec2f value) { return reflect(value.x(), value.y(), this); }
public default Vec2f reflect(float x, float y) { return reflect(x, y, this); }; public default Vec2f reflect(float x, float y) { return reflect(x, y, this); };
public default Vec2f reflect(Vec2f value, Vec2f result) { return reflect(value.getX(), value.getY(), result); } public default Vec2f reflect(Vec2f value, Vec2f result) { return reflect(value.x(), value.y(), result); }
public default Vec2f reflect(float x, float y, Vec2f result) { public default Vec2f reflect(float x, float y, Vec2f result) {
double dot = dotProduct(x, y); double dot = dotProduct(x, y);
float x2 = (float)((dot + dot) * x); float x2 = (float)((dot + dot) * x);
float y2 = (float)((dot + dot) * y); float y2 = (float)((dot + dot) * y);
return result.set(getX() - x2, getY() - y2); return result.set(x() - x2, y() - y2);
} }
public default Vec2f rotate(float angle, Vec2f center) { return rotate(angle, center.getX(), center.getY()); } public default Vec2f rotate(float angle, Vec2f center) { return rotate(angle, center.x(), center.y()); }
public default Vec2f rotate(float angle, float x, float y) { public default Vec2f rotate(float angle, float x, float y) {
float xPos = getX() - x; float xPos = x() - x;
float yPos = getY() - y; float yPos = y() - y;
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
return set((float)((xPos * cos) + (yPos * sin) + x), (float)(-(xPos * sin) + (yPos * cos) + y)); return set((float)((xPos * cos) + (yPos * sin) + x), (float)(-(xPos * sin) + (yPos * cos) + y));
} }
public default Vec2f min(Vec2f other) { return min(other, this); } public default Vec2f min(Vec2f other) { return min(other, this); }
public default Vec2f min(Vec2f other, Vec2f result) { return min(other.getX(), other.getY(), result); } public default Vec2f min(Vec2f other, Vec2f result) { return min(other.x(), other.y(), result); }
public default Vec2f min(float x, float y) { return min(x, y, this); } public default Vec2f min(float x, float y) { return min(x, y, this); }
public default Vec2f min(float x, float y, Vec2f result) { return result.set(Math.min(getX(), x), Math.min(getY(), y)); } public default Vec2f min(float x, float y, Vec2f result) { return result.set(Math.min(x(), x), Math.min(y(), y)); }
public default Vec2f max(Vec2f other) { return max(other, this); } public default Vec2f max(Vec2f other) { return max(other, this); }
public default Vec2f max(Vec2f other, Vec2f result) { return max(other.getX(), other.getY(), result); } public default Vec2f max(Vec2f other, Vec2f result) { return max(other.x(), other.y(), result); }
public default Vec2f max(float x, float y) { return max(x, y, this); } public default Vec2f max(float x, float y) { return max(x, y, this); }
public default Vec2f max(float x, float y, Vec2f result) { return result.set(Math.max(getX(), x), Math.max(getY(), y)); } public default Vec2f max(float x, float y, Vec2f result) { return result.set(Math.max(x(), x), Math.max(y(), y)); }
public default Vec2f difference(Vec2f other) { return difference(other, this); } public default Vec2f difference(Vec2f other) { return difference(other, this); }
public default Vec2f difference(Vec2f other, Vec2f result) { return difference(other.getX(), other.getY(), result); } public default Vec2f difference(Vec2f other, Vec2f result) { return difference(other.x(), other.y(), result); }
public default Vec2f difference(float x, float y) { return difference(x, y, this); } public default Vec2f difference(float x, float y) { return difference(x, y, this); }
public default Vec2f difference(float x, float y, Vec2f result) { return result.set(getX() - x, getY() - y); } public default Vec2f difference(float x, float y, Vec2f result) { return result.set(x() - x, y() - y); }
@Override @Override
public default Vec2f clamp(float min, float max) { return clamp(min, max, ALL); } public default Vec2f clamp(float min, float max) { return clamp(min, max, ALL); }
public default Vec2f clamp(float min, float max, Vec2f result) { return clamp(min, max, result, ALL); } public default Vec2f clamp(float min, float max, Vec2f result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec2f clamp(float min, float max, int filter) { return clamp(min, max, this, filter); } public default Vec2f clamp(float min, float max, int filter) { return clamp(min, max, this, filter); }
public default Vec2f clamp(float min, float max, Vec2f result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY())); } public default Vec2f clamp(float min, float max, Vec2f result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y())); }
@Override @Override
public default Vec2f store(ByteBuffer buffer) { public default Vec2f store(ByteBuffer buffer) {
buffer.putFloat(getX()).putFloat(getY()); buffer.putFloat(x()).putFloat(y());
return this; return this;
} }
@ -130,22 +130,22 @@ public interface Vec2f extends Vecf {
public default Vec2f load(ByteBuffer buffer) { return set(buffer.getFloat(), buffer.getFloat()); } public default Vec2f load(ByteBuffer buffer) { return set(buffer.getFloat(), buffer.getFloat()); }
@Override @Override
public default Vec2f store(FloatBuffer buffer) { public default Vec2f store(FloatBuffer buffer) {
buffer.put(getX()).put(getY()); buffer.put(x()).put(y());
return this; return this;
} }
@Override @Override
public default Vec2f load(FloatBuffer buffer) { return set(buffer.get(), buffer.get()); } public default Vec2f load(FloatBuffer buffer) { return set(buffer.get(), buffer.get()); }
@Override @Override
public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY())) : Vec2b.of((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY())); } public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y())) : Vec2b.of((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y())); }
@Override @Override
public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY())) : Vec2s.of((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY())); } public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)MathUtils.floor(x()), (short)MathUtils.floor(y())) : Vec2s.of((short)MathUtils.floor(x()), (short)MathUtils.floor(y())); }
@Override @Override
public default Vec2i asInt() { return isMutable() ? Vec2i.mutable(MathUtils.floor(getX()), MathUtils.floor(getY())) : Vec2i.of(MathUtils.floor(getX()), MathUtils.floor(getY())); } public default Vec2i asInt() { return isMutable() ? Vec2i.mutable(MathUtils.floor(x()), MathUtils.floor(y())) : Vec2i.of(MathUtils.floor(x()), MathUtils.floor(y())); }
@Override @Override
public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(MathUtils.floor(getX()), MathUtils.floor(getY())) : Vec2l.of(MathUtils.floor(getX()), MathUtils.floor(getY())); } public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(MathUtils.floor(x()), MathUtils.floor(y())) : Vec2l.of(MathUtils.floor(x()), MathUtils.floor(y())); }
@Override @Override
public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(getX(), getY()) : Vec2d.of(getX(), getY()); } public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(x(), y()) : Vec2d.of(x(), y()); }
@Override @Override
public default Vec2f asMutable() { return isMutable() ? this : mutable(this); } public default Vec2f asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -24,13 +24,13 @@ public class Vec2fImmutable implements Vec2f {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public float getX() { return x; } public float x() { return x; }
@Override @Override
public float getY() { return y; } public float y() { return y; }
@Override @Override
public Vec2f setX(float x) { return this.x == x ? this : Vec2f.of(x, y); } public Vec2f x(float x) { return this.x == x ? this : Vec2f.of(x, y); }
@Override @Override
public Vec2f setY(float y) { return this.y == y ? this : Vec2f.of(x, y); } public Vec2f y(float y) { return this.y == y ? this : Vec2f.of(x, y); }
@Override @Override
public Vec2f copy() { return Vec2f.of(x, y); } public Vec2f copy() { return Vec2f.of(x, y); }
@Override @Override
@ -43,7 +43,7 @@ public class Vec2fImmutable implements Vec2f {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2f) { if(obj instanceof Vec2f) {
Vec2f vec = (Vec2f)obj; Vec2f vec = (Vec2f)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -21,18 +21,18 @@ public class Vec2fMutable implements Vec2f {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public float getX() { return x; } public float x() { return x; }
@Override @Override
public float getY() { return y; } public float y() { return y; }
@Override @Override
public Vec2f setX(float x) { public Vec2f x(float x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec2f setY(float y) { public Vec2f y(float y) {
this.y = y; this.y = y;
return this; return this;
} }
@ -54,7 +54,7 @@ public class Vec2fMutable implements Vec2f {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2f) { if(obj instanceof Vec2f) {
Vec2f vec = (Vec2f)obj; Vec2f vec = (Vec2f)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -8,6 +8,7 @@ import speiger.src.coreengine.math.vector.bytes.Vec3b;
import speiger.src.coreengine.math.vector.doubles.Vec3d; import speiger.src.coreengine.math.vector.doubles.Vec3d;
import speiger.src.coreengine.math.vector.ints.Vec3i; import speiger.src.coreengine.math.vector.ints.Vec3i;
import speiger.src.coreengine.math.vector.longs.Vec3l; import speiger.src.coreengine.math.vector.longs.Vec3l;
import speiger.src.coreengine.math.vector.matrix.Matrix4f;
import speiger.src.coreengine.math.vector.shorts.Vec3s; import speiger.src.coreengine.math.vector.shorts.Vec3s;
public interface Vec3f extends Vecf { public interface Vec3f extends Vecf {
@ -18,29 +19,29 @@ public interface Vec3f extends Vecf {
public static Vec3f mutable() { return new Vec3fMutable(); } public static Vec3f mutable() { return new Vec3fMutable(); }
public static Vec3f mutable(float value) { return new Vec3fMutable(value); } public static Vec3f mutable(float value) { return new Vec3fMutable(value); }
public static Vec3f mutable(float x, float y, float z) { return new Vec3fMutable(x, y, z); } public static Vec3f mutable(float x, float y, float z) { return new Vec3fMutable(x, y, z); }
public static Vec3f mutable(Vec3f vec) { return mutable(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3f mutable(Vec3f vec) { return mutable(vec.x(), vec.y(), vec.z()); }
public static Vec3f of() { return new Vec3fImmutable(); } public static Vec3f of() { return new Vec3fImmutable(); }
public static Vec3f of(float value) { return new Vec3fImmutable(value); } public static Vec3f of(float value) { return new Vec3fImmutable(value); }
public static Vec3f of(float x, float y, float z) { return new Vec3fImmutable(x, y, z); } public static Vec3f of(float x, float y, float z) { return new Vec3fImmutable(x, y, z); }
public static Vec3f of(Vec3f vec) { return of(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3f of(Vec3f vec) { return of(vec.x(), vec.y(), vec.z()); }
public float getX(); public float x();
public float getY(); public float y();
public float getZ(); public float z();
public Vec3f setX(float x); public Vec3f x(float x);
public Vec3f setY(float y); public Vec3f y(float y);
public Vec3f setZ(float z); public Vec3f z(float z);
@Override @Override
public default float[] asArray() { return new float[] {getX(), getY(), getZ()}; } public default float[] asArray() { return new float[] {x(), y(), z()}; }
@Override @Override
public Vec3f copy(); public Vec3f copy();
@Override @Override
public default Vec3f abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ())); } public default Vec3f abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z())); }
@Override @Override
public default Vec3f negate() { return set(0F, 0F, 0F); } public default Vec3f negate() { return set(0F, 0F, 0F); }
@Override @Override
public default Vec3f invert() { return set(-getX(), -getY(), -getZ()); } public default Vec3f invert() { return set(-x(), -y(), -z()); }
public default Vec3f normalize() { public default Vec3f normalize() {
float l = length(); float l = length();
return l == 0F ? this : multiply(1.0F / l); return l == 0F ? this : multiply(1.0F / l);
@ -48,72 +49,72 @@ public interface Vec3f extends Vecf {
@Override @Override
public default Vec3f add(float value) { return add(value, value, value); } public default Vec3f add(float value) { return add(value, value, value); }
public default Vec3f add(Vec3f value) { return add(value.getX(), value.getY(), value.getZ()); } public default Vec3f add(Vec3f value) { return add(value.x(), value.y(), value.z()); }
public default Vec3f add(float x, float y, float z) { return set(getX() + x, getY() + y, getZ() + z); } public default Vec3f add(float x, float y, float z) { return set(x() + x, y() + y, z() + z); }
@Override @Override
public default Vec3f sub(float value) { return sub(value, value, value); } public default Vec3f sub(float value) { return sub(value, value, value); }
public default Vec3f sub(Vec3f value) { return sub(value.getX(), value.getY(), value.getZ()); } public default Vec3f sub(Vec3f value) { return sub(value.x(), value.y(), value.z()); }
public default Vec3f sub(float x, float y, float z) { return set(getX() - x, getY() - y, getZ() - z); } public default Vec3f sub(float x, float y, float z) { return set(x() - x, y() - y, z() - z); }
@Override @Override
public default Vec3f multiply(float value) { return multiply(value, value, value); } public default Vec3f multiply(float value) { return multiply(value, value, value); }
public default Vec3f multiply(Vec3f value) { return multiply(value.getX(), value.getY(), value.getZ()); } public default Vec3f multiply(Vec3f value) { return multiply(value.x(), value.y(), value.z()); }
public default Vec3f multiply(float x, float y, float z) { return set(getX() * x, getY() * y, getZ() * z); } public default Vec3f multiply(float x, float y, float z) { return set(x() * x, y() * y, z() * z); }
@Override @Override
public default Vec3f devide(float value) { return devide(value, value, value); } public default Vec3f devide(float value) { return devide(value, value, value); }
public default Vec3f devide(Vec3f value) { return devide(value.getX(), value.getY(), value.getZ()); } public default Vec3f devide(Vec3f value) { return devide(value.x(), value.y(), value.z()); }
public default Vec3f devide(float x, float y, float z) { return set(getX() / x, getY() / y, getZ() / z); } public default Vec3f devide(float x, float y, float z) { return set(x() / x, y() / y, z() / z); }
@Override @Override
public default Vec3f set(float value) { return set(value, value, value); } public default Vec3f set(float value) { return set(value, value, value); }
public default Vec3f set(Vec3f value) { return set(value.getX(), value.getY(), value.getZ()); } public default Vec3f set(Vec3f value) { return set(value.x(), value.y(), value.z()); }
public Vec3f set(float x, float y, float z); public Vec3f set(float x, float y, float z);
public default double distanceTo(Vec3f value) { return distanceTo(value.getX(), value.getY(), value.getZ()); } public default double distanceTo(Vec3f value) { return distanceTo(value.x(), value.y(), value.z()); }
public default double distanceTo(float x, float y, float z) { return Math.sqrt(distanceToSquared(x, y, z)); } public default double distanceTo(float x, float y, float z) { return Math.sqrt(distanceToSquared(x, y, z)); }
public default double distanceToSquared(Vec3f value) { return distanceToSquared(value.getX(), value.getY(), value.getZ()); } public default double distanceToSquared(Vec3f value) { return distanceToSquared(value.x(), value.y(), value.z()); }
public default double distanceToSquared(float x, float y, float z) { public default double distanceToSquared(float x, float y, float z) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
double zPos = getZ() - z; double zPos = z() - z;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos);
} }
@Override @Override
public default float lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); } public default float lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()); }
public default double dotProduct(Vec3f value) { return dotProduct(value.getX(), value.getY(), value.getZ()); } public default double dotProduct(Vec3f value) { return dotProduct(value.x(), value.y(), value.z()); }
public default double dotProduct(float x, float y, float z) { return (getX() * x) + (getY() * y) + (getZ() * z); } public default double dotProduct(float x, float y, float z) { return (x() * x) + (y() * y) + (z() * z); }
public default Vec3f lerp(Vec3f value, float progress, Vec3f result) { return lerp(value.getX(), value.getY(), value.getZ(), progress, result); } public default Vec3f lerp(Vec3f value, float progress, Vec3f result) { return lerp(value.x(), value.y(), value.z(), progress, result); }
public default Vec3f lerp(float x, float y, float z, float progress, Vec3f result) { return result.set(MathUtils.lerp(getX(), x, progress), MathUtils.lerp(getY(), y, progress), MathUtils.lerp(getZ(), z, progress)); } public default Vec3f lerp(float x, float y, float z, float progress, Vec3f result) { return result.set(MathUtils.lerp(x(), x, progress), MathUtils.lerp(y(), y, progress), MathUtils.lerp(z(), z, progress)); }
public default float angle(Vec3f value) { return angle(value.getX(), value.getY(), value.getZ()); } public default float angle(Vec3f value) { return angle(value.x(), value.y(), value.z()); }
public default float angle(float x, float y, float z) { return (float)Math.acos(MathUtils.clamp(-1, 1, angleCos(x, y, z))); } public default float angle(float x, float y, float z) { return (float)Math.acos(MathUtils.clamp(-1, 1, angleCos(x, y, z))); }
public default float angleCos(Vec3f value) { return angleCos(value.getX(), value.getY(), value.getZ()); } public default float angleCos(Vec3f value) { return angleCos(value.x(), value.y(), value.z()); }
public default float angleCos(float x, float y, float z) { public default float angleCos(float x, float y, float z) {
double myLength = (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); double myLength = (x() * x()) + (y() * y()) + (z() * z());
double otherLength = (x * x) + (y * y) + (z * z); double otherLength = (x * x) + (y * y) + (z * z);
float dot = (getX() * x) + (getY() * y) + (getZ() * z); float dot = (x() * x) + (y() * y) + (z() * z);
return dot / (float)(Math.sqrt(myLength * otherLength)); return dot / (float)(Math.sqrt(myLength * otherLength));
} }
public default Vec3f crossProduct(Vec3f value) { return crossProduct(value.getX(), value.getY(), value.getZ(), this); } public default Vec3f crossProduct(Vec3f value) { return crossProduct(value.x(), value.y(), value.z(), this); }
public default Vec3f crossProduct(Vec3f value, Vec3f result) { return crossProduct(value.getX(), value.getY(), value.getZ(), result); } public default Vec3f crossProduct(Vec3f value, Vec3f result) { return crossProduct(value.x(), value.y(), value.z(), result); }
public default Vec3f crossProduct(float x, float y, float z) { return crossProduct(x, y, z, this); } public default Vec3f crossProduct(float x, float y, float z) { return crossProduct(x, y, z, this); }
public default Vec3f crossProduct(float x, float y, float z, Vec3f result) { return result.set((getY() * z) - (getZ() * y), (getZ() * x) - (getX() * z), (getX() * y) - (getY() * x)); } public default Vec3f crossProduct(float x, float y, float z, Vec3f result) { return result.set((y() * z) - (z() * y), (z() * x) - (x() * z), (x() * y) - (y() * x)); }
public default Vec3f reflect(Vec3f value) { return reflect(value.getX(), value.getY(), value.getZ(), this); } public default Vec3f reflect(Vec3f value) { return reflect(value.x(), value.y(), value.z(), this); }
public default Vec3f reflect(Vec3f value, Vec3f result) { return reflect(value.getX(), value.getY(), value.getZ(), result); } public default Vec3f reflect(Vec3f value, Vec3f result) { return reflect(value.x(), value.y(), value.z(), result); }
public default Vec3f reflect(float x, float y, float z) { return reflect(x, y, z, this); } public default Vec3f reflect(float x, float y, float z) { return reflect(x, y, z, this); }
public default Vec3f reflect(float x, float y, float z, Vec3f result) { public default Vec3f reflect(float x, float y, float z, Vec3f result) {
double dot = dotProduct(x, y, z) * 2D; double dot = dotProduct(x, y, z) * 2D;
return result.set(getX() - (float)(dot * x), getY() - (float)(dot * y), getZ() - (float)(dot * z)); return result.set(x() - (float)(dot * x), y() - (float)(dot * y), z() - (float)(dot * z));
} }
public default Vec3f rotate(float angle, Vec3f axis) { return rotate(angle, axis.getX(), axis.getY(), axis.getZ()); } public default Vec3f rotate(float angle, Vec3f axis) { return rotate(angle, axis.x(), axis.y(), axis.z()); }
public default Vec3f rotate(float angle, Vec3f axis, Vec3f result) { return rotate(angle, axis.getX(), axis.getY(), axis.getZ(), result); } public default Vec3f rotate(float angle, Vec3f axis, Vec3f result) { return rotate(angle, axis.x(), axis.y(), axis.z(), result); }
public default Vec3f rotate(float angle, float x, float y, float z) { return rotate(angle, x, y, z, this); } public default Vec3f rotate(float angle, float x, float y, float z) { return rotate(angle, x, y, z, this); }
public default Vec3f rotate(float angle, float x, float y, float z, Vec3f result) { public default Vec3f rotate(float angle, float x, float y, float z, Vec3f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double dot = dotProduct(x, y, z); double dot = dotProduct(x, y, z);
double xPos = x * dot * (1D - cos) + (getX() * cos) + (-z * getY() + y * getZ()) * sin; double xPos = x * dot * (1D - cos) + (x() * cos) + (-z * y() + y * z()) * sin;
double yPos = y * dot * (1D - cos) + (getY() * cos) + (z * getX() - x * getZ()) * sin; double yPos = y * dot * (1D - cos) + (y() * cos) + (z * x() - x * z()) * sin;
double zPos = z * dot * (1D - cos) + (getZ() * cos) + (-y * getX() + x * getY()) * sin; double zPos = z * dot * (1D - cos) + (z() * cos) + (-y * x() + x * y()) * sin;
return result.set((float)xPos, (float)yPos, (float)zPos); return result.set((float)xPos, (float)yPos, (float)zPos);
} }
@ -121,61 +122,85 @@ public interface Vec3f extends Vecf {
public default Vec3f rotateX(float angle, Vec3f result) { public default Vec3f rotateX(float angle, Vec3f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double y = getY() * cos + getZ() * sin; double y = y() * cos + z() * sin;
double z = getZ() * cos - getY() * sin; double z = z() * cos - y() * sin;
return result.set(getX(), (float)y, (float)z); return result.set(x(), (float)y, (float)z);
} }
public default Vec3f rotateY(float angle) { return rotateY(angle, this); } public default Vec3f rotateY(float angle) { return rotateY(angle, this); }
public default Vec3f rotateY(float angle, Vec3f result) { public default Vec3f rotateY(float angle, Vec3f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = getX() * cos + getZ() * sin; double x = x() * cos + z() * sin;
double z = getZ() * cos - getX() * sin; double z = z() * cos - x() * sin;
return result.set((float)x, getY(), (float)z); return result.set((float)x, y(), (float)z);
} }
public default Vec3f rotateZ(float angle) { return rotateZ(angle, this); } public default Vec3f rotateZ(float angle) { return rotateZ(angle, this); }
public default Vec3f rotateZ(float angle, Vec3f result) { public default Vec3f rotateZ(float angle, Vec3f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = cos * getX() - sin * getY(); double x = cos * x() - sin * y();
double y = sin * getX() + cos * getY(); double y = sin * x() + cos * y();
return result.set((float)x, (float)y, getZ()); return result.set((float)x, (float)y, z());
} }
public default Vec3f smoothStep(Vec3f value, float progress, Vec3f result) { return smoothStep(value.getX(), value.getY(), value.getZ(), progress, result); } public default Vec3f transform(Matrix4f matrix) { return transform(matrix, true, this); }
public default Vec3f transofrm(Matrix4f matrix, boolean pos) { return transform(matrix, pos, this); }
public default Vec3f transform(Matrix4f matrix, boolean pos, Vec3f result) {
if((matrix.properties() & Matrix4f.PROPERTY_IDENTITY) != 0) {
return result.set(this);
}
if((matrix.properties() & Matrix4f.PROPERTY_ROTATION) != 0) {
float w = pos ? 1F : 0F;
return result.set(
matrix.fma(Matrix4f.M00, Matrix4f.M10, Matrix4f.M20, Matrix4f.M30, x(), y(), z(), w),
matrix.fma(Matrix4f.M01, Matrix4f.M11, Matrix4f.M21, Matrix4f.M31, x(), y(), z(), w),
matrix.fma(Matrix4f.M02, Matrix4f.M12, Matrix4f.M22, Matrix4f.M32, x(), y(), z(), w));
}
if((matrix.properties() & Matrix4f.PROPERTY_SCALE) != 0) {
if(pos) return set(
Math.fma(matrix.get(Matrix4f.M00), x(), matrix.get(Matrix4f.M30)),
Math.fma(matrix.get(Matrix4f.M01), y(), matrix.get(Matrix4f.M31)),
Math.fma(matrix.get(Matrix4f.M02), z(), matrix.get(Matrix4f.M32)));
return set(matrix.get(Matrix4f.M00) * x(), matrix.get(Matrix4f.M01) * y(), matrix.get(Matrix4f.M02) * z());
}
if(pos) return set(x() + matrix.get(Matrix4f.M30), y() + matrix.get(Matrix4f.M31), z() + matrix.get(Matrix4f.M32));
return result.set(this);
}
public default Vec3f smoothStep(Vec3f value, float progress, Vec3f result) { return smoothStep(value.x(), value.y(), value.z(), progress, result); }
public default Vec3f smoothStep(float x, float y, float z, float progress, Vec3f result) { public default Vec3f smoothStep(float x, float y, float z, float progress, Vec3f result) {
float t2 = progress * progress; float t2 = progress * progress;
float t3 = t2 * progress; float t3 = t2 * progress;
float xPos = ((getX() + getX() - x - x) * t3 + (3.0F * x - 3.0F * getX()) * t2 + getX() * progress + getX()); float xPos = ((x() + x() - x - x) * t3 + (3.0F * x - 3.0F * x()) * t2 + x() * progress + x());
float yPos = ((getY() + getY() - y - y) * t3 + (3.0F * y - 3.0F * getY()) * t2 + getY() * progress + getY()); float yPos = ((y() + y() - y - y) * t3 + (3.0F * y - 3.0F * y()) * t2 + y() * progress + y());
float zPos = ((getZ() + getZ() - z - z) * t3 + (3.0F * z - 3.0F * getZ()) * t2 + getZ() * progress + getZ()); float zPos = ((z() + z() - z - z) * t3 + (3.0F * z - 3.0F * z()) * t2 + z() * progress + z());
return result.set(xPos, yPos, zPos); return result.set(xPos, yPos, zPos);
} }
public default Vec3f min(Vec3f other) { return min(other, this); } public default Vec3f min(Vec3f other) { return min(other, this); }
public default Vec3f min(Vec3f other, Vec3f result) { return min(other.getX(), other.getY(), other.getZ(), result); } public default Vec3f min(Vec3f other, Vec3f result) { return min(other.x(), other.y(), other.z(), result); }
public default Vec3f min(float x, float y, float z) { return min(x, y, z, this); } public default Vec3f min(float x, float y, float z) { return min(x, y, z, this); }
public default Vec3f min(float x, float y, float z, Vec3f result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z)); } public default Vec3f min(float x, float y, float z, Vec3f result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z)); }
public default Vec3f max(Vec3f other) { return max(other, this); } public default Vec3f max(Vec3f other) { return max(other, this); }
public default Vec3f max(Vec3f other, Vec3f result) { return max(other.getX(), other.getY(), other.getZ(), result); } public default Vec3f max(Vec3f other, Vec3f result) { return max(other.x(), other.y(), other.z(), result); }
public default Vec3f max(float x, float y, float z) { return max(x, y, z, this); } public default Vec3f max(float x, float y, float z) { return max(x, y, z, this); }
public default Vec3f max(float x, float y, float z, Vec3f result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z)); } public default Vec3f max(float x, float y, float z, Vec3f result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z)); }
public default Vec3f difference(Vec3f other) { return difference(other, this); } public default Vec3f difference(Vec3f other) { return difference(other, this); }
public default Vec3f difference(Vec3f other, Vec3f result) { return difference(other.getX(), other.getY(), other.getZ(), result); } public default Vec3f difference(Vec3f other, Vec3f result) { return difference(other.x(), other.y(), other.z(), result); }
public default Vec3f difference(float x, float y, float z) { return difference(x, y, z, this); } public default Vec3f difference(float x, float y, float z) { return difference(x, y, z, this); }
public default Vec3f difference(float x, float y, float z, Vec3f result) { return result.set(getX() - x, getY() - y, getZ() - z); } public default Vec3f difference(float x, float y, float z, Vec3f result) { return result.set(x() - x, y() - y, z() - z); }
@Override @Override
public default Vec3f clamp(float min, float max) { return clamp(min, max, ALL); } public default Vec3f clamp(float min, float max) { return clamp(min, max, ALL); }
public default Vec3f clamp(float min, float max, Vec3f result) { return clamp(min, max, result, ALL); } public default Vec3f clamp(float min, float max, Vec3f result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec3f clamp(float min, float max, int filter) { return clamp(min, max, this, filter); } public default Vec3f clamp(float min, float max, int filter) { return clamp(min, max, this, filter); }
public default Vec3f clamp(float min, float max, Vec3f result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ())); } public default Vec3f clamp(float min, float max, Vec3f result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z())); }
@Override @Override
public default Vec3f store(ByteBuffer buffer) { public default Vec3f store(ByteBuffer buffer) {
buffer.putFloat(getX()).putFloat(getY()).putFloat(getZ()); buffer.putFloat(x()).putFloat(y()).putFloat(z());
return this; return this;
} }
@ -184,22 +209,22 @@ public interface Vec3f extends Vecf {
@Override @Override
public default Vec3f store(FloatBuffer buffer) { public default Vec3f store(FloatBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()); buffer.put(x()).put(y()).put(z());
return this; return this;
} }
@Override @Override
public default Vec3f load(FloatBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); } public default Vec3f load(FloatBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ())) : Vec3b.of((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ())); } public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z())) : Vec3b.of((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z())); }
@Override @Override
public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ())) : Vec3s.of((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ())); } public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z())) : Vec3s.of((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z())); }
@Override @Override
public default Vec3i asInt() { return isMutable() ? Vec3i.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ())) : Vec3i.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ())); } public default Vec3i asInt() { return isMutable() ? Vec3i.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())) : Vec3i.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())); }
@Override @Override
public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ())) : Vec3l.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ())); } public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())) : Vec3l.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z())); }
@Override @Override
public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(getX(), getY(), getZ()) : Vec3d.of(getX(), getY(), getZ()); } public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(x(), y(), z()) : Vec3d.of(x(), y(), z()); }
@Override @Override
public default Vec3f asMutable() { return isMutable() ? this : mutable(this); } public default Vec3f asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -28,17 +28,17 @@ public class Vec3fImmutable implements Vec3f {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public float getX() { return x; } public float x() { return x; }
@Override @Override
public float getY() { return y; } public float y() { return y; }
@Override @Override
public float getZ() { return z; } public float z() { return z; }
@Override @Override
public Vec3f setX(float x) { return this.x == x ? this : Vec3f.of(x, y, z); } public Vec3f x(float x) { return this.x == x ? this : Vec3f.of(x, y, z); }
@Override @Override
public Vec3f setY(float y) { return this.y == y ? this : Vec3f.of(x, y, z); } public Vec3f y(float y) { return this.y == y ? this : Vec3f.of(x, y, z); }
@Override @Override
public Vec3f setZ(float z) { return this.z == z ? this : Vec3f.of(x, y, z); } public Vec3f z(float z) { return this.z == z ? this : Vec3f.of(x, y, z); }
@Override @Override
public Vec3f copy() { return Vec3f.of(this); } public Vec3f copy() { return Vec3f.of(this); }
@Override @Override
@ -51,7 +51,7 @@ public class Vec3fImmutable implements Vec3f {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3f) { if(obj instanceof Vec3f) {
Vec3f vec = (Vec3f)obj; Vec3f vec = (Vec3f)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -24,26 +24,26 @@ public class Vec3fMutable implements Vec3f {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public float getX() { return x; } public float x() { return x; }
@Override @Override
public float getY() { return y; } public float y() { return y; }
@Override @Override
public float getZ() { return z; } public float z() { return z; }
@Override @Override
public Vec3f setX(float x) { public Vec3f x(float x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec3f setY(float y) { public Vec3f y(float y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec3f setZ(float z) { public Vec3f z(float z) {
this.z = z; this.z = z;
return this; return this;
} }
@ -66,7 +66,7 @@ public class Vec3fMutable implements Vec3f {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3f) { if(obj instanceof Vec3f) {
Vec3f vec = (Vec3f)obj; Vec3f vec = (Vec3f)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -8,6 +8,7 @@ import speiger.src.coreengine.math.vector.bytes.Vec4b;
import speiger.src.coreengine.math.vector.doubles.Vec4d; import speiger.src.coreengine.math.vector.doubles.Vec4d;
import speiger.src.coreengine.math.vector.ints.Vec4i; import speiger.src.coreengine.math.vector.ints.Vec4i;
import speiger.src.coreengine.math.vector.longs.Vec4l; import speiger.src.coreengine.math.vector.longs.Vec4l;
import speiger.src.coreengine.math.vector.matrix.Matrix4f;
import speiger.src.coreengine.math.vector.shorts.Vec4s; import speiger.src.coreengine.math.vector.shorts.Vec4s;
public interface Vec4f extends Vecf { public interface Vec4f extends Vecf {
@ -18,155 +19,177 @@ public interface Vec4f extends Vecf {
public static Vec4f mutable() { return new Vec4fMutable(); } public static Vec4f mutable() { return new Vec4fMutable(); }
public static Vec4f mutable(float value) { return new Vec4fMutable(value); } public static Vec4f mutable(float value) { return new Vec4fMutable(value); }
public static Vec4f mutable(float x, float y, float z, float w) { return new Vec4fMutable(x, y, z, w); } public static Vec4f mutable(float x, float y, float z, float w) { return new Vec4fMutable(x, y, z, w); }
public static Vec4f mutable(Vec4f vec) { return mutable(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4f mutable(Vec4f vec) { return mutable(vec.x(), vec.y(), vec.z(), vec.w()); }
public static Vec4f of() { return new Vec4fImmutable(); } public static Vec4f of() { return new Vec4fImmutable(); }
public static Vec4f of(float value) { return new Vec4fImmutable(value); } public static Vec4f of(float value) { return new Vec4fImmutable(value); }
public static Vec4f of(float x, float y, float z, float w) { return new Vec4fImmutable(x, y, z, w); } public static Vec4f of(float x, float y, float z, float w) { return new Vec4fImmutable(x, y, z, w); }
public static Vec4f of(Vec4f vec) { return of(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4f of(Vec4f vec) { return of(vec.x(), vec.y(), vec.z(), vec.w()); }
public float getX(); public float x();
public float getY(); public float y();
public float getZ(); public float z();
public float getW(); public float w();
public Vec4f setX(float x); public Vec4f x(float x);
public Vec4f setY(float y); public Vec4f y(float y);
public Vec4f setZ(float z); public Vec4f z(float z);
public Vec4f setW(float w); public Vec4f w(float w);
@Override @Override
public default float[] asArray() { return new float[] {getX(), getY(), getZ(), getW()}; } public default float[] asArray() { return new float[] {x(), y(), z(), w()}; }
@Override @Override
public Vec4f copy(); public Vec4f copy();
@Override @Override
public default Vec4f abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ()), Math.abs(getW())); } public default Vec4f abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z()), Math.abs(w())); }
@Override @Override
public default Vec4f negate() { return set(0F, 0F, 0F, 0F); } public default Vec4f negate() { return set(0F, 0F, 0F, 0F); }
@Override @Override
public default Vec4f invert() { return set(-getX(), -getY(), -getZ(), -getW()); } public default Vec4f invert() { return set(-x(), -y(), -z(), -w()); }
public default Vec4f normalize() { public default Vec4f normalize() {
float l = length(); float l = length();
return l == 0F ? this : multiply(1.0F / l); return l == 0F ? this : multiply(1.0F / l);
} }
public default Vec4f normalize3D() { public default Vec4f normalize3D() {
float value = (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); float value = (x() * x()) + (y() * y()) + (z() * z());
return value == 0F ? this : multiply(1F / value); return value == 0F ? this : multiply(1F / value);
} }
@Override @Override
public default Vec4f add(float value) { return add(value, value, value, value); } public default Vec4f add(float value) { return add(value, value, value, value); }
public default Vec4f add(Vec4f value) { return add(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4f add(Vec4f value) { return add(value.x(), value.y(), value.z(), value.w()); }
public default Vec4f add(float x, float y, float z, float w) { return set(getX() + x, getY() + y, getZ() + z, getW() + w); } public default Vec4f add(float x, float y, float z, float w) { return set(x() + x, y() + y, z() + z, w() + w); }
@Override @Override
public default Vec4f sub(float value) { return sub(value, value, value, value); } public default Vec4f sub(float value) { return sub(value, value, value, value); }
public default Vec4f sub(Vec4f value) { return sub(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4f sub(Vec4f value) { return sub(value.x(), value.y(), value.z(), value.w()); }
public default Vec4f sub(float x, float y, float z, float w) { return set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4f sub(float x, float y, float z, float w) { return set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4f multiply(float value) { return multiply(value, value, value, value); } public default Vec4f multiply(float value) { return multiply(value, value, value, value); }
public default Vec4f multiply(Vec4f value) { return multiply(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4f multiply(Vec4f value) { return multiply(value.x(), value.y(), value.z(), value.w()); }
public default Vec4f multiply(float x, float y, float z, float w) { return set(getX() * x, getY() * y, getZ() * z, getW() * w); } public default Vec4f multiply(float x, float y, float z, float w) { return set(x() * x, y() * y, z() * z, w() * w); }
@Override @Override
public default Vec4f devide(float value) { return devide(value, value, value, value); } public default Vec4f devide(float value) { return devide(value, value, value, value); }
public default Vec4f devide(Vec4f value) { return devide(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4f devide(Vec4f value) { return devide(value.x(), value.y(), value.z(), value.w()); }
public default Vec4f devide(float x, float y, float z, float w) { return set(getX() / x, getY() / y, getZ() / z, getW() / w); } public default Vec4f devide(float x, float y, float z, float w) { return set(x() / x, y() / y, z() / z, w() / w); }
@Override @Override
public default Vec4f set(float value) { return set(value, value, value, value); } public default Vec4f set(float value) { return set(value, value, value, value); }
public default Vec4f set(Vec4f value) { return set(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4f set(Vec4f value) { return set(value.x(), value.y(), value.z(), value.w()); }
public Vec4f set(float x, float y, float z, float w); public Vec4f set(float x, float y, float z, float w);
public default double distanceTo(Vec4f value) { return distanceTo(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceTo(Vec4f value) { return distanceTo(value.x(), value.y(), value.z(), value.w()); }
public default double distanceTo(float x, float y, float z, float w) { return Math.sqrt(distanceTo(x, y, z, w)); } public default double distanceTo(float x, float y, float z, float w) { return Math.sqrt(distanceTo(x, y, z, w)); }
public default double distanceToSquared(Vec4f value) { return distanceToSquared(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceToSquared(Vec4f value) { return distanceToSquared(value.x(), value.y(), value.z(), value.w()); }
public default double distanceToSquared(float x, float y, float z, float w) { public default double distanceToSquared(float x, float y, float z, float w) {
double xPos = getX() - x; double xPos = x() - x;
double yPos = getY() - y; double yPos = y() - y;
double zPos = getZ() - z; double zPos = z() - z;
double wPos = getW() - w; double wPos = w() - w;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos);
} }
@Override @Override
public default float lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()) + (getW() * getW()); } public default float lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()) + (w() * w()); }
public default double dotProduct(Vec4f value) { return dotProduct(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double dotProduct(Vec4f value) { return dotProduct(value.x(), value.y(), value.z(), value.w()); }
public default double dotProduct(float x, float y, float z, float w) { return (getX() * x) + (getY() * y) + (getZ() * z) + (getW() * w); }; public default double dotProduct(float x, float y, float z, float w) { return (x() * x) + (y() * y) + (z() * z) + (w() * w); };
public default Vec4f lerp(Vec4f value, float progress, Vec4f result) { return lerp(value.getX(), value.getY(), value.getZ(), value.getW(), progress, result); } public default Vec4f lerp(Vec4f value, float progress, Vec4f result) { return lerp(value.x(), value.y(), value.z(), value.w(), progress, result); }
public default Vec4f lerp(float x, float y, float z, float w, float progress, Vec4f result) { return result.set(MathUtils.lerp(getX(), x, progress), MathUtils.lerp(getY(), y, progress), MathUtils.lerp(getZ(), z, progress), MathUtils.lerp(getW(), w, progress)); } public default Vec4f lerp(float x, float y, float z, float w, float progress, Vec4f result) { return result.set(MathUtils.lerp(x(), x, progress), MathUtils.lerp(y(), y, progress), MathUtils.lerp(z(), z, progress), MathUtils.lerp(w(), w, progress)); }
public default float angle(Vec4f value) { return angle(value.getX(), value.getY(), value.getZ(), value.getW()); } public default float angle(Vec4f value) { return angle(value.x(), value.y(), value.z(), value.w()); }
public default float angle(float x, float y, float z, float w) { return (float)Math.acos(MathUtils.clamp(-1F, 1F, angleCos(x, y, z, w))); } public default float angle(float x, float y, float z, float w) { return (float)Math.acos(MathUtils.clamp(-1F, 1F, angleCos(x, y, z, w))); }
public default float angleCos(Vec4f value) { return angleCos(value.getX(), value.getY(), value.getZ(), value.getW()); } public default float angleCos(Vec4f value) { return angleCos(value.x(), value.y(), value.z(), value.w()); }
public default float angleCos(float x, float y, float z, float w) { return (float)(dotProduct(x, y, z, w) / Math.sqrt(lengthSquared() * (x * x) + (y * y) + (z * z) + (w * w))); } public default float angleCos(float x, float y, float z, float w) { return (float)(dotProduct(x, y, z, w) / Math.sqrt(lengthSquared() * (x * x) + (y * y) + (z * z) + (w * w))); }
public default Vec4f rotate(float angle, Vec4f axis) { return rotate(angle, axis.getX(), axis.getY(), axis.getZ(), axis.getW()); } public default Vec4f rotate(float angle, Vec4f axis) { return rotate(angle, axis.x(), axis.y(), axis.z(), axis.w()); }
public default Vec4f rotate(float angle, Vec4f axis, Vec4f result) { return rotate(angle, axis.getX(), axis.getY(), axis.getZ(), axis.getW(), result); } public default Vec4f rotate(float angle, Vec4f axis, Vec4f result) { return rotate(angle, axis.x(), axis.y(), axis.z(), axis.w(), result); }
public default Vec4f rotate(float angle, float x, float y, float z, float w) { return rotate(angle, x, y, z, w, this); } public default Vec4f rotate(float angle, float x, float y, float z, float w) { return rotate(angle, x, y, z, w, this); }
public default Vec4f rotate(float angle, float x, float y, float z, float w, Vec4f result) { public default Vec4f rotate(float angle, float x, float y, float z, float w, Vec4f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double dot = dotProduct(x, y, z, w); double dot = dotProduct(x, y, z, w);
double xPos = x * dot * (1D - cos) + (getX() * cos) + (-z * getY() + y * getZ()) * sin; double xPos = x * dot * (1D - cos) + (x() * cos) + (-z * y() + y * z()) * sin;
double yPos = y * dot * (1D - cos) + (getY() * cos) + (z * getX() - x * getZ()) * sin; double yPos = y * dot * (1D - cos) + (y() * cos) + (z * x() - x * z()) * sin;
double zPos = z * dot * (1D - cos) + (getZ() * cos) + (-y * getX() + x * getY()) * sin; double zPos = z * dot * (1D - cos) + (z() * cos) + (-y * x() + x * y()) * sin;
return result.set((float)xPos, (float)yPos, (float)zPos, getW()); return result.set((float)xPos, (float)yPos, (float)zPos, w());
} }
public default Vec4f rotateX(float angle) { return rotateX(angle, this); } public default Vec4f rotateX(float angle) { return rotateX(angle, this); }
public default Vec4f rotateX(float angle, Vec4f result) { public default Vec4f rotateX(float angle, Vec4f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double y = getY() * cos + getZ() * sin; double y = y() * cos + z() * sin;
double z = getZ() * cos - getY() * sin; double z = z() * cos - y() * sin;
return result.set(getX(), (float)y, (float)z, getW()); return result.set(x(), (float)y, (float)z, w());
} }
public default Vec4f rotateY(float angle) { return rotateY(angle, this); } public default Vec4f rotateY(float angle) { return rotateY(angle, this); }
public default Vec4f rotateY(float angle, Vec4f result) { public default Vec4f rotateY(float angle, Vec4f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = getX() * cos + getZ() * sin; double x = x() * cos + z() * sin;
double z = getZ() * cos - getX() * sin; double z = z() * cos - x() * sin;
return result.set((float)x, getY(), (float)z, getW()); return result.set((float)x, y(), (float)z, w());
} }
public default Vec4f rotateZ(float angle) { return rotateZ(angle, this); } public default Vec4f rotateZ(float angle) { return rotateZ(angle, this); }
public default Vec4f rotateZ(float angle, Vec4f result) { public default Vec4f rotateZ(float angle, Vec4f result) {
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
double x = cos * getX() - sin * getY(); double x = cos * x() - sin * y();
double y = sin * getX() + cos * getY(); double y = sin * x() + cos * y();
return result.set((float)x, (float)y, getZ(), getW()); return result.set((float)x, (float)y, z(), w());
} }
public default Vec4f smoothStep(Vec4f value, float progress, Vec4f result) { return smoothStep(value.getX(), value.getY(), value.getZ(), value.getW(), progress, result); } public default Vec4f transform(Matrix4f matrix) { return transform(matrix, this); }
public default Vec4f transform(Matrix4f matrix, Vec4f result) {
if((matrix.properties() & Matrix4f.PROPERTY_IDENTITY) != 0) {
return result.set(this);
}
if((matrix.properties() & Matrix4f.PROPERTY_ROTATION) != 0) {
return result.set(
matrix.fma(Matrix4f.M00, Matrix4f.M10, Matrix4f.M20, Matrix4f.M30, x(), y(), z(), w()),
matrix.fma(Matrix4f.M01, Matrix4f.M11, Matrix4f.M21, Matrix4f.M31, x(), y(), z(), w()),
matrix.fma(Matrix4f.M02, Matrix4f.M12, Matrix4f.M22, Matrix4f.M32, x(), y(), z(), w()),
matrix.fma(Matrix4f.M03, Matrix4f.M13, Matrix4f.M23, Matrix4f.M33, x(), y(), z(), w()));
}
if((matrix.properties() & Matrix4f.PROPERTY_SCALE) != 0) {
return set(
Math.fma(matrix.get(Matrix4f.M00), x(), matrix.get(Matrix4f.M30)),
Math.fma(matrix.get(Matrix4f.M01), y(), matrix.get(Matrix4f.M31)),
Math.fma(matrix.get(Matrix4f.M02), z(), matrix.get(Matrix4f.M32)),
Math.fma(matrix.get(Matrix4f.M03), w(), matrix.get(Matrix4f.M33)));
}
return set(x() + matrix.get(Matrix4f.M30), y() + matrix.get(Matrix4f.M31), z() + matrix.get(Matrix4f.M32), w() + matrix.get(Matrix4f.M33));
}
public default Vec4f smoothStep(Vec4f value, float progress, Vec4f result) { return smoothStep(value.x(), value.y(), value.z(), value.w(), progress, result); }
public default Vec4f smoothStep(float x, float y, float z, float w, float progress, Vec4f result) { public default Vec4f smoothStep(float x, float y, float z, float w, float progress, Vec4f result) {
float t2 = progress * progress; float t2 = progress * progress;
float t3 = t2 * progress; float t3 = t2 * progress;
float xPos = ((getX() + getX() - x - x) * t3 + (3.0F * x - 3.0F * getX()) * t2 + getX() * progress + getX()); float xPos = ((x() + x() - x - x) * t3 + (3.0F * x - 3.0F * x()) * t2 + x() * progress + x());
float yPos = ((getY() + getY() - y - y) * t3 + (3.0F * y - 3.0F * getY()) * t2 + getY() * progress + getY()); float yPos = ((y() + y() - y - y) * t3 + (3.0F * y - 3.0F * y()) * t2 + y() * progress + y());
float zPos = ((getZ() + getZ() - z - z) * t3 + (3.0F * z - 3.0F * getZ()) * t2 + getZ() * progress + getZ()); float zPos = ((z() + z() - z - z) * t3 + (3.0F * z - 3.0F * z()) * t2 + z() * progress + z());
float wPos = ((getW() + getW() - w - w) * t3 + (3.0F * w - 3.0F * getW()) * t2 + getW() * progress + getW()); float wPos = ((w() + w() - w - w) * t3 + (3.0F * w - 3.0F * w()) * t2 + w() * progress + w());
return result.set(xPos, yPos, zPos, wPos); return result.set(xPos, yPos, zPos, wPos);
} }
public default Vec4f min(Vec4f other) { return min(other, this); } public default Vec4f min(Vec4f other) { return min(other, this); }
public default Vec4f min(Vec4f other, Vec4f result) { return min(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4f min(Vec4f other, Vec4f result) { return min(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4f min(float x, float y, float z, float w) { return min(x, y, z, w, this); } public default Vec4f min(float x, float y, float z, float w) { return min(x, y, z, w, this); }
public default Vec4f min(float x, float y, float z, float w, Vec4f result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z), Math.min(getW(), w)); } public default Vec4f min(float x, float y, float z, float w, Vec4f result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z), Math.min(w(), w)); }
public default Vec4f max(Vec4f other) { return max(other, this); } public default Vec4f max(Vec4f other) { return max(other, this); }
public default Vec4f max(Vec4f other, Vec4f result) { return max(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4f max(Vec4f other, Vec4f result) { return max(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4f max(float x, float y, float z, float w) { return max(x, y, z, w, this); } public default Vec4f max(float x, float y, float z, float w) { return max(x, y, z, w, this); }
public default Vec4f max(float x, float y, float z, float w, Vec4f result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z), Math.max(getZ(), z)); } public default Vec4f max(float x, float y, float z, float w, Vec4f result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z), Math.max(z(), z)); }
public default Vec4f difference(Vec4f other) { return difference(other, this); } public default Vec4f difference(Vec4f other) { return difference(other, this); }
public default Vec4f difference(Vec4f other, Vec4f result) { return difference(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4f difference(Vec4f other, Vec4f result) { return difference(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4f difference(float x, float y, float z, float w) { return difference(x, y, z, w, this); } public default Vec4f difference(float x, float y, float z, float w) { return difference(x, y, z, w, this); }
public default Vec4f difference(float x, float y, float z, float w, Vec4f result) { return result.set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4f difference(float x, float y, float z, float w, Vec4f result) { return result.set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4f clamp(float min, float max) { return clamp(min, max, ALL); } public default Vec4f clamp(float min, float max) { return clamp(min, max, ALL); }
public default Vec4f clamp(float min, float max, Vec4f result) { return clamp(min, max, result, ALL); } public default Vec4f clamp(float min, float max, Vec4f result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec4f clamp(float min, float max, int filter) { return clamp(min, max, this, filter); } public default Vec4f clamp(float min, float max, int filter) { return clamp(min, max, this, filter); }
public default Vec4f clamp(float min, float max, Vec4f result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ()), (filter & W) == 0 ? getW() : MathUtils.clamp(min, max, getW())); } public default Vec4f clamp(float min, float max, Vec4f result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z()), (filter & W) == 0 ? w() : MathUtils.clamp(min, max, w())); }
@Override @Override
public default Vec4f store(ByteBuffer buffer) { public default Vec4f store(ByteBuffer buffer) {
buffer.putFloat(getX()).putFloat(getY()).putFloat(getZ()).putFloat(getW()); buffer.putFloat(x()).putFloat(y()).putFloat(z()).putFloat(w());
return this; return this;
} }
@ -175,7 +198,7 @@ public interface Vec4f extends Vecf {
@Override @Override
public default Vec4f store(FloatBuffer buffer) { public default Vec4f store(FloatBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()).put(getW()); buffer.put(x()).put(y()).put(z()).put(w());
return this; return this;
} }
@ -183,15 +206,15 @@ public interface Vec4f extends Vecf {
public default Vec4f load(FloatBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); } public default Vec4f load(FloatBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ()), (byte)MathUtils.floor(getW())) : Vec4b.of((byte)MathUtils.floor(getX()), (byte)MathUtils.floor(getY()), (byte)MathUtils.floor(getZ()), (byte)MathUtils.floor(getW())); } public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z()), (byte)MathUtils.floor(w())) : Vec4b.of((byte)MathUtils.floor(x()), (byte)MathUtils.floor(y()), (byte)MathUtils.floor(z()), (byte)MathUtils.floor(w())); }
@Override @Override
public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ()), (short)MathUtils.floor(getW())) : Vec4s.of((short)MathUtils.floor(getX()), (short)MathUtils.floor(getY()), (short)MathUtils.floor(getZ()), (short)MathUtils.floor(getW())); } public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z()), (short)MathUtils.floor(w())) : Vec4s.of((short)MathUtils.floor(x()), (short)MathUtils.floor(y()), (short)MathUtils.floor(z()), (short)MathUtils.floor(w())); }
@Override @Override
public default Vec4i asInt() { return isMutable() ? Vec4i.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())) : Vec4i.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())); } public default Vec4i asInt() { return isMutable() ? Vec4i.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())) : Vec4i.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())); }
@Override @Override
public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())) : Vec4l.of(MathUtils.floor(getX()), MathUtils.floor(getY()), MathUtils.floor(getZ()), MathUtils.floor(getW())); } public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())) : Vec4l.of(MathUtils.floor(x()), MathUtils.floor(y()), MathUtils.floor(z()), MathUtils.floor(w())); }
@Override @Override
public default Vec4d asDouble() { return isMutable() ? Vec4d.mutable(getX(), getY(), getZ(), getW()) : Vec4d.of(getX(), getY(), getZ(), getW()); } public default Vec4d asDouble() { return isMutable() ? Vec4d.mutable(x(), y(), z(), w()) : Vec4d.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4f asMutable() { return isMutable() ? this : mutable(this); } public default Vec4f asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -32,21 +32,21 @@ public class Vec4fImmutable implements Vec4f {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public float getX() { return x; } public float x() { return x; }
@Override @Override
public float getY() { return y; } public float y() { return y; }
@Override @Override
public float getZ() { return z; } public float z() { return z; }
@Override @Override
public float getW() { return w; } public float w() { return w; }
@Override @Override
public Vec4f setX(float x) { return this.x == x ? this : Vec4f.of(x, y, z, w); } public Vec4f x(float x) { return this.x == x ? this : Vec4f.of(x, y, z, w); }
@Override @Override
public Vec4f setY(float y) { return this.y == y ? this : Vec4f.of(x, y, z, w); } public Vec4f y(float y) { return this.y == y ? this : Vec4f.of(x, y, z, w); }
@Override @Override
public Vec4f setZ(float z) { return this.z == z ? this : Vec4f.of(x, y, z, w); } public Vec4f z(float z) { return this.z == z ? this : Vec4f.of(x, y, z, w); }
@Override @Override
public Vec4f setW(float w) { return this.w == w ? this : Vec4f.of(x, y, z, w); } public Vec4f w(float w) { return this.w == w ? this : Vec4f.of(x, y, z, w); }
@Override @Override
public Vec4f copy() { return Vec4f.of(this); } public Vec4f copy() { return Vec4f.of(this); }
@Override @Override
@ -58,7 +58,7 @@ public class Vec4fImmutable implements Vec4f {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4f) { if(obj instanceof Vec4f) {
Vec4f vec = (Vec4f)obj; Vec4f vec = (Vec4f)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -32,34 +32,34 @@ public class Vec4fMutable implements Vec4f {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public float getX() { return x; } public float x() { return x; }
@Override @Override
public float getY() { return y; } public float y() { return y; }
@Override @Override
public float getZ() { return z; } public float z() { return z; }
@Override @Override
public float getW() { return w; } public float w() { return w; }
@Override @Override
public Vec4f setX(float x) { public Vec4f x(float x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec4f setY(float y) { public Vec4f y(float y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec4f setZ(float z) { public Vec4f z(float z) {
this.z = z; this.z = z;
return this; return this;
} }
@Override @Override
public Vec4f setW(float w) { public Vec4f w(float w) {
this.w = w; this.w = w;
return this; return this;
} }
@ -83,7 +83,7 @@ public class Vec4fMutable implements Vec4f {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4f) { if(obj instanceof Vec4f) {
Vec4f vec = (Vec4f)obj; Vec4f vec = (Vec4f)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -18,91 +18,91 @@ public interface Vec2i extends Veci {
public static Vec2i mutable() { return new Vec2iMutable(); } public static Vec2i mutable() { return new Vec2iMutable(); }
public static Vec2i mutable(int value) { return new Vec2iMutable(value); } public static Vec2i mutable(int value) { return new Vec2iMutable(value); }
public static Vec2i mutable(int x, int y) { return new Vec2iMutable(x, y); } public static Vec2i mutable(int x, int y) { return new Vec2iMutable(x, y); }
public static Vec2i mutable(Vec2i value) { return mutable(value.getX(), value.getY()); } public static Vec2i mutable(Vec2i value) { return mutable(value.x(), value.y()); }
public static Vec2i of() { return new Vec2iImmutable(); } public static Vec2i of() { return new Vec2iImmutable(); }
public static Vec2i of(int value) { return new Vec2iImmutable(value); } public static Vec2i of(int value) { return new Vec2iImmutable(value); }
public static Vec2i of(int x, int y) { return new Vec2iImmutable(x, y); } public static Vec2i of(int x, int y) { return new Vec2iImmutable(x, y); }
public static Vec2i of(Vec2i value) { return of(value.getX(), value.getY()); } public static Vec2i of(Vec2i value) { return of(value.x(), value.y()); }
public int getX(); public int x();
public int getY(); public int y();
public Vec2i setX(int x); public Vec2i x(int x);
public Vec2i setY(int y); public Vec2i y(int y);
@Override @Override
public default int[] asArray() { return new int[] {getX(), getY()}; } public default int[] asArray() { return new int[] {x(), y()}; }
@Override @Override
public Vec2i copy(); public Vec2i copy();
@Override @Override
public default Vec2i abs() { return set(Math.abs(getX()), Math.abs(getY())); } public default Vec2i abs() { return set(Math.abs(x()), Math.abs(y())); }
@Override @Override
public default Vec2i negate() { return set(0, 0); } public default Vec2i negate() { return set(0, 0); }
@Override @Override
public default Vec2i invert() { return set(-getX(), -getY()); }; public default Vec2i invert() { return set(-x(), -y()); };
@Override @Override
public default Vec2i add(int value) { return add(value, value); } public default Vec2i add(int value) { return add(value, value); }
public default Vec2i add(Vec2i value) { return add(value.getX(), value.getY()); } public default Vec2i add(Vec2i value) { return add(value.x(), value.y()); }
public default Vec2i add(int x, int y) { return set(x + getX(), y + getY()); } public default Vec2i add(int x, int y) { return set(x + x(), y + y()); }
@Override @Override
public default Vec2i sub(int value) { return sub(value, value); } public default Vec2i sub(int value) { return sub(value, value); }
public default Vec2i sub(Vec2i value) { return sub(value.getX(), value.getY()); } public default Vec2i sub(Vec2i value) { return sub(value.x(), value.y()); }
public default Vec2i sub(int x, int y) { return set(getX() - x, getY() - y); } public default Vec2i sub(int x, int y) { return set(x() - x, y() - y); }
@Override @Override
public default Vec2i multiply(int value) { return multiply(value, value); } public default Vec2i multiply(int value) { return multiply(value, value); }
public default Vec2i multiply(Vec2i value) { return multiply(value.getX(), value.getY()); } public default Vec2i multiply(Vec2i value) { return multiply(value.x(), value.y()); }
public default Vec2i multiply(int x, int y) { return set(x * getX(), y * getY()); } public default Vec2i multiply(int x, int y) { return set(x * x(), y * y()); }
@Override @Override
public default Vec2i devide(int value) { return devide(value, value); } public default Vec2i devide(int value) { return devide(value, value); }
public default Vec2i devide(Vec2i value) { return devide(value.getX(), value.getY()); } public default Vec2i devide(Vec2i value) { return devide(value.x(), value.y()); }
public default Vec2i devide(int x, int y) { return set(getX() / x, getY() / y); } public default Vec2i devide(int x, int y) { return set(x() / x, y() / y); }
@Override @Override
public default Vec2i set(int value) { return set(value, value); }; public default Vec2i set(int value) { return set(value, value); };
public default Vec2i set(Vec2i value) { return set(value.getX(), value.getY()); } public default Vec2i set(Vec2i value) { return set(value.x(), value.y()); }
public Vec2i set(int x, int y); public Vec2i set(int x, int y);
public default double distanceTo(Vec2i value) { return distanceTo(value.getX(), value.getY()); } public default double distanceTo(Vec2i value) { return distanceTo(value.x(), value.y()); }
public default double distanceTo(int x, int y) { return Math.sqrt(distanceToSquared(x, y)); } public default double distanceTo(int x, int y) { return Math.sqrt(distanceToSquared(x, y)); }
public default long distanceToSquared(Vec2i value) { return distanceToSquared(value.getX(), value.getY()); } public default long distanceToSquared(Vec2i value) { return distanceToSquared(value.x(), value.y()); }
public default long distanceToSquared(int x, int y) { public default long distanceToSquared(int x, int y) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
return (xPos * xPos) + (yPos * yPos); return (xPos * xPos) + (yPos * yPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()); } public default long lengthSquared() { return (x() * x()) + (y() * y()); }
public default long dotProduct(Vec2i value) { return dotProduct(value.getX(), value.getY()); } public default long dotProduct(Vec2i value) { return dotProduct(value.x(), value.y()); }
public default long dotProduct(int x, int y) { return (getX() * x) + (getY() * y); } public default long dotProduct(int x, int y) { return (x() * x) + (y() * y); }
public default Vec2i rotate(int angle, Vec2i center) { return rotate(angle, center.getX(), center.getY()); } public default Vec2i rotate(int angle, Vec2i center) { return rotate(angle, center.x(), center.y()); }
public default Vec2i rotate(int angle, int x, int y) { public default Vec2i rotate(int angle, int x, int y) {
int xPos = getX() - x; int xPos = x() - x;
int yPos = getY() - y; int yPos = y() - y;
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
return set((int)((xPos * cos) + (yPos * sin) + x), (int)(-(xPos * sin) + (yPos * cos) + y)); return set((int)((xPos * cos) + (yPos * sin) + x), (int)(-(xPos * sin) + (yPos * cos) + y));
} }
public default Vec2i min(Vec2i other) { return min(other, this); } public default Vec2i min(Vec2i other) { return min(other, this); }
public default Vec2i min(Vec2i other, Vec2i result) { return min(other.getX(), other.getY(), result); } public default Vec2i min(Vec2i other, Vec2i result) { return min(other.x(), other.y(), result); }
public default Vec2i min(int x, int y) { return min(x, y, this); } public default Vec2i min(int x, int y) { return min(x, y, this); }
public default Vec2i min(int x, int y, Vec2i result) { return result.set(Math.min(getX(), x), Math.min(getY(), y)); } public default Vec2i min(int x, int y, Vec2i result) { return result.set(Math.min(x(), x), Math.min(y(), y)); }
public default Vec2i max(Vec2i other) { return max(other, this); } public default Vec2i max(Vec2i other) { return max(other, this); }
public default Vec2i max(Vec2i other, Vec2i result) { return max(other.getX(), other.getY(), result); } public default Vec2i max(Vec2i other, Vec2i result) { return max(other.x(), other.y(), result); }
public default Vec2i max(int x, int y) { return max(x, y, this); } public default Vec2i max(int x, int y) { return max(x, y, this); }
public default Vec2i max(int x, int y, Vec2i result) { return result.set(Math.max(getX(), x), Math.max(getY(), y)); } public default Vec2i max(int x, int y, Vec2i result) { return result.set(Math.max(x(), x), Math.max(y(), y)); }
public default Vec2i difference(Vec2i other) { return difference(other, this); } public default Vec2i difference(Vec2i other) { return difference(other, this); }
public default Vec2i difference(Vec2i other, Vec2i result) { return difference(other.getX(), other.getY(), result); } public default Vec2i difference(Vec2i other, Vec2i result) { return difference(other.x(), other.y(), result); }
public default Vec2i difference(int x, int y) { return difference(x, y, this); } public default Vec2i difference(int x, int y) { return difference(x, y, this); }
public default Vec2i difference(int x, int y, Vec2i result) { return result.set(getX() - x, getY() - y); } public default Vec2i difference(int x, int y, Vec2i result) { return result.set(x() - x, y() - y); }
@Override @Override
public default Vec2i clamp(int min, int max) { return clamp(min, max, ALL); } public default Vec2i clamp(int min, int max) { return clamp(min, max, ALL); }
public default Vec2i clamp(int min, int max, Vec2i result) { return clamp(min, max, result, ALL); } public default Vec2i clamp(int min, int max, Vec2i result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec2i clamp(int min, int max, int filter) { return clamp(min, max, this, filter); } public default Vec2i clamp(int min, int max, int filter) { return clamp(min, max, this, filter); }
public default Vec2i clamp(int min, int max, Vec2i result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY())); } public default Vec2i clamp(int min, int max, Vec2i result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y())); }
@Override @Override
public default Vec2i store(ByteBuffer buffer) { public default Vec2i store(ByteBuffer buffer) {
buffer.putInt(getX()).putInt(getY()); buffer.putInt(x()).putInt(y());
return this; return this;
} }
@ -111,22 +111,22 @@ public interface Vec2i extends Veci {
@Override @Override
public default Vec2i store(IntBuffer buffer) { public default Vec2i store(IntBuffer buffer) {
buffer.put(getX()).put(getY()); buffer.put(x()).put(y());
return this; return this;
} }
@Override @Override
public default Vec2i load(IntBuffer buffer) { return set(buffer.get(), buffer.get()); } public default Vec2i load(IntBuffer buffer) { return set(buffer.get(), buffer.get()); }
@Override @Override
public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)getX(), (byte)getY()) : Vec2b.of((byte)getX(), (byte)getY()); } public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)x(), (byte)y()) : Vec2b.of((byte)x(), (byte)y()); }
@Override @Override
public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)getX(), (short)getY()) : Vec2s.of((short)getX(), (short)getY()); } public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)x(), (short)y()) : Vec2s.of((short)x(), (short)y()); }
@Override @Override
public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(getX(), getY()) : Vec2l.of(getX(), getY()); } public default Vec2l asLong() { return isMutable() ? Vec2l.mutable(x(), y()) : Vec2l.of(x(), y()); }
@Override @Override
public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable(getX(), getY()) : Vec2f.of(getX(), getY()); } public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable(x(), y()) : Vec2f.of(x(), y()); }
@Override @Override
public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(getX(), getY()) : Vec2d.of(getX(), getY()); } public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(x(), y()) : Vec2d.of(x(), y()); }
@Override @Override
public default Vec2i asMutable() { return isMutable() ? this : mutable(this); } public default Vec2i asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -24,13 +24,13 @@ public class Vec2iImmutable implements Vec2i {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public int getX() { return x; } public int x() { return x; }
@Override @Override
public int getY() { return y; } public int y() { return y; }
@Override @Override
public Vec2i setX(int x) { return this.x == x ? this : Vec2i.of(x, y); } public Vec2i x(int x) { return this.x == x ? this : Vec2i.of(x, y); }
@Override @Override
public Vec2i setY(int y) { return this.y == y ? this : Vec2i.of(x, y); } public Vec2i y(int y) { return this.y == y ? this : Vec2i.of(x, y); }
@Override @Override
public Vec2i copy() { return Vec2i.of(this); } public Vec2i copy() { return Vec2i.of(this); }
@Override @Override
@ -42,7 +42,7 @@ public class Vec2iImmutable implements Vec2i {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2i) { if(obj instanceof Vec2i) {
Vec2i vec = (Vec2i)obj; Vec2i vec = (Vec2i)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -21,18 +21,18 @@ public class Vec2iMutable implements Vec2i {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public int getX() { return x; } public int x() { return x; }
@Override @Override
public int getY() { return y; } public int y() { return y; }
@Override @Override
public Vec2i setX(int x) { public Vec2i x(int x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec2i setY(int y) { public Vec2i y(int y) {
this.y = y; this.y = y;
return this; return this;
} }
@ -54,7 +54,7 @@ public class Vec2iMutable implements Vec2i {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2i) { if(obj instanceof Vec2i) {
Vec2i vec = (Vec2i)obj; Vec2i vec = (Vec2i)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -18,85 +18,85 @@ public interface Vec3i extends Veci {
public static Vec3i mutable() { return new Vec3iMutable(); } public static Vec3i mutable() { return new Vec3iMutable(); }
public static Vec3i mutable(int value) { return new Vec3iMutable(value); } public static Vec3i mutable(int value) { return new Vec3iMutable(value); }
public static Vec3i mutable(int x, int y, int z) { return new Vec3iMutable(x, y, z); } public static Vec3i mutable(int x, int y, int z) { return new Vec3iMutable(x, y, z); }
public static Vec3i mutable(Vec3i vec) { return mutable(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3i mutable(Vec3i vec) { return mutable(vec.x(), vec.y(), vec.z()); }
public static Vec3i of() { return new Vec3iImmutable(); } public static Vec3i of() { return new Vec3iImmutable(); }
public static Vec3i of(int value) { return new Vec3iImmutable(value); } public static Vec3i of(int value) { return new Vec3iImmutable(value); }
public static Vec3i of(int x, int y, int z) { return new Vec3iImmutable(x, y, z); } public static Vec3i of(int x, int y, int z) { return new Vec3iImmutable(x, y, z); }
public static Vec3i of(Vec3i vec) { return of(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3i of(Vec3i vec) { return of(vec.x(), vec.y(), vec.z()); }
public int getX(); public int x();
public int getY(); public int y();
public int getZ(); public int z();
public Vec3i setX(int x); public Vec3i x(int x);
public Vec3i setY(int y); public Vec3i y(int y);
public Vec3i setZ(int z); public Vec3i z(int z);
@Override @Override
public default int[] asArray() { return new int[] {getX(), getY(), getZ()}; } public default int[] asArray() { return new int[] {x(), y(), z()}; }
@Override @Override
public Vec3i copy(); public Vec3i copy();
@Override @Override
public default Vec3i abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ())); } public default Vec3i abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z())); }
@Override @Override
public default Vec3i negate() { return set(0, 0, 0); } public default Vec3i negate() { return set(0, 0, 0); }
@Override @Override
public default Vec3i invert() { return set(-getX(), -getY(), -getZ()); } public default Vec3i invert() { return set(-x(), -y(), -z()); }
@Override @Override
public default Vec3i add(int value) { return add(value, value, value); } public default Vec3i add(int value) { return add(value, value, value); }
public default Vec3i add(Vec3i value) { return add(value.getX(), value.getY(), value.getZ()); } public default Vec3i add(Vec3i value) { return add(value.x(), value.y(), value.z()); }
public default Vec3i add(int x, int y, int z) { return set(getX() + x, getY() + y, getZ() + z); } public default Vec3i add(int x, int y, int z) { return set(x() + x, y() + y, z() + z); }
@Override @Override
public default Vec3i sub(int value) { return sub(value, value, value); } public default Vec3i sub(int value) { return sub(value, value, value); }
public default Vec3i sub(Vec3i value) { return sub(value.getX(), value.getY(), value.getZ()); } public default Vec3i sub(Vec3i value) { return sub(value.x(), value.y(), value.z()); }
public default Vec3i sub(int x, int y, int z) { return set(getX() - x, getY() - y, getZ() - z); } public default Vec3i sub(int x, int y, int z) { return set(x() - x, y() - y, z() - z); }
@Override @Override
public default Vec3i multiply(int value) { return multiply(value, value, value); } public default Vec3i multiply(int value) { return multiply(value, value, value); }
public default Vec3i multiply(Vec3i value) { return multiply(value.getX(), value.getY(), value.getZ()); } public default Vec3i multiply(Vec3i value) { return multiply(value.x(), value.y(), value.z()); }
public default Vec3i multiply(int x, int y, int z) { return set(getX() * x, getY() * y, getZ() * z); } public default Vec3i multiply(int x, int y, int z) { return set(x() * x, y() * y, z() * z); }
@Override @Override
public default Vec3i devide(int value) { return devide(value, value, value); } public default Vec3i devide(int value) { return devide(value, value, value); }
public default Vec3i devide(Vec3i value) { return devide(value.getX(), value.getY(), value.getZ()); } public default Vec3i devide(Vec3i value) { return devide(value.x(), value.y(), value.z()); }
public default Vec3i devide(int x, int y, int z) { return set(getX() / x, getY() / y, getZ() / z); } public default Vec3i devide(int x, int y, int z) { return set(x() / x, y() / y, z() / z); }
@Override @Override
public default Vec3i set(int value) { return set(value, value, value); } public default Vec3i set(int value) { return set(value, value, value); }
public default Vec3i set(Vec3i value) { return set(value.getX(), value.getY(), value.getZ()); } public default Vec3i set(Vec3i value) { return set(value.x(), value.y(), value.z()); }
public Vec3i set(int x, int y, int z); public Vec3i set(int x, int y, int z);
public default double distanceTo(Vec3i value) { return distanceTo(value.getX(), value.getY(), value.getZ()); } public default double distanceTo(Vec3i value) { return distanceTo(value.x(), value.y(), value.z()); }
public default double distanceTo(int x, int y, int z) { return Math.sqrt(distanceToSquared(x, y, z)); } public default double distanceTo(int x, int y, int z) { return Math.sqrt(distanceToSquared(x, y, z)); }
public default long distanceToSquared(Vec3i value) { return distanceToSquared(value.getX(), value.getY(), value.getZ()); } public default long distanceToSquared(Vec3i value) { return distanceToSquared(value.x(), value.y(), value.z()); }
public default long distanceToSquared(int x, int y, int z) { public default long distanceToSquared(int x, int y, int z) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
long zPos = getZ() - z; long zPos = z() - z;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); } public default long lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()); }
public default long dotProduct(Vec3i value) { return dotProduct(value.getX(), value.getY(), value.getZ()); } public default long dotProduct(Vec3i value) { return dotProduct(value.x(), value.y(), value.z()); }
public default long dotProduct(int x, int y, int z) { return (getX() * x) + (getY() * y) + (getZ() * z); } public default long dotProduct(int x, int y, int z) { return (x() * x) + (y() * y) + (z() * z); }
public default Vec3i min(Vec3i other) { return min(other, this); } public default Vec3i min(Vec3i other) { return min(other, this); }
public default Vec3i min(Vec3i other, Vec3i result) { return min(other.getX(), other.getY(), other.getZ(), result); } public default Vec3i min(Vec3i other, Vec3i result) { return min(other.x(), other.y(), other.z(), result); }
public default Vec3i min(int x, int y, int z) { return min(x, y, z, this); } public default Vec3i min(int x, int y, int z) { return min(x, y, z, this); }
public default Vec3i min(int x, int y, int z, Vec3i result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z)); } public default Vec3i min(int x, int y, int z, Vec3i result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z)); }
public default Vec3i max(Vec3i other) { return max(other, this); } public default Vec3i max(Vec3i other) { return max(other, this); }
public default Vec3i max(Vec3i other, Vec3i result) { return max(other.getX(), other.getY(), other.getZ(), result); } public default Vec3i max(Vec3i other, Vec3i result) { return max(other.x(), other.y(), other.z(), result); }
public default Vec3i max(int x, int y, int z) { return max(x, y, z, this); } public default Vec3i max(int x, int y, int z) { return max(x, y, z, this); }
public default Vec3i max(int x, int y, int z, Vec3i result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z)); } public default Vec3i max(int x, int y, int z, Vec3i result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z)); }
public default Vec3i difference(Vec3i other) { return difference(other, this); } public default Vec3i difference(Vec3i other) { return difference(other, this); }
public default Vec3i difference(Vec3i other, Vec3i result) { return difference(other.getX(), other.getY(), other.getZ(), result); } public default Vec3i difference(Vec3i other, Vec3i result) { return difference(other.x(), other.y(), other.z(), result); }
public default Vec3i difference(int x, int y, int z) { return difference(x, y, z, this); } public default Vec3i difference(int x, int y, int z) { return difference(x, y, z, this); }
public default Vec3i difference(int x, int y, int z, Vec3i result) { return result.set(getX() - x, getY() - y, getZ() - z); } public default Vec3i difference(int x, int y, int z, Vec3i result) { return result.set(x() - x, y() - y, z() - z); }
@Override @Override
public default Vec3i clamp(int min, int max) { return clamp(min, max, ALL); } public default Vec3i clamp(int min, int max) { return clamp(min, max, ALL); }
public default Vec3i clamp(int min, int max, Vec3i result) { return clamp(min, max, result, ALL); } public default Vec3i clamp(int min, int max, Vec3i result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec3i clamp(int min, int max, int filter) { return clamp(min, max, this, filter); } public default Vec3i clamp(int min, int max, int filter) { return clamp(min, max, this, filter); }
public default Vec3i clamp(int min, int max, Vec3i result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ())); } public default Vec3i clamp(int min, int max, Vec3i result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z())); }
@Override @Override
public default Vec3i store(ByteBuffer buffer) { public default Vec3i store(ByteBuffer buffer) {
buffer.putInt(getX()).putInt(getY()).putInt(getZ()); buffer.putInt(x()).putInt(y()).putInt(z());
return this; return this;
} }
@ -105,22 +105,22 @@ public interface Vec3i extends Veci {
@Override @Override
public default Vec3i store(IntBuffer buffer) { public default Vec3i store(IntBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()); buffer.put(x()).put(y()).put(z());
return this; return this;
} }
@Override @Override
public default Vec3i load(IntBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); } public default Vec3i load(IntBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)getX(), (byte)getY(), (byte)getZ()) : Vec3b.of((byte)getX(), (byte)getY(), (byte)getZ()); } public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)x(), (byte)y(), (byte)z()) : Vec3b.of((byte)x(), (byte)y(), (byte)z()); }
@Override @Override
public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)getX(), (short)getY(), (short)getZ()) : Vec3s.of((short)getX(), (short)getY(), (short)getZ()); } public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)x(), (short)y(), (short)z()) : Vec3s.of((short)x(), (short)y(), (short)z()); }
@Override @Override
public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(getX(), getY(), getZ()) : Vec3l.of(getX(), getY(), getZ()); } public default Vec3l asLong() { return isMutable() ? Vec3l.mutable(x(), y(), z()) : Vec3l.of(x(), y(), z()); }
@Override @Override
public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable(getX(), getY(), getZ()) : Vec3f.of(getX(), getY(), getZ()); } public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable(x(), y(), z()) : Vec3f.of(x(), y(), z()); }
@Override @Override
public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(getX(), getY(), getZ()) : Vec3d.of(getX(), getY(), getZ()); } public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(x(), y(), z()) : Vec3d.of(x(), y(), z()); }
@Override @Override
public default Vec3i asMutable() { return isMutable() ? this : mutable(this); } public default Vec3i asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -28,17 +28,17 @@ public class Vec3iImmutable implements Vec3i {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public int getX() { return x; } public int x() { return x; }
@Override @Override
public int getY() { return y; } public int y() { return y; }
@Override @Override
public int getZ() { return z; } public int z() { return z; }
@Override @Override
public Vec3i setX(int x) { return this.x == x ? this : Vec3i.of(x, y, z); } public Vec3i x(int x) { return this.x == x ? this : Vec3i.of(x, y, z); }
@Override @Override
public Vec3i setY(int y) { return this.y == y ? this : Vec3i.of(x, y, z); } public Vec3i y(int y) { return this.y == y ? this : Vec3i.of(x, y, z); }
@Override @Override
public Vec3i setZ(int z) { return this.z == z ? this : Vec3i.of(x, y, z); } public Vec3i z(int z) { return this.z == z ? this : Vec3i.of(x, y, z); }
@Override @Override
public Vec3i copy() { return Vec3i.of(this); } public Vec3i copy() { return Vec3i.of(this); }
@Override @Override
@ -50,7 +50,7 @@ public class Vec3iImmutable implements Vec3i {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3i) { if(obj instanceof Vec3i) {
Vec3i vec = (Vec3i)obj; Vec3i vec = (Vec3i)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -24,26 +24,26 @@ public class Vec3iMutable implements Vec3i {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public int getX() { return x; } public int x() { return x; }
@Override @Override
public int getY() { return y; } public int y() { return y; }
@Override @Override
public int getZ() { return z; } public int z() { return z; }
@Override @Override
public Vec3i setX(int x) { public Vec3i x(int x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec3i setY(int y) { public Vec3i y(int y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec3i setZ(int z) { public Vec3i z(int z) {
this.z = z; this.z = z;
return this; return this;
} }
@ -66,7 +66,7 @@ public class Vec3iMutable implements Vec3i {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3i) { if(obj instanceof Vec3i) {
Vec3i vec = (Vec3i)obj; Vec3i vec = (Vec3i)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -18,88 +18,88 @@ public interface Vec4i extends Veci {
public static Vec4i mutable() { return new Vec4iMutable(); } public static Vec4i mutable() { return new Vec4iMutable(); }
public static Vec4i mutable(int value) { return new Vec4iMutable(value); } public static Vec4i mutable(int value) { return new Vec4iMutable(value); }
public static Vec4i mutable(int x, int y, int z, int w) { return new Vec4iMutable(x, y, z, w); } public static Vec4i mutable(int x, int y, int z, int w) { return new Vec4iMutable(x, y, z, w); }
public static Vec4i mutable(Vec4i vec) { return mutable(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4i mutable(Vec4i vec) { return mutable(vec.x(), vec.y(), vec.z(), vec.w()); }
public static Vec4i of() { return new Vec4iImmutable(); } public static Vec4i of() { return new Vec4iImmutable(); }
public static Vec4i of(int value) { return new Vec4iImmutable(value); } public static Vec4i of(int value) { return new Vec4iImmutable(value); }
public static Vec4i of(int x, int y, int z, int w) { return new Vec4iImmutable(x, y, z, w); } public static Vec4i of(int x, int y, int z, int w) { return new Vec4iImmutable(x, y, z, w); }
public static Vec4i of(Vec4i vec) { return of(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4i of(Vec4i vec) { return of(vec.x(), vec.y(), vec.z(), vec.w()); }
public int getX(); public int x();
public int getY(); public int y();
public int getZ(); public int z();
public int getW(); public int w();
public Vec4i setX(int x); public Vec4i x(int x);
public Vec4i setY(int y); public Vec4i y(int y);
public Vec4i setZ(int z); public Vec4i z(int z);
public Vec4i setW(int w); public Vec4i w(int w);
@Override @Override
public default int[] asArray() { return new int[] {getX(), getY(), getZ(), getW()}; } public default int[] asArray() { return new int[] {x(), y(), z(), w()}; }
@Override @Override
public Vec4i copy(); public Vec4i copy();
@Override @Override
public default Vec4i abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ()), Math.abs(getW())); } public default Vec4i abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z()), Math.abs(w())); }
@Override @Override
public default Vec4i negate() { return set(0, 0, 0, 0); } public default Vec4i negate() { return set(0, 0, 0, 0); }
@Override @Override
public default Vec4i invert() { return set(-getX(), -getY(), -getZ(), -getW()); } public default Vec4i invert() { return set(-x(), -y(), -z(), -w()); }
@Override @Override
public default Vec4i add(int value) { return add(value, value, value, value); } public default Vec4i add(int value) { return add(value, value, value, value); }
public default Vec4i add(Vec4i value) { return add(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4i add(Vec4i value) { return add(value.x(), value.y(), value.z(), value.w()); }
public default Vec4i add(int x, int y, int z, int w) { return set(getX() + x, getY() + y, getZ() + z, getW() + w); } public default Vec4i add(int x, int y, int z, int w) { return set(x() + x, y() + y, z() + z, w() + w); }
@Override @Override
public default Vec4i sub(int value) { return sub(value, value, value, value); } public default Vec4i sub(int value) { return sub(value, value, value, value); }
public default Vec4i sub(Vec4i value) { return sub(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4i sub(Vec4i value) { return sub(value.x(), value.y(), value.z(), value.w()); }
public default Vec4i sub(int x, int y, int z, int w) { return set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4i sub(int x, int y, int z, int w) { return set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4i multiply(int value) { return multiply(value, value, value, value); } public default Vec4i multiply(int value) { return multiply(value, value, value, value); }
public default Vec4i multiply(Vec4i value) { return multiply(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4i multiply(Vec4i value) { return multiply(value.x(), value.y(), value.z(), value.w()); }
public default Vec4i multiply(int x, int y, int z, int w) { return set(getX() * x, getY() * y, getZ() * z, getW() * w); } public default Vec4i multiply(int x, int y, int z, int w) { return set(x() * x, y() * y, z() * z, w() * w); }
@Override @Override
public default Vec4i devide(int value) { return devide(value, value, value, value); } public default Vec4i devide(int value) { return devide(value, value, value, value); }
public default Vec4i devide(Vec4i value) { return devide(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4i devide(Vec4i value) { return devide(value.x(), value.y(), value.z(), value.w()); }
public default Vec4i devide(int x, int y, int z, int w) { return set(getX() / x, getY() / y, getZ() / z, getW() / w); } public default Vec4i devide(int x, int y, int z, int w) { return set(x() / x, y() / y, z() / z, w() / w); }
@Override @Override
public default Vec4i set(int value) { return set(value, value, value, value); } public default Vec4i set(int value) { return set(value, value, value, value); }
public default Vec4i set(Vec4i value) { return set(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4i set(Vec4i value) { return set(value.x(), value.y(), value.z(), value.w()); }
public Vec4i set(int x, int y, int z, int w); public Vec4i set(int x, int y, int z, int w);
public default double distanceTo(Vec4i value) { return distanceTo(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceTo(Vec4i value) { return distanceTo(value.x(), value.y(), value.z(), value.w()); }
public default double distanceTo(int x, int y, int z, int w) { return Math.sqrt(distanceTo(x, y, z, w)); } public default double distanceTo(int x, int y, int z, int w) { return Math.sqrt(distanceTo(x, y, z, w)); }
public default long distanceToSquared(Vec4i value) { return distanceToSquared(value.getX(), value.getY(), value.getZ(), value.getW()); } public default long distanceToSquared(Vec4i value) { return distanceToSquared(value.x(), value.y(), value.z(), value.w()); }
public default long distanceToSquared(int x, int y, int z, int w) { public default long distanceToSquared(int x, int y, int z, int w) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
long zPos = getZ() - z; long zPos = z() - z;
long wPos = getW() - w; long wPos = w() - w;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()) + (getW() * getW()); } public default long lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()) + (w() * w()); }
public default long dotProduct(Vec4i value) { return dotProduct(value.getX(), value.getY(), value.getZ(), value.getW()); } public default long dotProduct(Vec4i value) { return dotProduct(value.x(), value.y(), value.z(), value.w()); }
public default long dotProduct(int x, int y, int z, int w) { return (getX() * x) + (getY() * y) + (getZ() * z) + (getW() * w); }; public default long dotProduct(int x, int y, int z, int w) { return (x() * x) + (y() * y) + (z() * z) + (w() * w); };
public default Vec4i min(Vec4i other) { return min(other, this); } public default Vec4i min(Vec4i other) { return min(other, this); }
public default Vec4i min(Vec4i other, Vec4i result) { return min(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4i min(Vec4i other, Vec4i result) { return min(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4i min(int x, int y, int z, int w) { return min(x, y, z, w, this); } public default Vec4i min(int x, int y, int z, int w) { return min(x, y, z, w, this); }
public default Vec4i min(int x, int y, int z, int w, Vec4i result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z), Math.min(getW(), w)); } public default Vec4i min(int x, int y, int z, int w, Vec4i result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z), Math.min(w(), w)); }
public default Vec4i max(Vec4i other) { return max(other, this); } public default Vec4i max(Vec4i other) { return max(other, this); }
public default Vec4i max(Vec4i other, Vec4i result) { return max(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4i max(Vec4i other, Vec4i result) { return max(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4i max(int x, int y, int z, int w) { return max(x, y, z, w, this); } public default Vec4i max(int x, int y, int z, int w) { return max(x, y, z, w, this); }
public default Vec4i max(int x, int y, int z, int w, Vec4i result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z), Math.max(getZ(), z)); } public default Vec4i max(int x, int y, int z, int w, Vec4i result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z), Math.max(z(), z)); }
public default Vec4i difference(Vec4i other) { return difference(other, this); } public default Vec4i difference(Vec4i other) { return difference(other, this); }
public default Vec4i difference(Vec4i other, Vec4i result) { return difference(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4i difference(Vec4i other, Vec4i result) { return difference(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4i difference(int x, int y, int z, int w) { return difference(x, y, z, w, this); } public default Vec4i difference(int x, int y, int z, int w) { return difference(x, y, z, w, this); }
public default Vec4i difference(int x, int y, int z, int w, Vec4i result) { return result.set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4i difference(int x, int y, int z, int w, Vec4i result) { return result.set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4i clamp(int min, int max) { return clamp(min, max, ALL); } public default Vec4i clamp(int min, int max) { return clamp(min, max, ALL); }
public default Vec4i clamp(int min, int max, Vec4i result) { return clamp(min, max, result, ALL); } public default Vec4i clamp(int min, int max, Vec4i result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec4i clamp(int min, int max, int filter) { return clamp(min, max, this, filter); } public default Vec4i clamp(int min, int max, int filter) { return clamp(min, max, this, filter); }
public default Vec4i clamp(int min, int max, Vec4i result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ()), (filter & W) == 0 ? getW() : MathUtils.clamp(min, max, getW())); } public default Vec4i clamp(int min, int max, Vec4i result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z()), (filter & W) == 0 ? w() : MathUtils.clamp(min, max, w())); }
@Override @Override
public default Vec4i store(ByteBuffer buffer) { public default Vec4i store(ByteBuffer buffer) {
buffer.putInt(getX()).putInt(getY()).putInt(getZ()).putInt(getW()); buffer.putInt(x()).putInt(y()).putInt(z()).putInt(w());
return this; return this;
} }
@ -108,22 +108,22 @@ public interface Vec4i extends Veci {
@Override @Override
public default Vec4i store(IntBuffer buffer) { public default Vec4i store(IntBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()).put(getW()); buffer.put(x()).put(y()).put(z()).put(w());
return this; return this;
} }
@Override @Override
public default Vec4i load(IntBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); } public default Vec4i load(IntBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)getX(), (byte)getY(), (byte)getZ(), (byte)getW()) : Vec4b.of((byte)getX(), (byte)getY(), (byte)getZ(), (byte)getW()); } public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)x(), (byte)y(), (byte)z(), (byte)w()) : Vec4b.of((byte)x(), (byte)y(), (byte)z(), (byte)w()); }
@Override @Override
public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)getX(), (short)getY(), (short)getZ(), (short)getW()) : Vec4s.of((short)getX(), (short)getY(), (short)getZ(), (short)getW()); } public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)x(), (short)y(), (short)z(), (short)w()) : Vec4s.of((short)x(), (short)y(), (short)z(), (short)w()); }
@Override @Override
public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(getX(), getY(), getZ(), getW()) : Vec4l.of(getX(), getY(), getZ(), getW()); } public default Vec4l asLong() { return isMutable() ? Vec4l.mutable(x(), y(), z(), w()) : Vec4l.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable(getX(), getY(), getZ(), getW()) : Vec4f.of(getX(), getY(), getZ(), getW()); } public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable(x(), y(), z(), w()) : Vec4f.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4d asDouble() { return isMutable() ? Vec4d.mutable(getX(), getY(), getZ(), getW()) : Vec4d.of(getX(), getY(), getZ(), getW()); } public default Vec4d asDouble() { return isMutable() ? Vec4d.mutable(x(), y(), z(), w()) : Vec4d.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4i asMutable() { return isMutable() ? this : mutable(this); } public default Vec4i asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -32,21 +32,21 @@ public class Vec4iImmutable implements Vec4i {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public int getX() { return x; } public int x() { return x; }
@Override @Override
public int getY() { return y; } public int y() { return y; }
@Override @Override
public int getZ() { return z; } public int z() { return z; }
@Override @Override
public int getW() { return w; } public int w() { return w; }
@Override @Override
public Vec4i setX(int x) { return this.x == x ? this : Vec4i.of(x, y, z, w); } public Vec4i x(int x) { return this.x == x ? this : Vec4i.of(x, y, z, w); }
@Override @Override
public Vec4i setY(int y) { return this.y == y ? this : Vec4i.of(x, y, z, w); } public Vec4i y(int y) { return this.y == y ? this : Vec4i.of(x, y, z, w); }
@Override @Override
public Vec4i setZ(int z) { return this.z == z ? this : Vec4i.of(x, y, z, w); } public Vec4i z(int z) { return this.z == z ? this : Vec4i.of(x, y, z, w); }
@Override @Override
public Vec4i setW(int w) { return this.w == w ? this : Vec4i.of(x, y, z, w); } public Vec4i w(int w) { return this.w == w ? this : Vec4i.of(x, y, z, w); }
@Override @Override
public Vec4i copy() { return Vec4i.of(this); } public Vec4i copy() { return Vec4i.of(this); }
@Override @Override
@ -58,7 +58,7 @@ public class Vec4iImmutable implements Vec4i {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4i) { if(obj instanceof Vec4i) {
Vec4i vec = (Vec4i)obj; Vec4i vec = (Vec4i)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -27,34 +27,34 @@ public class Vec4iMutable implements Vec4i {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public int getX() { return x; } public int x() { return x; }
@Override @Override
public int getY() { return y; } public int y() { return y; }
@Override @Override
public int getZ() { return z; } public int z() { return z; }
@Override @Override
public int getW() { return w; } public int w() { return w; }
@Override @Override
public Vec4i setX(int x) { public Vec4i x(int x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec4i setY(int y) { public Vec4i y(int y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec4i setZ(int z) { public Vec4i z(int z) {
this.z = z; this.z = z;
return this; return this;
} }
@Override @Override
public Vec4i setW(int w) { public Vec4i w(int w) {
this.w = w; this.w = w;
return this; return this;
} }
@ -78,7 +78,7 @@ public class Vec4iMutable implements Vec4i {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4i) { if(obj instanceof Vec4i) {
Vec4i vec = (Vec4i)obj; Vec4i vec = (Vec4i)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

View File

@ -18,91 +18,91 @@ public interface Vec2l extends Vecl {
public static Vec2l mutable() { return new Vec2lMutable(); } public static Vec2l mutable() { return new Vec2lMutable(); }
public static Vec2l mutable(long value) { return new Vec2lMutable(value); } public static Vec2l mutable(long value) { return new Vec2lMutable(value); }
public static Vec2l mutable(long x, long y) { return new Vec2lMutable(x, y); } public static Vec2l mutable(long x, long y) { return new Vec2lMutable(x, y); }
public static Vec2l mutable(Vec2l value) { return mutable(value.getX(), value.getY()); } public static Vec2l mutable(Vec2l value) { return mutable(value.x(), value.y()); }
public static Vec2l of() { return new Vec2lImmutable(); } public static Vec2l of() { return new Vec2lImmutable(); }
public static Vec2l of(long value) { return new Vec2lImmutable(value); } public static Vec2l of(long value) { return new Vec2lImmutable(value); }
public static Vec2l of(long x, long y) { return new Vec2lImmutable(x, y); } public static Vec2l of(long x, long y) { return new Vec2lImmutable(x, y); }
public static Vec2l of(Vec2l value) { return of(value.getX(), value.getY()); } public static Vec2l of(Vec2l value) { return of(value.x(), value.y()); }
public long getX(); public long x();
public long getY(); public long y();
public Vec2l setX(long x); public Vec2l x(long x);
public Vec2l setY(long y); public Vec2l y(long y);
@Override @Override
public default long[] asArray() { return new long[] {getX(), getY()}; } public default long[] asArray() { return new long[] {x(), y()}; }
@Override @Override
public Vec2l copy(); public Vec2l copy();
@Override @Override
public default Vec2l abs() { return set(Math.abs(getX()), Math.abs(getY())); } public default Vec2l abs() { return set(Math.abs(x()), Math.abs(y())); }
@Override @Override
public default Vec2l negate() { return set(0L, 0L); } public default Vec2l negate() { return set(0L, 0L); }
@Override @Override
public default Vec2l invert() { return set(-getX(), -getY()); }; public default Vec2l invert() { return set(-x(), -y()); };
@Override @Override
public default Vec2l add(long value) { return add(value, value); } public default Vec2l add(long value) { return add(value, value); }
public default Vec2l add(Vec2l value) { return add(value.getX(), value.getY()); } public default Vec2l add(Vec2l value) { return add(value.x(), value.y()); }
public default Vec2l add(long x, long y) { return set(x + getX(), y + getY()); } public default Vec2l add(long x, long y) { return set(x + x(), y + y()); }
@Override @Override
public default Vec2l sub(long value) { return sub(value, value); } public default Vec2l sub(long value) { return sub(value, value); }
public default Vec2l sub(Vec2l value) { return sub(value.getX(), value.getY()); } public default Vec2l sub(Vec2l value) { return sub(value.x(), value.y()); }
public default Vec2l sub(long x, long y) { return set(getX() - x, getY() - y); } public default Vec2l sub(long x, long y) { return set(x() - x, y() - y); }
@Override @Override
public default Vec2l multiply(long value) { return multiply(value, value); } public default Vec2l multiply(long value) { return multiply(value, value); }
public default Vec2l multiply(Vec2l value) { return multiply(value.getX(), value.getY()); } public default Vec2l multiply(Vec2l value) { return multiply(value.x(), value.y()); }
public default Vec2l multiply(long x, long y) { return set(x * getX(), y * getY()); } public default Vec2l multiply(long x, long y) { return set(x * x(), y * y()); }
@Override @Override
public default Vec2l devide(long value) { return devide(value, value); } public default Vec2l devide(long value) { return devide(value, value); }
public default Vec2l devide(Vec2l value) { return devide(value.getX(), value.getY()); } public default Vec2l devide(Vec2l value) { return devide(value.x(), value.y()); }
public default Vec2l devide(long x, long y) { return set(getX() / x, getY() / y); } public default Vec2l devide(long x, long y) { return set(x() / x, y() / y); }
@Override @Override
public default Vec2l set(long value) { return set(value, value); }; public default Vec2l set(long value) { return set(value, value); };
public default Vec2l set(Vec2l value) { return set(value.getX(), value.getY()); } public default Vec2l set(Vec2l value) { return set(value.x(), value.y()); }
public Vec2l set(long x, long y); public Vec2l set(long x, long y);
public default double distanceTo(Vec2l value) { return distanceTo(value.getX(), value.getY()); } public default double distanceTo(Vec2l value) { return distanceTo(value.x(), value.y()); }
public default double distanceTo(long x, long y) { return Math.sqrt(distanceToSquared(x, y)); } public default double distanceTo(long x, long y) { return Math.sqrt(distanceToSquared(x, y)); }
public default long distanceToSquared(Vec2l value) { return distanceToSquared(value.getX(), value.getY()); } public default long distanceToSquared(Vec2l value) { return distanceToSquared(value.x(), value.y()); }
public default long distanceToSquared(long x, long y) { public default long distanceToSquared(long x, long y) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
return (xPos * xPos) + (yPos * yPos); return (xPos * xPos) + (yPos * yPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()); } public default long lengthSquared() { return (x() * x()) + (y() * y()); }
public default long dotProduct(Vec2l value) { return dotProduct(value.getX(), value.getY()); } public default long dotProduct(Vec2l value) { return dotProduct(value.x(), value.y()); }
public default long dotProduct(long x, long y) { return (getX() * x) + (getY() * y); } public default long dotProduct(long x, long y) { return (x() * x) + (y() * y); }
public default Vec2l rotate(long angle, Vec2l center) { return rotate(angle, center.getX(), center.getY()); } public default Vec2l rotate(long angle, Vec2l center) { return rotate(angle, center.x(), center.y()); }
public default Vec2l rotate(long angle, long x, long y) { public default Vec2l rotate(long angle, long x, long y) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
double cos = MathUtils.cos(angle); double cos = MathUtils.cos(angle);
double sin = MathUtils.sin(angle); double sin = MathUtils.sin(angle);
return set((long)((xPos * cos) + (yPos * sin) + x), (long)(-(xPos * sin) + (yPos * cos) + y)); return set((long)((xPos * cos) + (yPos * sin) + x), (long)(-(xPos * sin) + (yPos * cos) + y));
} }
public default Vec2l min(Vec2l other) { return min(other, this); } public default Vec2l min(Vec2l other) { return min(other, this); }
public default Vec2l min(Vec2l other, Vec2l result) { return min(other.getX(), other.getY(), result); } public default Vec2l min(Vec2l other, Vec2l result) { return min(other.x(), other.y(), result); }
public default Vec2l min(long x, long y) { return min(x, y, this); } public default Vec2l min(long x, long y) { return min(x, y, this); }
public default Vec2l min(long x, long y, Vec2l result) { return result.set(Math.min(getX(), x), Math.min(getY(), y)); } public default Vec2l min(long x, long y, Vec2l result) { return result.set(Math.min(x(), x), Math.min(y(), y)); }
public default Vec2l max(Vec2l other) { return max(other, this); } public default Vec2l max(Vec2l other) { return max(other, this); }
public default Vec2l max(Vec2l other, Vec2l result) { return max(other.getX(), other.getY(), result); } public default Vec2l max(Vec2l other, Vec2l result) { return max(other.x(), other.y(), result); }
public default Vec2l max(long x, long y) { return max(x, y, this); } public default Vec2l max(long x, long y) { return max(x, y, this); }
public default Vec2l max(long x, long y, Vec2l result) { return result.set(Math.max(getX(), x), Math.max(getY(), y)); } public default Vec2l max(long x, long y, Vec2l result) { return result.set(Math.max(x(), x), Math.max(y(), y)); }
public default Vec2l difference(Vec2l other) { return difference(other, this); } public default Vec2l difference(Vec2l other) { return difference(other, this); }
public default Vec2l difference(Vec2l other, Vec2l result) { return difference(other.getX(), other.getY(), result); } public default Vec2l difference(Vec2l other, Vec2l result) { return difference(other.x(), other.y(), result); }
public default Vec2l difference(long x, long y) { return difference(x, y, this); } public default Vec2l difference(long x, long y) { return difference(x, y, this); }
public default Vec2l difference(long x, long y, Vec2l result) { return result.set(getX() - x, getY() - y); } public default Vec2l difference(long x, long y, Vec2l result) { return result.set(x() - x, y() - y); }
@Override @Override
public default Vec2l clamp(long min, long max) { return clamp(min, max, ALL); } public default Vec2l clamp(long min, long max) { return clamp(min, max, ALL); }
public default Vec2l clamp(long min, long max, Vec2l result) { return clamp(min, max, result, ALL); } public default Vec2l clamp(long min, long max, Vec2l result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec2l clamp(long min, long max, int filter) { return clamp(min, max, this, filter); } public default Vec2l clamp(long min, long max, int filter) { return clamp(min, max, this, filter); }
public default Vec2l clamp(long min, long max, Vec2l result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY())); } public default Vec2l clamp(long min, long max, Vec2l result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y())); }
@Override @Override
public default Vec2l store(ByteBuffer buffer) { public default Vec2l store(ByteBuffer buffer) {
buffer.putLong(getX()).putLong(getY()); buffer.putLong(x()).putLong(y());
return this; return this;
} }
@ -111,22 +111,22 @@ public interface Vec2l extends Vecl {
@Override @Override
public default Vec2l store(LongBuffer buffer) { public default Vec2l store(LongBuffer buffer) {
buffer.put(getX()).put(getY()); buffer.put(x()).put(y());
return this; return this;
} }
@Override @Override
public default Vec2l load(LongBuffer buffer) { return set(buffer.get(), buffer.get()); } public default Vec2l load(LongBuffer buffer) { return set(buffer.get(), buffer.get()); }
@Override @Override
public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)getX(), (byte)getY()) : Vec2b.of((byte)getX(), (byte)getY()); } public default Vec2b asByte() { return isMutable() ? Vec2b.mutable((byte)x(), (byte)y()) : Vec2b.of((byte)x(), (byte)y()); }
@Override @Override
public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)getX(), (short)getY()) : Vec2s.of((short)getX(), (short)getY()); } public default Vec2s asShort() { return isMutable() ? Vec2s.mutable((short)x(), (short)y()) : Vec2s.of((short)x(), (short)y()); }
@Override @Override
public default Vec2i asInt() { return isMutable() ? Vec2i.mutable((int)getX(), (int)getY()) : Vec2i.of((int)getX(), (int)getY()); } public default Vec2i asInt() { return isMutable() ? Vec2i.mutable((int)x(), (int)y()) : Vec2i.of((int)x(), (int)y()); }
@Override @Override
public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable(getX(), getY()) : Vec2f.of(getX(), getY()); } public default Vec2f asFloat() { return isMutable() ? Vec2f.mutable(x(), y()) : Vec2f.of(x(), y()); }
@Override @Override
public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(getX(), getY()) : Vec2d.of(getX(), getY()); } public default Vec2d asDouble() { return isMutable() ? Vec2d.mutable(x(), y()) : Vec2d.of(x(), y()); }
@Override @Override
public default Vec2l asMutable() { return isMutable() ? this : mutable(this); } public default Vec2l asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -24,13 +24,13 @@ public class Vec2lImmutable implements Vec2l {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public long getX() { return x; } public long x() { return x; }
@Override @Override
public long getY() { return y; } public long y() { return y; }
@Override @Override
public Vec2l setX(long x) { return this.x == x ? this : Vec2l.of(x, y); } public Vec2l x(long x) { return this.x == x ? this : Vec2l.of(x, y); }
@Override @Override
public Vec2l setY(long y) { return this.y == y ? this : Vec2l.of(x, y); } public Vec2l y(long y) { return this.y == y ? this : Vec2l.of(x, y); }
@Override @Override
public Vec2l copy() { return Vec2l.of(this); } public Vec2l copy() { return Vec2l.of(this); }
@Override @Override
@ -42,7 +42,7 @@ public class Vec2lImmutable implements Vec2l {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2l) { if(obj instanceof Vec2l) {
Vec2l vec = (Vec2l)obj; Vec2l vec = (Vec2l)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -21,18 +21,18 @@ public class Vec2lMutable implements Vec2l {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public long getX() { return x; } public long x() { return x; }
@Override @Override
public long getY() { return y; } public long y() { return y; }
@Override @Override
public Vec2l setX(long x) { public Vec2l x(long x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec2l setY(long y) { public Vec2l y(long y) {
this.y = y; this.y = y;
return this; return this;
} }
@ -54,7 +54,7 @@ public class Vec2lMutable implements Vec2l {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec2l) { if(obj instanceof Vec2l) {
Vec2l vec = (Vec2l)obj; Vec2l vec = (Vec2l)obj;
return vec.getX() == x && vec.getY() == y; return vec.x() == x && vec.y() == y;
} }
return false; return false;
} }

View File

@ -18,85 +18,85 @@ public interface Vec3l extends Vecl {
public static Vec3l mutable() { return new Vec3lMutable(); } public static Vec3l mutable() { return new Vec3lMutable(); }
public static Vec3l mutable(long value) { return new Vec3lMutable(value); } public static Vec3l mutable(long value) { return new Vec3lMutable(value); }
public static Vec3l mutable(long x, long y, long z) { return new Vec3lMutable(x, y, z); } public static Vec3l mutable(long x, long y, long z) { return new Vec3lMutable(x, y, z); }
public static Vec3l mutable(Vec3l vec) { return mutable(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3l mutable(Vec3l vec) { return mutable(vec.x(), vec.y(), vec.z()); }
public static Vec3l of() { return new Vec3lImmutable(); } public static Vec3l of() { return new Vec3lImmutable(); }
public static Vec3l of(long value) { return new Vec3lImmutable(value); } public static Vec3l of(long value) { return new Vec3lImmutable(value); }
public static Vec3l of(long x, long y, long z) { return new Vec3lImmutable(x, y, z); } public static Vec3l of(long x, long y, long z) { return new Vec3lImmutable(x, y, z); }
public static Vec3l of(Vec3l vec) { return of(vec.getX(), vec.getY(), vec.getZ()); } public static Vec3l of(Vec3l vec) { return of(vec.x(), vec.y(), vec.z()); }
public long getX(); public long x();
public long getY(); public long y();
public long getZ(); public long z();
public Vec3l setX(long x); public Vec3l x(long x);
public Vec3l setY(long y); public Vec3l y(long y);
public Vec3l setZ(long z); public Vec3l z(long z);
@Override @Override
public default long[] asArray() { return new long[] {getX(), getY(), getZ()}; } public default long[] asArray() { return new long[] {x(), y(), z()}; }
@Override @Override
public Vec3l copy(); public Vec3l copy();
@Override @Override
public default Vec3l abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ())); } public default Vec3l abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z())); }
@Override @Override
public default Vec3l negate() { return set(0L, 0L, 0L); } public default Vec3l negate() { return set(0L, 0L, 0L); }
@Override @Override
public default Vec3l invert() { return set(-getX(), -getY(), -getZ()); } public default Vec3l invert() { return set(-x(), -y(), -z()); }
@Override @Override
public default Vec3l add(long value) { return add(value, value, value); } public default Vec3l add(long value) { return add(value, value, value); }
public default Vec3l add(Vec3l value) { return add(value.getX(), value.getY(), value.getZ()); } public default Vec3l add(Vec3l value) { return add(value.x(), value.y(), value.z()); }
public default Vec3l add(long x, long y, long z) { return set(getX() + x, getY() + y, getZ() + z); } public default Vec3l add(long x, long y, long z) { return set(x() + x, y() + y, z() + z); }
@Override @Override
public default Vec3l sub(long value) { return sub(value, value, value); } public default Vec3l sub(long value) { return sub(value, value, value); }
public default Vec3l sub(Vec3l value) { return sub(value.getX(), value.getY(), value.getZ()); } public default Vec3l sub(Vec3l value) { return sub(value.x(), value.y(), value.z()); }
public default Vec3l sub(long x, long y, long z) { return set(getX() - x, getY() - y, getZ() - z); } public default Vec3l sub(long x, long y, long z) { return set(x() - x, y() - y, z() - z); }
@Override @Override
public default Vec3l multiply(long value) { return multiply(value, value, value); } public default Vec3l multiply(long value) { return multiply(value, value, value); }
public default Vec3l multiply(Vec3l value) { return multiply(value.getX(), value.getY(), value.getZ()); } public default Vec3l multiply(Vec3l value) { return multiply(value.x(), value.y(), value.z()); }
public default Vec3l multiply(long x, long y, long z) { return set(getX() * x, getY() * y, getZ() * z); } public default Vec3l multiply(long x, long y, long z) { return set(x() * x, y() * y, z() * z); }
@Override @Override
public default Vec3l devide(long value) { return devide(value, value, value); } public default Vec3l devide(long value) { return devide(value, value, value); }
public default Vec3l devide(Vec3l value) { return devide(value.getX(), value.getY(), value.getZ()); } public default Vec3l devide(Vec3l value) { return devide(value.x(), value.y(), value.z()); }
public default Vec3l devide(long x, long y, long z) { return set(getX() / x, getY() / y, getZ() / z); } public default Vec3l devide(long x, long y, long z) { return set(x() / x, y() / y, z() / z); }
@Override @Override
public default Vec3l set(long value) { return set(value, value, value); } public default Vec3l set(long value) { return set(value, value, value); }
public default Vec3l set(Vec3l value) { return set(value.getX(), value.getY(), value.getZ()); } public default Vec3l set(Vec3l value) { return set(value.x(), value.y(), value.z()); }
public Vec3l set(long x, long y, long z); public Vec3l set(long x, long y, long z);
public default double distanceTo(Vec3l value) { return distanceTo(value.getX(), value.getY(), value.getZ()); } public default double distanceTo(Vec3l value) { return distanceTo(value.x(), value.y(), value.z()); }
public default double distanceTo(long x, long y, long z) { return Math.sqrt(distanceToSquared(x, y, z)); } public default double distanceTo(long x, long y, long z) { return Math.sqrt(distanceToSquared(x, y, z)); }
public default long distanceToSquared(Vec3l value) { return distanceToSquared(value.getX(), value.getY(), value.getZ()); } public default long distanceToSquared(Vec3l value) { return distanceToSquared(value.x(), value.y(), value.z()); }
public default long distanceToSquared(long x, long y, long z) { public default long distanceToSquared(long x, long y, long z) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
long zPos = getZ() - z; long zPos = z() - z;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()); } public default long lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()); }
public default long dotProduct(Vec3l value) { return dotProduct(value.getX(), value.getY(), value.getZ()); } public default long dotProduct(Vec3l value) { return dotProduct(value.x(), value.y(), value.z()); }
public default long dotProduct(long x, long y, long z) { return (getX() * x) + (getY() * y) + (getZ() * z); } public default long dotProduct(long x, long y, long z) { return (x() * x) + (y() * y) + (z() * z); }
public default Vec3l min(Vec3l other) { return min(other, this); } public default Vec3l min(Vec3l other) { return min(other, this); }
public default Vec3l min(Vec3l other, Vec3l result) { return min(other.getX(), other.getY(), other.getZ(), result); } public default Vec3l min(Vec3l other, Vec3l result) { return min(other.x(), other.y(), other.z(), result); }
public default Vec3l min(long x, long y, long z) { return min(x, y, z, this); } public default Vec3l min(long x, long y, long z) { return min(x, y, z, this); }
public default Vec3l min(long x, long y, long z, Vec3l result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z)); } public default Vec3l min(long x, long y, long z, Vec3l result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z)); }
public default Vec3l max(Vec3l other) { return max(other, this); } public default Vec3l max(Vec3l other) { return max(other, this); }
public default Vec3l max(Vec3l other, Vec3l result) { return max(other.getX(), other.getY(), other.getZ(), result); } public default Vec3l max(Vec3l other, Vec3l result) { return max(other.x(), other.y(), other.z(), result); }
public default Vec3l max(long x, long y, long z) { return max(x, y, z, this); } public default Vec3l max(long x, long y, long z) { return max(x, y, z, this); }
public default Vec3l max(long x, long y, long z, Vec3l result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z)); } public default Vec3l max(long x, long y, long z, Vec3l result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z)); }
public default Vec3l difference(Vec3l other) { return difference(other, this); } public default Vec3l difference(Vec3l other) { return difference(other, this); }
public default Vec3l difference(Vec3l other, Vec3l result) { return difference(other.getX(), other.getY(), other.getZ(), result); } public default Vec3l difference(Vec3l other, Vec3l result) { return difference(other.x(), other.y(), other.z(), result); }
public default Vec3l difference(long x, long y, long z) { return difference(x, y, z, this); } public default Vec3l difference(long x, long y, long z) { return difference(x, y, z, this); }
public default Vec3l difference(long x, long y, long z, Vec3l result) { return result.set(getX() - x, getY() - y, getZ() - z); } public default Vec3l difference(long x, long y, long z, Vec3l result) { return result.set(x() - x, y() - y, z() - z); }
@Override @Override
public default Vec3l clamp(long min, long max) { return clamp(min, max, ALL); } public default Vec3l clamp(long min, long max) { return clamp(min, max, ALL); }
public default Vec3l clamp(long min, long max, Vec3l result) { return clamp(min, max, result, ALL); } public default Vec3l clamp(long min, long max, Vec3l result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec3l clamp(long min, long max, int filter) { return clamp(min, max, this, filter); } public default Vec3l clamp(long min, long max, int filter) { return clamp(min, max, this, filter); }
public default Vec3l clamp(long min, long max, Vec3l result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ())); } public default Vec3l clamp(long min, long max, Vec3l result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z())); }
@Override @Override
public default Vec3l store(ByteBuffer buffer) { public default Vec3l store(ByteBuffer buffer) {
buffer.putLong(getX()).putLong(getY()).putLong(getZ()); buffer.putLong(x()).putLong(y()).putLong(z());
return this; return this;
} }
@ -105,22 +105,22 @@ public interface Vec3l extends Vecl {
@Override @Override
public default Vec3l store(LongBuffer buffer) { public default Vec3l store(LongBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()); buffer.put(x()).put(y()).put(z());
return this; return this;
} }
@Override @Override
public default Vec3l load(LongBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); } public default Vec3l load(LongBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)getX(), (byte)getY(), (byte)getZ()) : Vec3b.of((byte)getX(), (byte)getY(), (byte)getZ()); } public default Vec3b asByte() { return isMutable() ? Vec3b.mutable((byte)x(), (byte)y(), (byte)z()) : Vec3b.of((byte)x(), (byte)y(), (byte)z()); }
@Override @Override
public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)getX(), (short)getY(), (short)getZ()) : Vec3s.of((short)getX(), (short)getY(), (short)getZ()); } public default Vec3s asShort() { return isMutable() ? Vec3s.mutable((short)x(), (short)y(), (short)z()) : Vec3s.of((short)x(), (short)y(), (short)z()); }
@Override @Override
public default Vec3i asInt() { return isMutable() ? Vec3i.mutable((int)getX(), (int)getY(), (int)getZ()) : Vec3i.of((int)getX(), (int)getY(), (int)getZ()); } public default Vec3i asInt() { return isMutable() ? Vec3i.mutable((int)x(), (int)y(), (int)z()) : Vec3i.of((int)x(), (int)y(), (int)z()); }
@Override @Override
public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable(getX(), getY(), getZ()) : Vec3f.of(getX(), getY(), getZ()); } public default Vec3f asFloat() { return isMutable() ? Vec3f.mutable(x(), y(), z()) : Vec3f.of(x(), y(), z()); }
@Override @Override
public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(getX(), getY(), getZ()) : Vec3d.of(getX(), getY(), getZ()); } public default Vec3d asDouble() { return isMutable() ? Vec3d.mutable(x(), y(), z()) : Vec3d.of(x(), y(), z()); }
@Override @Override
public default Vec3l asMutable() { return isMutable() ? this : mutable(this); } public default Vec3l asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -28,17 +28,17 @@ public class Vec3lImmutable implements Vec3l {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public long getX() { return x; } public long x() { return x; }
@Override @Override
public long getY() { return y; } public long y() { return y; }
@Override @Override
public long getZ() { return z; } public long z() { return z; }
@Override @Override
public Vec3l setX(long x) { return this.x == x ? this : Vec3l.of(x, y, z); } public Vec3l x(long x) { return this.x == x ? this : Vec3l.of(x, y, z); }
@Override @Override
public Vec3l setY(long y) { return this.y == y ? this : Vec3l.of(x, y, z); } public Vec3l y(long y) { return this.y == y ? this : Vec3l.of(x, y, z); }
@Override @Override
public Vec3l setZ(long z) { return this.z == z ? this : Vec3l.of(x, y, z); } public Vec3l z(long z) { return this.z == z ? this : Vec3l.of(x, y, z); }
@Override @Override
public Vec3l copy() { return Vec3l.of(this); } public Vec3l copy() { return Vec3l.of(this); }
@Override @Override
@ -50,7 +50,7 @@ public class Vec3lImmutable implements Vec3l {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3l) { if(obj instanceof Vec3l) {
Vec3l vec = (Vec3l)obj; Vec3l vec = (Vec3l)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -24,26 +24,26 @@ public class Vec3lMutable implements Vec3l {
@Override @Override
public boolean isMutable() { return true; } public boolean isMutable() { return true; }
@Override @Override
public long getX() { return x; } public long x() { return x; }
@Override @Override
public long getY() { return y; } public long y() { return y; }
@Override @Override
public long getZ() { return z; } public long z() { return z; }
@Override @Override
public Vec3l setX(long x) { public Vec3l x(long x) {
this.x = x; this.x = x;
return this; return this;
} }
@Override @Override
public Vec3l setY(long y) { public Vec3l y(long y) {
this.y = y; this.y = y;
return this; return this;
} }
@Override @Override
public Vec3l setZ(long z) { public Vec3l z(long z) {
this.z = z; this.z = z;
return this; return this;
} }
@ -66,7 +66,7 @@ public class Vec3lMutable implements Vec3l {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec3l) { if(obj instanceof Vec3l) {
Vec3l vec = (Vec3l)obj; Vec3l vec = (Vec3l)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z; return vec.x() == x && vec.y() == y && vec.z() == z;
} }
return false; return false;
} }

View File

@ -18,88 +18,88 @@ public interface Vec4l extends Vecl {
public static Vec4l mutable() { return new Vec4lMutable(); } public static Vec4l mutable() { return new Vec4lMutable(); }
public static Vec4l mutable(long value) { return new Vec4lMutable(value); } public static Vec4l mutable(long value) { return new Vec4lMutable(value); }
public static Vec4l mutable(long x, long y, long z, long w) { return new Vec4lMutable(x, y, z, w); } public static Vec4l mutable(long x, long y, long z, long w) { return new Vec4lMutable(x, y, z, w); }
public static Vec4l mutable(Vec4l vec) { return mutable(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4l mutable(Vec4l vec) { return mutable(vec.x(), vec.y(), vec.z(), vec.w()); }
public static Vec4l of() { return new Vec4lImmutable(); } public static Vec4l of() { return new Vec4lImmutable(); }
public static Vec4l of(long value) { return new Vec4lImmutable(value); } public static Vec4l of(long value) { return new Vec4lImmutable(value); }
public static Vec4l of(long x, long y, long z, long w) { return new Vec4lImmutable(x, y, z, w); } public static Vec4l of(long x, long y, long z, long w) { return new Vec4lImmutable(x, y, z, w); }
public static Vec4l of(Vec4l vec) { return of(vec.getX(), vec.getY(), vec.getZ(), vec.getW()); } public static Vec4l of(Vec4l vec) { return of(vec.x(), vec.y(), vec.z(), vec.w()); }
public long getX(); public long x();
public long getY(); public long y();
public long getZ(); public long z();
public long getW(); public long w();
public Vec4l setX(long x); public Vec4l x(long x);
public Vec4l setY(long y); public Vec4l y(long y);
public Vec4l setZ(long z); public Vec4l z(long z);
public Vec4l setW(long w); public Vec4l w(long w);
@Override @Override
public default long[] asArray() { return new long[] {getX(), getY(), getZ(), getW()}; } public default long[] asArray() { return new long[] {x(), y(), z(), w()}; }
@Override @Override
public Vec4l copy(); public Vec4l copy();
@Override @Override
public default Vec4l abs() { return set(Math.abs(getX()), Math.abs(getY()), Math.abs(getZ()), Math.abs(getW())); } public default Vec4l abs() { return set(Math.abs(x()), Math.abs(y()), Math.abs(z()), Math.abs(w())); }
@Override @Override
public default Vec4l negate() { return set(0L, 0L, 0L, 0L); } public default Vec4l negate() { return set(0L, 0L, 0L, 0L); }
@Override @Override
public default Vec4l invert() { return set(-getX(), -getY(), -getZ(), -getW()); } public default Vec4l invert() { return set(-x(), -y(), -z(), -w()); }
@Override @Override
public default Vec4l add(long value) { return add(value, value, value, value); } public default Vec4l add(long value) { return add(value, value, value, value); }
public default Vec4l add(Vec4l value) { return add(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4l add(Vec4l value) { return add(value.x(), value.y(), value.z(), value.w()); }
public default Vec4l add(long x, long y, long z, long w) { return set(getX() + x, getY() + y, getZ() + z, getW() + w); } public default Vec4l add(long x, long y, long z, long w) { return set(x() + x, y() + y, z() + z, w() + w); }
@Override @Override
public default Vec4l sub(long value) { return sub(value, value, value, value); } public default Vec4l sub(long value) { return sub(value, value, value, value); }
public default Vec4l sub(Vec4l value) { return sub(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4l sub(Vec4l value) { return sub(value.x(), value.y(), value.z(), value.w()); }
public default Vec4l sub(long x, long y, long z, long w) { return set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4l sub(long x, long y, long z, long w) { return set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4l multiply(long value) { return multiply(value, value, value, value); } public default Vec4l multiply(long value) { return multiply(value, value, value, value); }
public default Vec4l multiply(Vec4l value) { return multiply(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4l multiply(Vec4l value) { return multiply(value.x(), value.y(), value.z(), value.w()); }
public default Vec4l multiply(long x, long y, long z, long w) { return set(getX() * x, getY() * y, getZ() * z, getW() * w); } public default Vec4l multiply(long x, long y, long z, long w) { return set(x() * x, y() * y, z() * z, w() * w); }
@Override @Override
public default Vec4l devide(long value) { return devide(value, value, value, value); } public default Vec4l devide(long value) { return devide(value, value, value, value); }
public default Vec4l devide(Vec4l value) { return devide(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4l devide(Vec4l value) { return devide(value.x(), value.y(), value.z(), value.w()); }
public default Vec4l devide(long x, long y, long z, long w) { return set(getX() / x, getY() / y, getZ() / z, getW() / w); } public default Vec4l devide(long x, long y, long z, long w) { return set(x() / x, y() / y, z() / z, w() / w); }
@Override @Override
public default Vec4l set(long value) { return set(value, value, value, value); } public default Vec4l set(long value) { return set(value, value, value, value); }
public default Vec4l set(Vec4l value) { return set(value.getX(), value.getY(), value.getZ(), value.getW()); } public default Vec4l set(Vec4l value) { return set(value.x(), value.y(), value.z(), value.w()); }
public Vec4l set(long x, long y, long z, long w); public Vec4l set(long x, long y, long z, long w);
public default double distanceTo(Vec4l value) { return distanceTo(value.getX(), value.getY(), value.getZ(), value.getW()); } public default double distanceTo(Vec4l value) { return distanceTo(value.x(), value.y(), value.z(), value.w()); }
public default double distanceTo(long x, long y, long z, long w) { return Math.sqrt(distanceTo(x, y, z, w)); } public default double distanceTo(long x, long y, long z, long w) { return Math.sqrt(distanceTo(x, y, z, w)); }
public default long distanceToSquared(Vec4l value) { return distanceToSquared(value.getX(), value.getY(), value.getZ(), value.getW()); } public default long distanceToSquared(Vec4l value) { return distanceToSquared(value.x(), value.y(), value.z(), value.w()); }
public default long distanceToSquared(long x, long y, long z, long w) { public default long distanceToSquared(long x, long y, long z, long w) {
long xPos = getX() - x; long xPos = x() - x;
long yPos = getY() - y; long yPos = y() - y;
long zPos = getZ() - z; long zPos = z() - z;
long wPos = getW() - w; long wPos = w() - w;
return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos); return (xPos * xPos) + (yPos * yPos) + (zPos * zPos) + (wPos * wPos);
} }
@Override @Override
public default long lengthSquared() { return (getX() * getX()) + (getY() * getY()) + (getZ() * getZ()) + (getW() * getW()); } public default long lengthSquared() { return (x() * x()) + (y() * y()) + (z() * z()) + (w() * w()); }
public default long dotProduct(Vec4l value) { return dotProduct(value.getX(), value.getY(), value.getZ(), value.getW()); } public default long dotProduct(Vec4l value) { return dotProduct(value.x(), value.y(), value.z(), value.w()); }
public default long dotProduct(long x, long y, long z, long w) { return (getX() * x) + (getY() * y) + (getZ() * z) + (getW() * w); }; public default long dotProduct(long x, long y, long z, long w) { return (x() * x) + (y() * y) + (z() * z) + (w() * w); };
public default Vec4l min(Vec4l other) { return min(other, this); } public default Vec4l min(Vec4l other) { return min(other, this); }
public default Vec4l min(Vec4l other, Vec4l result) { return min(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4l min(Vec4l other, Vec4l result) { return min(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4l min(long x, long y, long z, long w) { return min(x, y, z, w, this); } public default Vec4l min(long x, long y, long z, long w) { return min(x, y, z, w, this); }
public default Vec4l min(long x, long y, long z, long w, Vec4l result) { return result.set(Math.min(getX(), x), Math.min(getY(), y), Math.min(getZ(), z), Math.min(getW(), w)); } public default Vec4l min(long x, long y, long z, long w, Vec4l result) { return result.set(Math.min(x(), x), Math.min(y(), y), Math.min(z(), z), Math.min(w(), w)); }
public default Vec4l max(Vec4l other) { return max(other, this); } public default Vec4l max(Vec4l other) { return max(other, this); }
public default Vec4l max(Vec4l other, Vec4l result) { return max(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4l max(Vec4l other, Vec4l result) { return max(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4l max(long x, long y, long z, long w) { return max(x, y, z, w, this); } public default Vec4l max(long x, long y, long z, long w) { return max(x, y, z, w, this); }
public default Vec4l max(long x, long y, long z, long w, Vec4l result) { return result.set(Math.max(getX(), x), Math.max(getY(), y), Math.max(getZ(), z), Math.max(getZ(), z)); } public default Vec4l max(long x, long y, long z, long w, Vec4l result) { return result.set(Math.max(x(), x), Math.max(y(), y), Math.max(z(), z), Math.max(z(), z)); }
public default Vec4l difference(Vec4l other) { return difference(other, this); } public default Vec4l difference(Vec4l other) { return difference(other, this); }
public default Vec4l difference(Vec4l other, Vec4l result) { return difference(other.getX(), other.getY(), other.getZ(), other.getW(), result); } public default Vec4l difference(Vec4l other, Vec4l result) { return difference(other.x(), other.y(), other.z(), other.w(), result); }
public default Vec4l difference(long x, long y, long z, long w) { return difference(x, y, z, w, this); } public default Vec4l difference(long x, long y, long z, long w) { return difference(x, y, z, w, this); }
public default Vec4l difference(long x, long y, long z, long w, Vec4l result) { return result.set(getX() - x, getY() - y, getZ() - z, getW() - w); } public default Vec4l difference(long x, long y, long z, long w, Vec4l result) { return result.set(x() - x, y() - y, z() - z, w() - w); }
@Override @Override
public default Vec4l clamp(long min, long max) { return clamp(min, max, ALL); } public default Vec4l clamp(long min, long max) { return clamp(min, max, ALL); }
public default Vec4l clamp(long min, long max, Vec4l result) { return clamp(min, max, result, ALL); } public default Vec4l clamp(long min, long max, Vec4l result) { return clamp(min, max, result, ALL); }
@Override @Override
public default Vec4l clamp(long min, long max, int filter) { return clamp(min, max, this, filter); } public default Vec4l clamp(long min, long max, int filter) { return clamp(min, max, this, filter); }
public default Vec4l clamp(long min, long max, Vec4l result, int filter) { return result.set((filter & X) == 0 ? getX() : MathUtils.clamp(min, max, getX()), (filter & Y) == 0 ? getY() : MathUtils.clamp(min, max, getY()), (filter & Z) == 0 ? getZ() : MathUtils.clamp(min, max, getZ()), (filter & W) == 0 ? getW() : MathUtils.clamp(min, max, getW())); } public default Vec4l clamp(long min, long max, Vec4l result, int filter) { return result.set((filter & X) == 0 ? x() : MathUtils.clamp(min, max, x()), (filter & Y) == 0 ? y() : MathUtils.clamp(min, max, y()), (filter & Z) == 0 ? z() : MathUtils.clamp(min, max, z()), (filter & W) == 0 ? w() : MathUtils.clamp(min, max, w())); }
@Override @Override
public default Vec4l store(ByteBuffer buffer) { public default Vec4l store(ByteBuffer buffer) {
buffer.putLong(getX()).putLong(getY()).putLong(getZ()).putLong(getW()); buffer.putLong(x()).putLong(y()).putLong(z()).putLong(w());
return this; return this;
} }
@ -108,22 +108,22 @@ public interface Vec4l extends Vecl {
@Override @Override
public default Vec4l store(LongBuffer buffer) { public default Vec4l store(LongBuffer buffer) {
buffer.put(getX()).put(getY()).put(getZ()).put(getW()); buffer.put(x()).put(y()).put(z()).put(w());
return this; return this;
} }
@Override @Override
public default Vec4l load(LongBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); } public default Vec4l load(LongBuffer buffer) { return set(buffer.get(), buffer.get(), buffer.get(), buffer.get()); }
@Override @Override
public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)getX(), (byte)getY(), (byte)getZ(), (byte)getW()) : Vec4b.of((byte)getX(), (byte)getY(), (byte)getZ(), (byte)getW()); } public default Vec4b asByte() { return isMutable() ? Vec4b.mutable((byte)x(), (byte)y(), (byte)z(), (byte)w()) : Vec4b.of((byte)x(), (byte)y(), (byte)z(), (byte)w()); }
@Override @Override
public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)getX(), (short)getY(), (short)getZ(), (short)getW()) : Vec4s.of((short)getX(), (short)getY(), (short)getZ(), (short)getW()); } public default Vec4s asShort() { return isMutable() ? Vec4s.mutable((short)x(), (short)y(), (short)z(), (short)w()) : Vec4s.of((short)x(), (short)y(), (short)z(), (short)w()); }
@Override @Override
public default Vec4i asInt() { return isMutable() ? Vec4i.mutable((int)getX(), (int)getY(), (int)getZ(), (int)getW()) : Vec4i.of((int)getX(), (int)getY(), (int)getZ(), (int)getW()); } public default Vec4i asInt() { return isMutable() ? Vec4i.mutable((int)x(), (int)y(), (int)z(), (int)w()) : Vec4i.of((int)x(), (int)y(), (int)z(), (int)w()); }
@Override @Override
public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable(getX(), getY(), getZ(), getW()) : Vec4f.of(getX(), getY(), getZ(), getW()); } public default Vec4f asFloat() { return isMutable() ? Vec4f.mutable(x(), y(), z(), w()) : Vec4f.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4d asDouble() { return isMutable() ? Vec4d.mutable(getX(), getY(), getZ(), getW()) : Vec4d.of(getX(), getY(), getZ(), getW()); } public default Vec4d asDouble() { return isMutable() ? Vec4d.mutable(x(), y(), z(), w()) : Vec4d.of(x(), y(), z(), w()); }
@Override @Override
public default Vec4l asMutable() { return isMutable() ? this : mutable(this); } public default Vec4l asMutable() { return isMutable() ? this : mutable(this); }
@Override @Override

View File

@ -32,21 +32,21 @@ public class Vec4lImmutable implements Vec4l {
@Override @Override
public boolean isMutable() { return false; } public boolean isMutable() { return false; }
@Override @Override
public long getX() { return x; } public long x() { return x; }
@Override @Override
public long getY() { return y; } public long y() { return y; }
@Override @Override
public long getZ() { return z; } public long z() { return z; }
@Override @Override
public long getW() { return w; } public long w() { return w; }
@Override @Override
public Vec4l setX(long x) { return this.x == x ? this : Vec4l.of(x, y, z, w); } public Vec4l x(long x) { return this.x == x ? this : Vec4l.of(x, y, z, w); }
@Override @Override
public Vec4l setY(long y) { return this.y == y ? this : Vec4l.of(x, y, z, w); } public Vec4l y(long y) { return this.y == y ? this : Vec4l.of(x, y, z, w); }
@Override @Override
public Vec4l setZ(long z) { return this.z == z ? this : Vec4l.of(x, y, z, w); } public Vec4l z(long z) { return this.z == z ? this : Vec4l.of(x, y, z, w); }
@Override @Override
public Vec4l setW(long w) { return this.w == w ? this : Vec4l.of(x, y, z, w); } public Vec4l w(long w) { return this.w == w ? this : Vec4l.of(x, y, z, w); }
@Override @Override
public Vec4l copy() { return Vec4l.of(this); } public Vec4l copy() { return Vec4l.of(this); }
@Override @Override
@ -58,7 +58,7 @@ public class Vec4lImmutable implements Vec4l {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if(obj instanceof Vec4l) { if(obj instanceof Vec4l) {
Vec4l vec = (Vec4l)obj; Vec4l vec = (Vec4l)obj;
return vec.getX() == x && vec.getY() == y && vec.getZ() == z && vec.getW() == w; return vec.x() == x && vec.y() == y && vec.z() == z && vec.w() == w;
} }
return false; return false;
} }

Some files were not shown because too many files have changed in this diff Show More