Fix large worlds build

This commit is contained in:
2026-09-10 05:03:06 +02:00
parent 848f8c105b
commit 740a04b9db
2 changed files with 40 additions and 6 deletions
+34
View File
@@ -181,6 +181,40 @@ namespace FlaxEngine
W = w;
}
/// <summary>
/// Initializes a new instance of the <see cref="Float4" /> struct.
/// </summary>
/// <param name="value">A vector containing the values with which to initialize the X, Y and Z components.</param>
public Float4(Vector3 value)
{
X = (float)value.X;
Y = (float)value.Y;
Z = (float)value.Z;
}
/// <summary>
/// Initializes a new instance of the <see cref="Float4" /> struct.
/// </summary>
/// <param name="value">A vector containing the values with which to initialize the X, Y and Z components.</param>
public Float4(Double3 value)
{
X = (float)value.X;
Y = (float)value.Y;
Z = (float)value.Z;
}
/// <summary>
/// Initializes a new instance of the <see cref="Float4" /> struct.
/// </summary>
/// <param name="value">A vector containing the values with which to initialize the X, Y and Z components.</param>
public Float4(Vector4 value)
{
X = (float)value.X;
Y = (float)value.Y;
Z = (float)value.Z;
W = (float)value.W;
}
/// <summary>
/// Initializes a new instance of the <see cref="Float4" /> struct.
/// </summary>
+6 -6
View File
@@ -319,10 +319,10 @@ namespace FlaxEngine.Networking
public void WriteVector3(Vector3 value)
{
#if USE_LARGE_WORLDS
var tmp = new Vector3(value);
WriteBytes((byte*)&tmp, sizeof(Vector3));
var tmp = new Float3(value);
WriteBytes((byte*)&tmp, sizeof(Float3));
#else
WriteBytes((byte*)&value, sizeof(Vector3));
WriteBytes((byte*)&value, sizeof(Float3));
#endif
}
@@ -340,10 +340,10 @@ namespace FlaxEngine.Networking
public void WriteVector4(Vector4 value)
{
#if USE_LARGE_WORLDS
var tmp = new Vector4(value);
WriteBytes((byte*)&tmp, sizeof(Vector4));
var tmp = new Float4(value);
WriteBytes((byte*)&tmp, sizeof(Float4));
#else
WriteBytes((byte*)&value, sizeof(Vector4));
WriteBytes((byte*)&value, sizeof(Float4));
#endif
}