Class TaskExtensions | Kinematica | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class TaskExtensions

    Static class that contains various extension methods that allow tasks to be created. Tasks in turn offer similar methods that allow for a concise notion when creation arbitrary complex task graphs.

    Inheritance
    Object
    TaskExtensions
    Namespace: Unity.Kinematica
    Syntax
    public static class TaskExtensions

    Methods

    Action(MotionSynthesizer)

    Creates a new action task as a child of the root task.

    Declaration
    public static ActionTask Action(this MotionSynthesizer synthesizer)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    Returns
    Type Description
    ActionTask

    Reference to the newly created action task.

    See Also
    RootTask

    Action(MotionSynthesizer, MemoryIdentifier)

    Creates a new action task as a child of the parent task passed as argument.

    Declaration
    public static ActionTask Action(this MotionSynthesizer synthesizer, MemoryIdentifier parent)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    MemoryIdentifier parent

    Identifier of the parent task.

    Returns
    Type Description
    ActionTask

    Reference to the newly created action task.

    Condition(MotionSynthesizer)

    Creates a new condition task as a child of the root task.

    Declaration
    public static ConditionTask Condition(this MotionSynthesizer synthesizer)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    Returns
    Type Description
    ConditionTask

    Reference to the newly created condition task.

    See Also
    RootTask

    Condition(MotionSynthesizer, MemoryIdentifier)

    Creates a new condition task as a child of the parent task passed as argument.

    Declaration
    public static ConditionTask Condition(this MotionSynthesizer synthesizer, MemoryIdentifier parent)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    MemoryIdentifier parent

    Identifier of the parent task.

    Returns
    Type Description
    ConditionTask

    Reference to the newly created condition task.

    CurrentPose(ActionTask)

    Creates a new current pose task as a child of an action.

    Declaration
    public static CurrentPoseTask CurrentPose(this ActionTask action)
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    CurrentPoseTask

    Reference to the newly created current pose task.

    See Also
    CurrentPoseTask

    GetByType<T>(ActionTask)

    Retrieves a reference to a task or data based on the generic type.

    Declaration
    public static T GetByType<T>(this ActionTask action)
        where T : struct
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    T

    Reference to a task or data that matches the generic type.

    Type Parameters
    Name Description
    T

    Navigation(ActionTask)

    Declaration
    public static NavigationTask Navigation(this ActionTask action)
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    NavigationTask

    Parallel(MotionSynthesizer)

    Creates a new parallel task as a child of the root task.

    Declaration
    public static ParallelTask Parallel(this MotionSynthesizer synthesizer)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    Returns
    Type Description
    ParallelTask

    Reference to the newly created parallel task.

    See Also
    RootTask

    Parallel(MotionSynthesizer, MemoryIdentifier)

    Creates a new parallel task as a child of the parent task passed as argument.

    Declaration
    public static ParallelTask Parallel(this MotionSynthesizer synthesizer, MemoryIdentifier parent)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    MemoryIdentifier parent

    Identifier of the parent task.

    Returns
    Type Description
    ParallelTask

    Reference to the newly created parallel task.

    Push(ActionTask, Identifier<TimeIndex>)

    Creates a new push task as a child of an action.

    Declaration
    public static PushTask Push(this ActionTask action, Identifier<TimeIndex> samplingTime)
    Parameters
    Type Name Description
    ActionTask action
    Identifier<TimeIndex> samplingTime

    The sampling time that the push task receives as input.

    Returns
    Type Description
    PushTask

    Reference to the newly created push task.

    See Also
    PushTask

    Push(ActionTask, QueryResult)

    Creates a new push task as a child of an action.

    Declaration
    public static PushTask Push(this ActionTask action, QueryResult result)
    Parameters
    Type Name Description
    ActionTask action
    QueryResult result

    Pose sequence that will be passed to the implicitely created reduce operation.

    Returns
    Type Description
    PushTask

    Reference to the newly created push task.

    Remarks

    This is a convenience method that implicitely creates a reduce task for the query result that is passed as argument. Since in this case the reduce task will not receive any constraints it will simply select the first pose of the query result. This method allows to push the first pose of a query result to the motion synthesizer.

    See Also
    PushTask

    Push(ActionTask, TimeIndex)

    Creates a new push task as a child of an action.

    Declaration
    public static PushTask Push(this ActionTask action, TimeIndex samplingTime)
    Parameters
    Type Name Description
    ActionTask action
    TimeIndex samplingTime

    The sampling time that the push task receives as input.

    Returns
    Type Description
    PushTask

    Reference to the newly created push task.

    See Also
    PushTask

    PushConstrained(ActionTask, QueryResult, Single)

    Creates a new push task as a child of an action.

    Declaration
    public static PushTask PushConstrained(this ActionTask action, QueryResult result, float threshold)
    Parameters
    Type Name Description
    ActionTask action
    QueryResult result

    Pose sequence that will be passed to the implicitely created reduce operation.

    Single threshold

    Threshold that will be passed to the implicitely created reduce operation.

    Returns
    Type Description
    PushTask

    Reference to the newly created push task.

    Remarks

    This is a convenience method that implicitely creates a reduce task for the query result that is passed as argument. The reduce task will be set up such that it selects the animation pose that is most similar to the current pose of the synthesizer.

    See Also
    PushTask

    PushConstrained(ActionTask, QueryResult, Identifier<Trajectory>)

    Creates a new push task as a child of an action.

    Declaration
    public static PushTask PushConstrained(this ActionTask action, QueryResult result, Identifier<Trajectory> trajectory)
    Parameters
    Type Name Description
    ActionTask action
    QueryResult result

    Pose sequence that will be passed to the implicitely created reduce operation.

    Identifier<Trajectory> trajectory

    Trajectory that will be passed to the implicitely created reduce operation.

    Returns
    Type Description
    PushTask

    Reference to the newly created push task.

    Remarks

    This is a convenience method that implicitely creates a reduce task for the query result that is passed as argument. The reduce task will be set up such that it selects the animation pose that is most similar to the current pose of the synthesizer and the desired trajectory that is passed as argument.

    See Also
    PushTask

    QueryResult(ActionTask, QueryResult)

    Creates a new pose sequence.

    Declaration
    public static Identifier<PoseSequence> QueryResult(this ActionTask action, QueryResult result)
    Parameters
    Type Name Description
    ActionTask action
    QueryResult result

    Query result that is to be used as initial value of the pose sequence.

    Returns
    Type Description
    Identifier<PoseSequence>

    Reference to the newly created pose sequence.

    Remarks

    This method allows the creation of a pose sequence that can be fed into a reduce task. The pose sequence will be initialized based on the query result passed as argument.

    See Also
    Query
    ReduceTask

    Reduce(ActionTask, Identifier<PoseSequence>)

    Creates a new reduce task as a child of an action.

    Declaration
    public static ReduceTask Reduce(this ActionTask action, Identifier<PoseSequence> sequences)
    Parameters
    Type Name Description
    ActionTask action
    Identifier<PoseSequence> sequences

    The pose sequence that the reduce task receives as input.

    Returns
    Type Description
    ReduceTask

    Reference to the newly created reduce task.

    See Also
    ReduceTask

    Reduce(ActionTask, Identifier<PoseSequence>, Identifier<SamplingTime>, Identifier<Trajectory>, Single)

    Creates a new reduce task as a child of an action.

    Declaration
    public static ReduceTask Reduce(this ActionTask action, Identifier<PoseSequence> sequences, Identifier<SamplingTime> samplingTime, Identifier<Trajectory> trajectory, float threshold = 0F)
    Parameters
    Type Name Description
    ActionTask action
    Identifier<PoseSequence> sequences

    The pose sequence that the reduce task receives as input.

    Identifier<SamplingTime> samplingTime

    Reference animation pose that the reduce task will receive as input.

    Identifier<Trajectory> trajectory

    The desired future trajectory that the reduce task will receive as input.

    Single threshold

    The threshold that the reduce task will receive as input.

    Returns
    Type Description
    ReduceTask

    Reference to the newly created reduce task.

    See Also
    ReduceTask

    SamplingTime(ActionTask)

    Creates a new sampling time.

    Declaration
    public static Identifier<SamplingTime> SamplingTime(this ActionTask action)
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    Identifier<SamplingTime>

    Reference to the newly created sampling time.

    Remarks

    The value of the newly created sampling time will be set to invalid.

    SamplingTime(ActionTask, SamplingTime)

    Creates a new sampling time.

    Declaration
    public static Identifier<SamplingTime> SamplingTime(this ActionTask action, SamplingTime samplingTime)
    Parameters
    Type Name Description
    ActionTask action
    SamplingTime samplingTime

    Sampling time value that is to be used as initial value.

    Returns
    Type Description
    Identifier<SamplingTime>

    Reference to the newly created sampling time.

    Remarks

    The value of the newly created sampling time will be set to the sampling time passed as argument.

    Selector(MotionSynthesizer)

    Creates a new selector task as a child of the root task.

    Declaration
    public static SelectorTask Selector(this MotionSynthesizer synthesizer)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    Returns
    Type Description
    SelectorTask

    Reference to the newly created selector task.

    See Also
    RootTask

    Selector(MotionSynthesizer, MemoryIdentifier)

    Creates a new selector task as a child of the parent task passed as argument.

    Declaration
    public static SelectorTask Selector(this MotionSynthesizer synthesizer, MemoryIdentifier parent)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    MemoryIdentifier parent

    Identifier of the parent task.

    Returns
    Type Description
    SelectorTask

    Reference to the newly created selector task.

    Sequence(MotionSynthesizer, Boolean, Boolean)

    Creates a new sequence task as a child of the root task.

    Declaration
    public static SequenceTask Sequence(this MotionSynthesizer synthesizer, bool loop = false, bool resetWhenNotExecuted = true)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    Boolean loop

    If false, once the sequence has finished executing all its children, it will do nothing and just return success. If true, sequence will reexecute all its children tasks indefinitely.

    Boolean resetWhenNotExecuted

    If true, and if the sequence isn't executed during one task graph pass, next time the sequence will be executed again, it will restart execution from its first child.

    Returns
    Type Description
    SequenceTask

    Reference to the newly created sequence task.

    See Also
    RootTask

    Sequence(MotionSynthesizer, MemoryIdentifier, Boolean, Boolean)

    Creates a new sequence task as a child of the parent task passed as argument.

    Declaration
    public static SequenceTask Sequence(this MotionSynthesizer synthesizer, MemoryIdentifier parent, bool loop = false, bool resetWhenNotExecuted = true)
    Parameters
    Type Name Description
    MotionSynthesizer synthesizer
    MemoryIdentifier parent

    Identifier of the parent task.

    Boolean loop

    If false, once the sequence has finished executing all its children, it will do nothing and just return success. If true, sequence will reexecute all its children tasks indefinitely.

    Boolean resetWhenNotExecuted

    If true, and if the sequence isn't executed during one task graph pass, next time the sequence will be executed again, it will restart execution from its first child.

    Returns
    Type Description
    SequenceTask

    Reference to the newly created sequence task.

    TimeIndex(ActionTask)

    Creates a new time index.

    Declaration
    public static Identifier<TimeIndex> TimeIndex(this ActionTask action)
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    Identifier<TimeIndex>

    Reference to the newly created time index.

    Remarks

    The value of the newly created time index will be set to invalid.

    TimeIndex(ActionTask, TimeIndex)

    Creates a new time index.

    Declaration
    public static Identifier<TimeIndex> TimeIndex(this ActionTask action, TimeIndex timeIndex)
    Parameters
    Type Name Description
    ActionTask action
    TimeIndex timeIndex

    Time index value that is to be used as initial value.

    Returns
    Type Description
    Identifier<TimeIndex>

    Reference to the newly created time index.

    Remarks

    The value of the newly created time index will be set to the time index passed as argument.

    Timer(ActionTask, Single)

    Creates a new timer task as a child of an action.

    Declaration
    public static MemoryIdentifier Timer(this ActionTask action, float timeInSeconds = 0F)
    Parameters
    Type Name Description
    ActionTask action
    Single timeInSeconds

    Time in seconds that will be used as initial value for the timer task.

    Returns
    Type Description
    MemoryIdentifier

    Reference to the newly created timer task.

    Trajectory(ActionTask)

    Creates a new trajectory.

    Declaration
    public static Identifier<Trajectory> Trajectory(this ActionTask action)
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    Identifier<Trajectory>

    Reference to the newly created trajectory.

    Remarks

    This method allows the creation of a trajectory that can be used for any task that requires a reference to a trajectory.

    TrajectoryHeuristic(ActionTask, Identifier<TimeIndex>, Identifier<Trajectory>)

    Creates a new trajectory heuristic task as a child of an action.

    Declaration
    public static TrajectoryHeuristicTask TrajectoryHeuristic(this ActionTask action, Identifier<TimeIndex> candidate, Identifier<Trajectory> trajectory)
    Parameters
    Type Name Description
    ActionTask action
    Identifier<TimeIndex> candidate

    The candidate time index that the trajectory heuristic task receives as input.

    Identifier<Trajectory> trajectory

    The trajectory that the trajectory heuristic task receives as input.

    Returns
    Type Description
    TrajectoryHeuristicTask

    Reference to the newly created trajectory heuristic task.

    See Also
    TrajectoryHeuristicTask

    TrajectoryPrediction(ActionTask)

    Creates a new trajectory prediction task as a child of an action.

    Declaration
    public static TrajectoryPredictionTask TrajectoryPrediction(this ActionTask action)
    Parameters
    Type Name Description
    ActionTask action
    Returns
    Type Description
    TrajectoryPredictionTask

    Reference to the newly created trajectory prediction task.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023