Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,15 @@ export default function App() {
if (isAtTarget) {
if (arm.state === 'picking_down') {
if (arm.grabbedObject) {
// Remove from walls array when picked up
const wallIndex = sim.current.walls.indexOf(arm.grabbedObject);
if (wallIndex > -1) {
sim.current.walls.splice(wallIndex, 1);
}
// Check if this is the target and set target to null
if (arm.grabbedObject === sim.current.target) {
sim.current.target = null;
}
arm.gripper.add(arm.grabbedObject);
arm.grabbedObject.position.set(0, 0.35, 0);
}
Expand All @@ -851,6 +860,10 @@ export default function App() {
arm.grabbedObject.position.copy(worldPos);
// Drop to ground level
arm.grabbedObject.position.y = 0.25;
// Add back to walls array when dropped
sim.current.walls.push(arm.grabbedObject);
// Set as target when dropped
sim.current.target = arm.grabbedObject;
arm.grabbedObject = null;
}
arm.state = 'dropping_up';
Expand Down