Skip to content

Commit

Permalink
fixed some old spelling mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
David624634 committed May 3, 2024
1 parent 070f4ac commit a127b82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace i5.VirtualAgents.AgentTasks
public class AgentPickUpTask : AgentBaseTask, ISerializable
{
/// <summary>
/// Minimum distance of the agent to the target so that the traget can be picked up
/// Minimum distance of the agent to the target so that the target can be picked up
/// </summary>
private const float minDistance = 1f;

Expand All @@ -34,7 +34,7 @@ public class AgentPickUpTask : AgentBaseTask, ISerializable
public GameObject PickupObject { get; protected set; }

/// <summary>
/// Bodypart that the object should attached to
/// Agents socket that the object should attached to
/// </summary>
public SocketId SocketId { get; protected set; }

Expand All @@ -49,7 +49,7 @@ public AgentPickUpTask()
/// Create an AgentPickUpTask using the object that should be picked up
/// </summary>
/// <param name="pickupObject">The object that the agent should pick up</param>
/// <param name="socketId">Bodypart that the object should be attached to, standard is the right Hand</param>
/// <param name="socketId">Agent socket that the object should be attached to, standard is the right Hand</param>
public AgentPickUpTask(GameObject pickupObject, SocketId socketId = SocketId.RightHand)
{
PickupObject = pickupObject;
Expand Down Expand Up @@ -134,23 +134,22 @@ public IEnumerator IKWeightIncrease(Agent agent, Item item)
meshSockets.TwoBoneIKConstraintRightArm.data.root = animator.GetBoneTransform(HumanBodyBones.RightUpperArm);
meshSockets.TwoBoneIKConstraintRightArm.data.mid = animator.GetBoneTransform(HumanBodyBones.RightLowerArm);
meshSockets.TwoBoneIKConstraintRightArm.data.tip = animator.GetBoneTransform(HumanBodyBones.RightHand);
//TODO: This is a computatioal heavy operation, it would be advisable to not do this during runtime
//TODO: This is a computational heavy operation, it would be advisable to not do this during runtime
RigBuilder rigs = agent.GetComponent<RigBuilder>();
rigs.Build();
}
constraint.data.target.SetPositionAndRotation(constraint.data.tip.position, constraint.data.tip.rotation);
constraint.weight = 1;
item.IsPickedUp = true;

while (Vector3.Distance(constraint.data.target.position, item.GrabTarget.position) > proximityThreshold)
{

// Calculate direction from which the grapTarget is approached
// Calculate direction from which the grabTarget is approached
Quaternion direction = Quaternion.LookRotation(item.GrabTarget.position - constraint.data.tip.position);
// Ajust direction so that the hand is rotated corectly: formulation was found by testing
// Adjust direction so that the hand is rotated correctly: formulation was found by testing
direction = Quaternion.Euler(direction.eulerAngles.x + ((315- direction.eulerAngles.x)*2), direction.eulerAngles.y -180, direction.eulerAngles.z);

// Change position and roation of the target smoothly
// Change position and rotation of the target smoothly
constraint.data.target.position = Vector3.Lerp(constraint.data.target.position, item.GrabTarget.position, Time.deltaTime * moveSpeed);
constraint.data.target.rotation = Quaternion.Lerp(constraint.data.target.rotation, direction, Time.deltaTime * moveSpeed);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public AgentBaseTask GoTo(Transform destinationTransform, Vector3 offset = defau
}

/// <summary>
/// Creates an AgentMovementTask for walking/running to a specific gameobject and schedules it or forces its execution.
/// Creates an AgentMovementTask for walking/running to a specific GameObject and schedules it or forces its execution.
/// Shortcut queue management function
/// </summary>
/// <param name="destinationObject">GameObject the agent should go to</param>
Expand All @@ -71,9 +71,9 @@ public AgentBaseTask GoTo(GameObject destinationObject, Vector3 offset = default
/// Lets the agent wait for the given number of seconds in an idle position
/// Shortcut queue management function
/// </summary>
/// <param name="seconds">The time span in seconds for which the agent shoudl wait</param>
/// <param name="seconds">The time span in seconds for which the agent should wait</param>
/// <param name="priority">Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.</param>
/// <param name="layer">The animation layer on which the task should be excuted</param>
/// <param name="layer">The animation layer on which the task should be executed</param>
public AgentBaseTask WaitForSeconds(float seconds, int priority = 0, string layer = "Base Layer")
{
AgentWaitTask agentWaitTask = new AgentWaitTask(seconds);
Expand All @@ -90,7 +90,7 @@ public AgentBaseTask WaitForSeconds(float seconds, int priority = 0, string laye
/// <param name="playTime"> Time in seconds after which the animation should stop</param>
/// <param name="stopTrigger"> Trigger that stops the animation. If not provided, start trigger is used again</param>
/// <param name="priority">Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.</param>
/// <param name="layer"> The animation layer on which the task should be excuted </param>
/// <param name="layer"> The animation layer on which the task should be executed </param>
/// <param name="aimTarget">The target at which the agent should aim while playing the animation</param>
public AgentBaseTask PlayAnimation(string startTrigger, float playTime, string stopTrigger = "", int priority = 0, string layer = "Base Layer", GameObject aimTarget = null)
{
Expand All @@ -105,7 +105,7 @@ public AgentBaseTask PlayAnimation(string startTrigger, float playTime, string s
/// </summary>
/// <param name="pickupObject">Object that should be picked up. Needs to have an item component and be near to the agent.</param>
/// <param name="priority">Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.</param>
/// <param name="bodyAttachPoint">Bodypart that the object should be attached to, standard is the right Hand</param>
/// <param name="bodyAttachPoint">Agent socket that the object should be attached to, standard is the right Hand</param>
/// <returns></returns>
public AgentBaseTask PickUp(GameObject pickupObject, int priority = 0, SocketId bodyAttachPoint = SocketId.RightHand)
{
Expand All @@ -120,7 +120,7 @@ public AgentBaseTask PickUp(GameObject pickupObject, int priority = 0, SocketId
/// </summary>
/// <param name="destinationObject">Object the agent should go to and pick up. Needs to have an item component and be reachable by the agent.</param>
/// <param name="priority">Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.</param>
/// <param name="bodyAttachPoint">Bodypart that the object should be attached to, standard is the right Hand</param>
/// <param name="bodyAttachPoint">Agent socket that the object should be attached to, standard is the right Hand</param>
/// <param name="minDistance">Distance at which the the agent will try to pick up the object</param>
/// <returns></returns>
public AgentBaseTask GoToAndPickUp(GameObject destinationObject, int priority = 0, SocketId bodyAttachPoint = SocketId.RightHand, float minDistance = 0.3f)
Expand Down Expand Up @@ -196,9 +196,10 @@ public AgentBaseTask GoToAndDropItem(Transform destinationTransform, GameObject
/// </summary>
/// <param name="seconds">Time in seconds after which the gazing should stop</param>
/// <param name="priority">Priority of the task. Tasks with high importance should get a positive value, less important tasks a negative value. Default tasks have a priority of 0.</param>
/// <returns>Returs a AgentBaseTask array with two elements. The first has the starting Task (e.g. for startTask.waitFor(diffrentTask), and the second the stop Task ((e.g. for diffrentTask.waitFor(stopTask))</returns>
/// <returns>Returns a AgentBaseTask array with two elements. The first has the starting Task (e.g. for startTask.waitFor(differentTask), and the second the stop Task ((e.g. for differentTask.waitFor(stopTask))</returns>
public AgentBaseTask[] StartAdaptiveGazeForTime(float seconds, int priority = 0)
{
//TODO: Check if this can better be solved with a TaskBundle
AgentBaseTask adaptiveGazeTaskStart = new AgentAdaptiveGazeTask(true);
scheduleTaskSystem.ScheduleTask(adaptiveGazeTaskStart, priority, "Head");
AgentBaseTask waitHead = WaitForSeconds(seconds, priority, "Head");
Expand Down

0 comments on commit a127b82

Please sign in to comment.