Skip to content

Commit e2241ec

Browse files
committed
Fix Bugs In Vehicle And Ragdoll Classes
1 parent c909509 commit e2241ec

13 files changed

Lines changed: 167 additions & 264 deletions

src/main/java/volucris/bindings/jolt/ragdoll/RagdollSettings.java

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,9 @@ public static MemorySegment getSkeleton(
120120
* Typed method of {@link #getSkeleton}.
121121
*/
122122
public final @Nullable Skeleton getSkeleton(
123-
RagdollSettings character
124123
) {
125124
MemorySegment segment = getSkeleton(
126-
character.memorySegment()
125+
this.segment
127126
);
128127

129128
if (segment.equals(MemorySegment.NULL))
@@ -151,11 +150,10 @@ public static void setSkeleton(
151150
* Typed method of {@link #setSkeleton}.
152151
*/
153152
public final void setSkeleton(
154-
RagdollSettings character,
155153
Skeleton skeleton
156154
) {
157155
setSkeleton(
158-
character.memorySegment(),
156+
this.segment,
159157
skeleton.memorySegment()
160158
);
161159
}
@@ -177,10 +175,9 @@ public static boolean stabilize(
177175
* Typed method of {@link #stabilize}.
178176
*/
179177
public final boolean stabilize(
180-
RagdollSettings settings
181178
) {
182179
return (boolean) stabilize(
183-
settings.memorySegment()
180+
this.segment
184181
);
185182
}
186183

@@ -205,12 +202,11 @@ public static void disableParentChildCollisions(
205202
* Typed method of {@link #disableParentChildCollisions}.
206203
*/
207204
public final void disableParentChildCollisions(
208-
RagdollSettings settings,
209205
Mat4 jointMatrices,
210206
float minSeparationDistance
211207
) {
212208
disableParentChildCollisions(
213-
settings.memorySegment(),
209+
this.segment,
214210
jointMatrices.memorySegment(),
215211
minSeparationDistance
216212
);
@@ -233,10 +229,9 @@ public static void calculateBodyIndexToConstraintIndex(
233229
* Typed method of {@link #calculateBodyIndexToConstraintIndex}.
234230
*/
235231
public final void calculateBodyIndexToConstraintIndex(
236-
RagdollSettings settings
237232
) {
238233
calculateBodyIndexToConstraintIndex(
239-
settings.memorySegment()
234+
this.segment
240235
);
241236
}
242237

@@ -259,11 +254,10 @@ public static int getConstraintIndexForBodyIndex(
259254
* Typed method of {@link #getConstraintIndexForBodyIndex}.
260255
*/
261256
public final int getConstraintIndexForBodyIndex(
262-
RagdollSettings settings,
263257
int bodyIndex
264258
) {
265259
return (int) getConstraintIndexForBodyIndex(
266-
settings.memorySegment(),
260+
this.segment,
267261
bodyIndex
268262
);
269263
}
@@ -285,10 +279,9 @@ public static void calculateConstraintIndexToBodyIdxPair(
285279
* Typed method of {@link #calculateConstraintIndexToBodyIdxPair}.
286280
*/
287281
public final void calculateConstraintIndexToBodyIdxPair(
288-
RagdollSettings settings
289282
) {
290283
calculateConstraintIndexToBodyIdxPair(
291-
settings.memorySegment()
284+
this.segment
292285
);
293286
}
294287

@@ -311,11 +304,10 @@ public static void resizeParts(
311304
* Typed method of {@link #resizeParts}.
312305
*/
313306
public final void resizeParts(
314-
RagdollSettings settings,
315307
int count
316308
) {
317309
resizeParts(
318-
settings.memorySegment(),
310+
this.segment,
319311
count
320312
);
321313
}
@@ -337,10 +329,9 @@ public static int getPartCount(
337329
* Typed method of {@link #getPartCount}.
338330
*/
339331
public final int getPartCount(
340-
RagdollSettings settings
341332
) {
342333
return (int) getPartCount(
343-
settings.memorySegment()
334+
this.segment
344335
);
345336
}
346337

@@ -365,12 +356,11 @@ public static void setPartShape(
365356
* Typed method of {@link #setPartShape}.
366357
*/
367358
public final void setPartShape(
368-
RagdollSettings settings,
369359
int partIndex,
370360
Shape shape
371361
) {
372362
setPartShape(
373-
settings.memorySegment(),
363+
this.segment,
374364
partIndex,
375365
shape.memorySegment()
376366
);
@@ -397,12 +387,11 @@ public static void setPartPosition(
397387
* Typed method of {@link #setPartPosition}.
398388
*/
399389
public final void setPartPosition(
400-
RagdollSettings settings,
401390
int partIndex,
402391
Vec3 position
403392
) {
404393
setPartPosition(
405-
settings.memorySegment(),
394+
this.segment,
406395
partIndex,
407396
position.memorySegment()
408397
);
@@ -429,12 +418,11 @@ public static void setPartRotation(
429418
* Typed method of {@link #setPartRotation}.
430419
*/
431420
public final void setPartRotation(
432-
RagdollSettings settings,
433421
int partIndex,
434422
Quat rotation
435423
) {
436424
setPartRotation(
437-
settings.memorySegment(),
425+
this.segment,
438426
partIndex,
439427
rotation.memorySegment()
440428
);
@@ -461,12 +449,11 @@ public static void setPartMotionType(
461449
* Typed method of {@link #setPartMotionType}.
462450
*/
463451
public final void setPartMotionType(
464-
RagdollSettings settings,
465452
int partIndex,
466453
int motionType
467454
) {
468455
setPartMotionType(
469-
settings.memorySegment(),
456+
this.segment,
470457
partIndex,
471458
motionType
472459
);
@@ -493,12 +480,11 @@ public static void setPartObjectLayer(
493480
* Typed method of {@link #setPartObjectLayer}.
494481
*/
495482
public final void setPartObjectLayer(
496-
RagdollSettings settings,
497483
int partIndex,
498484
int layer
499485
) {
500486
setPartObjectLayer(
501-
settings.memorySegment(),
487+
this.segment,
502488
partIndex,
503489
layer
504490
);
@@ -525,12 +511,11 @@ public static void setPartMassProperties(
525511
* Typed method of {@link #setPartMassProperties}.
526512
*/
527513
public final void setPartMassProperties(
528-
RagdollSettings settings,
529514
int partIndex,
530515
float mass
531516
) {
532517
setPartMassProperties(
533-
settings.memorySegment(),
518+
this.segment,
534519
partIndex,
535520
mass
536521
);
@@ -557,12 +542,11 @@ public static void setPartToParent(
557542
* Typed method of {@link #setPartToParent}.
558543
*/
559544
public final void setPartToParent(
560-
RagdollSettings settings,
561545
int partIndex,
562546
SwingTwistConstraintSettings constraintSettings
563547
) {
564548
setPartToParent(
565-
settings.memorySegment(),
549+
this.segment,
566550
partIndex,
567551
constraintSettings.memorySegment()
568552
);
@@ -591,13 +575,12 @@ public static MemorySegment createRagdoll(
591575
* Typed method of {@link #createRagdoll}.
592576
*/
593577
public final @Nullable Ragdoll createRagdoll(
594-
RagdollSettings settings,
595578
PhysicsSystem system,
596579
int collisionGroup,
597580
long userData
598581
) {
599582
MemorySegment segment = createRagdoll(
600-
settings.memorySegment(),
583+
this.segment,
601584
system.memorySegment(),
602585
collisionGroup,
603586
userData

0 commit comments

Comments
 (0)