Table of Contents

Struct BlockRotation

Namespace
Shard.Gameplay.Universe.World.Blocks
Assembly
Shard.Gameplay.Universe.dll

The flattened Yaw, Pitch and Roll of a block.

public readonly record struct BlockRotation : IEquatable<BlockRotation>
Implements
Inherited Members

Remarks

Value is formed by combining the axes into one 6-bit value. The two least-significant bits are the yaw, the next two are the pitch, and the last two are the roll. All other bits should be zero.

Constructors

BlockRotation(Rotation, Rotation, Rotation)

public BlockRotation(Rotation yaw, Rotation pitch, Rotation roll)

Parameters

yaw Rotation
pitch Rotation
roll Rotation

BlockRotation(int)

The flattened Yaw, Pitch and Roll of a block.

public BlockRotation(int Value)

Parameters

Value int

The raw rotation value, in the range 0..64

Remarks

Value is formed by combining the axes into one 6-bit value. The two least-significant bits are the yaw, the next two are the pitch, and the last two are the roll. All other bits should be zero.

Properties

Pitch

Pitch, the rotation around the X axis.

public Rotation Pitch { get; }

Property Value

Rotation

Roll

Roll, the rotation around the Z axis.

public Rotation Roll { get; }

Property Value

Rotation

Value

The raw rotation value, in the range 0..64

public int Value { get; init; }

Property Value

int

Yaw

Yaw, the rotation around the Y axis.

public Rotation Yaw { get; }

Property Value

Rotation

Methods

Deconstruct(out Rotation, out Rotation, out Rotation)

public void Deconstruct(out Rotation yaw, out Rotation pitch, out Rotation roll)

Parameters

yaw Rotation
pitch Rotation
roll Rotation

Operators

implicit operator int(BlockRotation)

public static implicit operator int(BlockRotation rotation)

Parameters

rotation BlockRotation

Returns

int

implicit operator BlockRotation(int)

public static implicit operator BlockRotation(int value)

Parameters

value int

Returns

BlockRotation