# MotionUpdateJob<TValue, TOptions, TAdapter>

Evaluate motions in a NativeArray in parallel. Provide output storage and reserve the completed-index list before scheduling.

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public struct MotionUpdateJob<TValue, TOptions, TAdapter> : IJobParallelFor
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>
```

[Runtime/Jobs/MotionUpdateJob.cs · L9](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L9)

## Evaluate a float in a job

Add `using MeatMotion;`, `using MeatMotion.Adapters;`, `using Unity.Collections;` and `using Unity.Jobs;`. Reserve output and retirement capacity for one entry and complete the job before reading the result of 4.

```csharp
using var motions = new NativeArray<MotionUpdateJob<float, NoOptions, FloatMotionAdapter>.Motion>(
    1, Allocator.TempJob);
using var output = new NativeArray<float>(1, Allocator.TempJob);
using var retired = new NativeList<int>(1, Allocator.TempJob);
var entries = motions;
entries[0] = new MotionUpdateJob<float, NoOptions, FloatMotionAdapter>.Motion(0f, 8f, 1f);
var job = new MotionUpdateJob<float, NoOptions, FloatMotionAdapter>
{
    Motions = motions, Output = output, CompletedIndexList = retired.AsParallelWriter(),
    DeltaTime = 0.5, UnscaledDeltaTime = 0.5, RealDeltaTime = 0.5
};
job.Schedule(1, 1).Complete();
float value = output[0];
```

## Motions

NativeArray containing the motion entries to evaluate.

```csharp
public NativeArray<Motion> Motions;
```

[Runtime/Jobs/MotionUpdateJob.cs · L55](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L55)

## DeltaTime

Scaled delta in seconds for entries using MotionTimeKind.Time.

```csharp
public double DeltaTime;
```

[Runtime/Jobs/MotionUpdateJob.cs · L56](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L56)

## UnscaledDeltaTime

Unscaled delta in seconds for entries using MotionTimeKind.UnscaledTime.

```csharp
public double UnscaledDeltaTime;
```

[Runtime/Jobs/MotionUpdateJob.cs · L56](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L56)

## RealDeltaTime

Real-time delta in seconds for entries using MotionTimeKind.Realtime.

```csharp
public double RealDeltaTime;
```

[Runtime/Jobs/MotionUpdateJob.cs · L56](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L56)

## Output

Receive evaluated values at the same indices as the input motions.

```csharp
public NativeArray<TValue> Output;
```

[Runtime/Jobs/MotionUpdateJob.cs · L57](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L57)

## CompletedIndexList

Receives retired indices. Reserve capacity for every potentially retired motion before scheduling.

```csharp
public NativeList<int>.ParallelWriter CompletedIndexList;
```

[Runtime/Jobs/MotionUpdateJob.cs · L59](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L59)

## Execute

Evaluate one indexed entry using its selected clock and update its state and output.

```csharp
public void Execute(int index)
```

Parameters

- `index` (`int`) Index of the entry to operate on.

[Runtime/Jobs/MotionUpdateJob.cs · L61](../../../source/Runtime/Jobs/MotionUpdateJob.cs.html#L61)

## Related types

- [MotionUpdateJob<TValue, TOptions, TAdapter>.Motion](../../../en/api/motionupdatejob-3-motion/index.md)

- [MotionUpdateJob<TValue, TOptions, TAdapter>.Status](../../../en/api/motionupdatejob-3-status/index.md)
