Skip to content

Commit 598e154

Browse files
authored
Merge branch 'dev' into darora/311/ui-feedback
2 parents 1dbffd3 + d9865f9 commit 598e154

7 files changed

Lines changed: 80 additions & 23 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8+
- package-ecosystem: "nix"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ renderer/
1111
.idea
1212
**/.direnv
1313
.npmrc
14+
result
15+
result-*

fission/public/assetpack.zip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:929579b2dc87cffb6b5236f054a6b1ffcb17f0a384f4262f58fd2cb99fdc48ac
3-
size 41776301
2+
oid sha256:2213eb7905d6fe15beb5fca656065c248da0c4f4b7630ced943bb5cf4a32c3fb
3+
size 43082276

fission/src/systems/scene/DragModeSystem.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,22 @@ class DragModeSystem extends WorldSystem {
357357
private stopDragging(): void {
358358
if (!this._isDragging) return
359359

360+
let targetSceneObject: MirabufSceneObject | undefined
361+
let shouldTransition = true
362+
363+
if (this._dragTarget) {
364+
const association = World.physicsSystem.getBodyAssociation(this._dragTarget.bodyId) as RigidNodeAssociate
365+
targetSceneObject = association?.sceneObject
366+
if (association?.isGamePiece) {
367+
shouldTransition = false
368+
}
369+
}
370+
360371
if (this._dragTarget?.physicsDisabled) {
361-
World.physicsSystem.enablePhysicsForBody(this._dragTarget.bodyId)
372+
World.physicsSystem.enablePhysicsForBody(
373+
this._dragTarget.bodyId,
374+
targetSceneObject?.mechanism.layerReserve?.layer
375+
)
362376
} else if (this._dragTarget) {
363377
const body = World.physicsSystem.getBody(this._dragTarget.bodyId)
364378
if (body) {
@@ -386,17 +400,6 @@ class DragModeSystem extends WorldSystem {
386400
}
387401
}
388402

389-
let targetSceneObject: MirabufSceneObject | undefined
390-
let shouldTransition = true
391-
392-
if (this._dragTarget) {
393-
const association = World.physicsSystem.getBodyAssociation(this._dragTarget.bodyId) as RigidNodeAssociate
394-
targetSceneObject = association?.sceneObject
395-
if (association?.isGamePiece) {
396-
shouldTransition = false
397-
}
398-
}
399-
400403
this._isDragging = false
401404
this._dragTarget = undefined
402405

@@ -427,6 +430,9 @@ class DragModeSystem extends WorldSystem {
427430
World.physicsSystem.activateBody(this._dragTarget.bodyId)
428431
}
429432

433+
const compensateGravity =
434+
DragModeSystem.DRAG_FORCE_CONSTANTS.GRAVITY_COMPENSATION && !this._dragTarget.physicsDisabled
435+
430436
const currentPos = body.GetPosition()
431437
const currentPosition = new THREE.Vector3(currentPos.GetX(), currentPos.GetY(), currentPos.GetZ())
432438
const currentRotation = body.GetRotation()
@@ -508,7 +514,7 @@ class DragModeSystem extends WorldSystem {
508514
const forceNeeded = velocityError.multiplyScalar(forceMultiplier)
509515

510516
// Add gravity compensation to counteract downward pull
511-
if (DragModeSystem.DRAG_FORCE_CONSTANTS.GRAVITY_COMPENSATION) {
517+
if (compensateGravity) {
512518
const gravityCompensation = new THREE.Vector3(
513519
0,
514520
mass * DragModeSystem.DRAG_FORCE_CONSTANTS.GRAVITY_MAGNITUDE,
@@ -558,7 +564,7 @@ class DragModeSystem extends WorldSystem {
558564
)
559565

560566
// Add gravity compensation to prevent falling when stationary
561-
if (DragModeSystem.DRAG_FORCE_CONSTANTS.GRAVITY_COMPENSATION) {
567+
if (compensateGravity) {
562568
const gravityCompensationY = mass * DragModeSystem.DRAG_FORCE_CONSTANTS.GRAVITY_MAGNITUDE
563569
brakingForce.SetY(brakingForce.GetY() + gravityCompensationY)
564570
}

flake.nix

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
# https://wiki.nixos.org/wiki/Flakes#Setup
33
{
44
description = "Synthesis' Web-Based Robotics Simulator";
5-
5+
66
nixConfig = {
77
commit-lock-file-summary = "chore: update flake.lock";
88
};
99

10-
inputs= {
10+
inputs = {
1111
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
1212
systems.url = "github:nix-systems/triplet";
1313
};
1414

1515
outputs =
16-
{ self, nixpkgs, systems }:
16+
{
17+
self,
18+
nixpkgs,
19+
systems,
20+
}:
1721
let
1822
inherit (nixpkgs) lib;
1923

@@ -55,17 +59,36 @@
5559
bun
5660
];
5761
};
58-
multiplayer = pkgs.mkShell {
62+
glueball = pkgs.mkShell {
5963
packages = with pkgs; [
60-
bun
64+
cargo
65+
clippy
66+
rustfmt
67+
rust-analyzer
6168
];
6269
};
6370
}
6471
);
6572

73+
packages = forEachSystem (
74+
{ pkgs, ... }: {
75+
glueball = pkgs.callPackage ./glueball/package.nix { };
76+
}
77+
);
78+
6679
formatter = forEachSystem ({ pkgs, ... }: pkgs.nixfmt-tree);
6780

68-
# Build all devShells, instead of just verifying they are derivations
69-
checks = forEachSystem ({ system, ... }: self.devShells.${system});
81+
# Build all devShells and packages, instead of just verifying they are
82+
# derivations
83+
checks = forEachSystem (
84+
{ system, ... }:
85+
let
86+
prefixAttrs = prefix: lib.mapAttrs' (n: lib.nameValuePair "${prefix}-${n}");
87+
in
88+
lib.foldr lib.attrsets.unionOfDisjoint { } [
89+
(prefixAttrs "dev-shell" self.devShells.${system})
90+
(prefixAttrs "package" self.packages.${system} )
91+
]
92+
);
7093
};
7194
}

glueball/.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if command -v nix &>/dev/null; then
2+
use flake .#glueball
3+
fi

glueball/package.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
}:
5+
rustPlatform.buildRustPackage {
6+
pname = "glueball";
7+
inherit ((lib.importTOML ./Cargo.toml).package) version;
8+
9+
src = ./.;
10+
11+
cargoLock.lockFile = ./Cargo.lock;
12+
13+
meta = {
14+
description = "Proxy server for facilitating multiplayer interactions in Autodesk Synthesis";
15+
homepage = "https://synthesis.autodesk.com";
16+
mainProgram = "glueball";
17+
license = lib.licenses.asl20;
18+
};
19+
}

0 commit comments

Comments
 (0)