TypeExtensions
- Namespace: Turian.Engine.Core
- Source File: TypeExtensions.cs
Provides extension methods for converting various data types to byte arrays.
Public Methods
AsBytes
public static byte[] AsBytes(int i)
Converts an integer to a byte array.
Parameters:
i(int): The integer to convert.
Returns: byte[]
- The byte array representation of the integer.
AsBytes
public static byte[] AsBytes(float f)
Converts a float to a byte array.
Parameters:
f(float): The float to convert.
Returns: byte[]
- The byte array representation of the float.
AsBytes
public static byte[] AsBytes(Vector4 vec)
Converts a Vector4 to a byte array.
Parameters:
vec(Vector4): TheVector4to convert.
Returns: byte[]
- The byte array representation of the
Vector4.
AsBytes
public static byte[] AsBytes(Matrix4x4 mat)
Converts a Matrix4x4 to a byte array.
Parameters:
mat(Matrix4x4): TheMatrix4x4to convert.
Returns: byte[]
- The byte array representation of the
Matrix4x4.
AsBytes
public static byte[] AsBytes(PointLight[] pts)
Converts an array of PointLight to a byte array.
Parameters:
pts(PointLight[]): The array ofPointLightto convert.
Returns: byte[]
- The byte array representation of the array of
PointLight.
AsBytes
public static byte[] AsBytes(DirectionalLight[] lights)
Converts an array of DirectionalLight to a byte array.
Parameters:
lights(DirectionalLight[]): The array ofDirectionalLightto convert.
Returns: byte[]
- The byte array representation of the array of
DirectionalLight.