Convert Int4 to generated type.

This commit is contained in:
Jean-Baptiste Perrier
2021-04-08 18:46:28 +02:00
parent 854b2492dd
commit 8661c2af18
2 changed files with 19 additions and 31 deletions

View File

@@ -12,9 +12,8 @@ namespace FlaxEngine
/// Represents a four dimensional mathematical vector (signed integers).
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, Pack = 4)]
[TypeConverter(typeof(TypeConverters.Int4Converter))]
public struct Int4 : IEquatable<Int4>, IFormattable
partial struct Int4 : IEquatable<Int4>, IFormattable
{
private static readonly string _formatString = "X:{0} Y:{1} Z:{2} W:{3}";
@@ -63,26 +62,6 @@ namespace FlaxEngine
/// </summary>
public static readonly Int4 Maximum = new Int4(int.MaxValue);
/// <summary>
/// The X component of the vector.
/// </summary>
public int X;
/// <summary>
/// The Y component of the vector.
/// </summary>
public int Y;
/// <summary>
/// The Z component of the vector.
/// </summary>
public int Z;
/// <summary>
/// The W component of the vector.
/// </summary>
public int W;
/// <summary>
/// Initializes a new instance of the <see cref="Int4" /> struct.
/// </summary>

View File

@@ -13,25 +13,34 @@ struct Vector4;
/// <summary>
/// Four-components vector (32 bit integer type).
/// </summary>
API_STRUCT(InBuild) struct FLAXENGINE_API Int4
API_STRUCT() struct FLAXENGINE_API Int4
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Int4);
public:
union
{
struct
{
// X component
int32 X;
/// <summary>
/// The X component.
/// </summary>
API_FIELD() int32 X;
// Y component
int32 Y;
/// <summary>
/// The Y component.
/// </summary>
API_FIELD() int32 Y;
// Z component
int32 Z;
/// <summary>
/// The Z component.
/// </summary>
API_FIELD() int32 Z;
// W component
int32 W;
/// <summary>
/// The W component.
/// </summary>
API_FIELD() int32 W;
};
// Raw values