Struct HalfVector4
Inherited Members
Namespace: Unity.Netcode.Components
Syntax
public struct HalfVector4 : INetworkSerializable
Constructors
HalfVector4(Single, Single, Single, Single)
Constructor
Declaration
public HalfVector4(float x, float y, float z, float w)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The initial x axis (converted to half float) value when instantiated. |
Single | y | The initial y axis (converted to half float) value when instantiated. |
Single | z | The initial z axis (converted to half float) value when instantiated. |
Single | w | The initial w axis (converted to half float) value when instantiated. |
HalfVector4(Vector4)
Constructor
Declaration
public HalfVector4(Vector4 vector4)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector4 | The initial axial values (converted to half floats) when instantiated. |
Fields
Axis
Used to store the half float precision values as a half4
Declaration
public half4 Axis
Field Value
Type | Description |
---|---|
half4 |
Properties
W
The half float precision value of the w-axis as a half.
Declaration
public readonly half W { get; }
Property Value
Type | Description |
---|---|
half |
X
The half float precision value of the x-axis as a half.
Declaration
public readonly half X { get; }
Property Value
Type | Description |
---|---|
half |
Y
The half float precision value of the y-axis as a half.
Declaration
public readonly half Y { get; }
Property Value
Type | Description |
---|---|
half |
Z
The half float precision value of the z-axis as a half.
Declaration
public readonly half Z { get; }
Property Value
Type | Description |
---|---|
half |
Methods
NetworkSerialize<T>(BufferSerializer<T>)
The serialization implementation of INetworkSerializable.
Declaration
public void NetworkSerialize<T>(BufferSerializer<T> serializer)
where T : IReaderWriter
Parameters
Type | Name | Description |
---|---|---|
BufferSerializer<T> | serializer |
Type Parameters
Name | Description |
---|---|
T |
Implements
ToQuaternion()
Converts this instance to a full precision Quaternion.
Declaration
public Quaternion ToQuaternion()
Returns
Type | Description |
---|---|
Quaternion | A Quaternion as the full precision value. |
ToVector4()
Converts this instance to a full precision Vector4.
Declaration
public Vector4 ToVector4()
Returns
Type | Description |
---|---|
Vector4 | A Vector4 as the full precision value. |
UpdateFrom(ref Quaternion)
Converts a full precision Vector4 to half precision and updates the current instance.
Declaration
public void UpdateFrom(ref Quaternion quaternion)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | quaternion | The Quaternion to convert and update this instance with. |
UpdateFrom(ref Vector4)
Converts a full precision Vector4 to half precision and updates the current instance.
Declaration
public void UpdateFrom(ref Vector4 vector4)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector4 | The Vector4 to convert and update this instance with. |