Skip to content

Commit a81e709

Browse files
committed
Update to latest Rapier fork
1 parent c17017d commit a81e709

6 files changed

Lines changed: 14 additions & 75 deletions

File tree

common/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ def compileRustTaskName = { target ->
108108

109109
def commandLineForTarget(target) {
110110
if (target.triple.contains('msvc')) {
111-
[project.ext.xWinCargo, 'xwin', 'build', '--release', '--target', target.triple].flatten()
111+
[project.ext.xWinCargo, 'xwin', 'build', '--target', target.triple].flatten()
112112
// support meme platforms, this does nothing by default because the target is disabled
113113
} else if (target.triple == 'aarch64-unknown-freebsd') {
114-
[project.ext.zigbuildCargo, 'zigbuild', '-Z', 'build-std', '--release', '--target', target.triple].flatten()
114+
[project.ext.zigbuildCargo, 'zigbuild', '-Z', 'build-std', '--target', target.triple].flatten()
115115
} else {
116-
[project.ext.zigbuildCargo, 'zigbuild', '--release', '--target', target.triple].flatten()
116+
[project.ext.zigbuildCargo, 'zigbuild', '--target', target.triple].flatten()
117117
}
118118
}
119119

@@ -126,8 +126,9 @@ supportedTargets.forEach { target ->
126126
group = 'rust'
127127
workingDir rustProjectDir
128128
description = "Cross-compiles natives for the ${target.triple} target"
129-
commandLine = commandLineForTarget(target)
130-
commandLine.add('--release')
129+
def commands= commandLineForTarget(target)
130+
commands.add('--release')
131+
commandLine = commands
131132
}
132133
}
133134

common/src/main/java/dev/ryanhcode/sable/mixin/plot/ServerChunkCacheMixin.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,6 @@ public void init(final ServerLevel serverLevel, final LevelStorageSource.LevelSt
4949
this.sable$emptyChunk = new EmptyLevelChunk(serverLevel, new ChunkPos(0, 0), serverLevel.registryAccess().registryOrThrow(Registries.BIOME).getHolderOrThrow(Biomes.PLAINS));
5050
}
5151

52-
// TODO: Remove if chunk ticking works as intended
53-
/*@WrapOperation(method = "tickChunks", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Lists;newArrayListWithCapacity(I)Ljava/util/ArrayList;", remap = false))
54-
private ArrayList<ServerChunkCache.ChunkAndHolder> tickChunks(final int initialArraySize, final Operation<ArrayList<ServerChunkCache.ChunkAndHolder>> original) {
55-
final ArrayList<ServerChunkCache.ChunkAndHolder> list = original.call(initialArraySize);
56-
57-
final SubLevelContainer container = this.sable$getPlotContainer();
58-
for (final SubLevel subLevel : container.getAllSubLevels()) {
59-
final Collection<PlotChunkHolder> chunks = subLevel.getPlot().getLoadedChunks();
60-
for (final PlotChunkHolder plotChunkHolder : chunks) {
61-
if (!this.chunkMap.visibleChunkMap.containsKey(plotChunkHolder.getPos().toLong()))
62-
list.add(new ServerChunkCache.ChunkAndHolder(plotChunkHolder.getChunk(), plotChunkHolder));
63-
}
64-
}
65-
66-
return list;
67-
}*/
68-
6952
@Unique
7053
private @NotNull SubLevelContainer sable$getPlotContainer() {
7154
final SubLevelContainer container = SubLevelContainer.getContainer(this.level);

common/src/main/rust/Cargo.lock

Lines changed: 5 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/src/main/rust/marten/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@ jni.workspace = true
88
log.workspace = true
99
fern.workspace = true
1010
humantime.workspace = true
11-
colored.workspace = true
12-
13-
#rapier3d = { git = "https://github.com/ryanhcode/rapier", rev = "a728067629d4f85cef99f388e12c9b0ee8cd1164", features = ["simd-nightly", "parallel"] }
14-
#parry3d = { version = "0.26.0", features = ["simd-nightly"] }
11+
colored.workspace = true

common/src/main/rust/rapier/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ colored.workspace = true
1212
log.workspace = true
1313
humantime.workspace = true
1414

15-
rapier3d = { git = "https://github.com/ryanhcode/rapier", rev = "a728067629d4f85cef99f388e12c9b0ee8cd1164", features = [
15+
rapier3d = { git = "https://github.com/ryanhcode/rapier", rev = "38e92f117590862481a53df6fc69a5d893e29186", features = [
1616
"simd-nightly",
1717
"parallel",
1818
] }

common/src/main/rust/rapier/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ pub extern "system" fn Java_dev_ryanhcode_sable_physics_impl_rapier_Rapier3D_cre
612612

613613
rigid_body.set_linear_damping(scene.universal_drag);
614614
rigid_body.set_angular_damping(scene.universal_drag);
615+
rigid_body.enable_gyroscopic_forces(true);
615616

616617
let handle = scene.rigid_body_set.insert(rigid_body);
617618

0 commit comments

Comments
 (0)