MeatMotion

RigidbodyMotionExtensions

Bind Rigidbody position or rotation using physics movement or direct property assignment.

Namespace
MeatMotion.Extensions
Assembly
MeatMotion

Jump to members

public static class RigidbodyMotionExtensions

Requires com.unity.modules.physics

RigidbodyMotionExtensions.cs · L6

Members

BindToPosition

Use MovePosition by default. Pass false to assign position directly.

public static MotionHandle BindToPosition<TOptions, TAdapter>(this MotionBuilder<Vector3, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Vector3, TOptions>
Parameters and return value
builder
this MotionBuilder<Vector3, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToPositionX

Use MovePosition by default. Pass false to assign position directly. Other components retain their current values; only X changes.

public static MotionHandle BindToPositionX(this FloatMotionBuilder builder, Rigidbody rigidbody, bool useMovePosition = true)
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle
public static MotionHandle BindToPositionX<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
Parameters and return value
builder
this MotionBuilder<float, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToPositionY

Use MovePosition by default. Pass false to assign position directly. Other components retain their current values; only Y changes.

public static MotionHandle BindToPositionY(this FloatMotionBuilder builder, Rigidbody rigidbody, bool useMovePosition = true)
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle
public static MotionHandle BindToPositionY<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
Parameters and return value
builder
this MotionBuilder<float, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToPositionZ

Use MovePosition by default. Pass false to assign position directly. Other components retain their current values; only Z changes.

public static MotionHandle BindToPositionZ(this FloatMotionBuilder builder, Rigidbody rigidbody, bool useMovePosition = true)
Parameters and return value
builder
this FloatMotionBuilder Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle
public static MotionHandle BindToPositionZ<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
Parameters and return value
builder
this MotionBuilder<float, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToPositionXY

Use MovePosition by default. Pass false to assign position directly. Other components retain their current values; only XY changes.

public static MotionHandle BindToPositionXY<TOptions, TAdapter>(this MotionBuilder<Vector2, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Vector2, TOptions>
Parameters and return value
builder
this MotionBuilder<Vector2, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToPositionXZ

Use MovePosition by default. Pass false to assign position directly. Other components retain their current values; only XZ changes.

public static MotionHandle BindToPositionXZ<TOptions, TAdapter>(this MotionBuilder<Vector2, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Vector2, TOptions>
Parameters and return value
builder
this MotionBuilder<Vector2, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToPositionYZ

Use MovePosition by default. Pass false to assign position directly. Other components retain their current values; only YZ changes.

public static MotionHandle BindToPositionYZ<TOptions, TAdapter>(this MotionBuilder<Vector2, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMovePosition = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Vector2, TOptions>
Parameters and return value
builder
this MotionBuilder<Vector2, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMovePosition = true
bool Use MovePosition when true, or assign position directly when false.
Returns
MotionHandle

BindToRotation

Use MoveRotation by default. Pass false to assign rotation directly.

public static MotionHandle BindToRotation<TOptions, TAdapter>(this MotionBuilder<Quaternion, TOptions, TAdapter> builder, Rigidbody rigidbody, bool useMoveRotation = true)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<Quaternion, TOptions>
Parameters and return value
builder
this MotionBuilder<Quaternion, TOptions, TAdapter> Configured builder, passed as the receiver for extension calls.
rigidbody
Rigidbody Target Rigidbody that receives the update.
useMoveRotation = true
bool Use MoveRotation when true, or assign rotation directly when false.
Returns
MotionHandle