Skip to content

Commit

Permalink
isolating held object checks to high level agent...
Browse files Browse the repository at this point in the history
... that uses the high level "hand" rather than a physical arm

also updating errorMessage for armed agents
  • Loading branch information
winthos committed Sep 25, 2024
1 parent df6c14f commit 33ef2df
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
9 changes: 2 additions & 7 deletions unity/Assets/Scripts/ArmAgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public override void Teleport(
) {
//non-high level agents cannot set standing
if(standing != null) {
errorMessage = "Cannot set standing for stretch agent";
errorMessage = "Cannot set standing for arm/stretch agent";
actionFinishedEmit(success:false, actionReturn:null, errorMessage:errorMessage);
return;
}
Expand All @@ -298,7 +298,7 @@ public override void TeleportFull(
) {
//non-high level agents cannot set standing
if(standing != null) {
errorMessage = "Cannot set standing for stretch agent";
errorMessage = "Cannot set standing for arm/stretch agent";
actionFinishedEmit(success:false, actionReturn:null, errorMessage:errorMessage);
return;
}
Expand All @@ -318,11 +318,6 @@ public override void TeleportFull(

// add arm value cases
if (!forceAction) {
if (isHandObjectColliding(ignoreAgent: true)) {
throw new InvalidOperationException(
"Cannot teleport due to hand object collision."
);
}
if (Arm != null && Arm.IsArmColliding()) {
throw new InvalidOperationException(
"Mid Level Arm is actively clipping with some geometry in the environment. TeleportFull fails in this position."
Expand Down
9 changes: 0 additions & 9 deletions unity/Assets/Scripts/PhysicsRemoteFPSAgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1712,15 +1712,6 @@ public virtual void TeleportFull(
"Cannot teleport due to hand object collision."
);
}
if (Arm != null && Arm.IsArmColliding()) {
throw new InvalidOperationException(
"Mid Level Arm is actively clipping with some geometry in the environment. TeleportFull fails in this position."
);
} else if (SArm != null && SArm.IsArmColliding()) {
throw new InvalidOperationException(
"Stretch Arm is actively clipping with some geometry in the environment. TeleportFull fails in this position."
);
}
base.assertTeleportedNearGround(targetPosition: position);
}
} catch (InvalidOperationException e) {
Expand Down

0 comments on commit 33ef2df

Please sign in to comment.