Convert Int3 to generated type.

This commit is contained in:
Jean-Baptiste Perrier
2021-04-08 18:46:56 +02:00
parent 8661c2af18
commit 224937cd09
2 changed files with 15 additions and 24 deletions

View File

@@ -12,9 +12,8 @@ namespace FlaxEngine
/// Represents a three dimensional mathematical vector (signed integers).
/// </summary>
[Serializable]
[StructLayout(LayoutKind.Sequential, Pack = 4)]
[TypeConverter(typeof(TypeConverters.Int3Converter))]
public struct Int3 : IEquatable<Int3>, IFormattable
partial struct Int3 : IEquatable<Int3>, IFormattable
{
private static readonly string _formatString = "X:{0} Y:{1} Z:{2}";
@@ -58,21 +57,6 @@ namespace FlaxEngine
/// </summary>
public static readonly Int3 Maximum = new Int3(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>
/// Initializes a new instance of the <see cref="Int3" /> struct.
/// </summary>

View File

@@ -13,22 +13,29 @@ struct Vector4;
/// <summary>
/// Three-components vector (32 bit integer type).
/// </summary>
API_STRUCT(InBuild) struct FLAXENGINE_API Int3
API_STRUCT() struct FLAXENGINE_API Int3
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Int3);
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;
// Y component
int32 Z;
/// <summary>
/// The Z component.
/// </summary>
API_FIELD() int32 Z;
};
// Raw values