mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-16 20:17:30 +08:00
Fix for BoundVertex going out of range on XML import
This commit is contained in:
parent
05bd42f3a6
commit
4b65af9d74
@ -4465,15 +4465,20 @@ namespace CodeWalker.GameFiles
|
||||
|
||||
public BoundVertex_s(Vector3 v)
|
||||
{
|
||||
X = (short)v.X;
|
||||
Y = (short)v.Y;
|
||||
Z = (short)v.Z;
|
||||
X = (short)Math.Min(Math.Max(v.X, -32767f), 32767f);
|
||||
Y = (short)Math.Min(Math.Max(v.Y, -32767f), 32767f);
|
||||
Z = (short)Math.Min(Math.Max(v.Z, -32767f), 32767f);
|
||||
}
|
||||
|
||||
public Vector3 Vector
|
||||
{
|
||||
get { return new Vector3(X, Y, Z); }
|
||||
set { X = (short)value.X; Y = (short)value.Y; Z = (short)value.Z; }
|
||||
set
|
||||
{
|
||||
X = (short)Math.Min(Math.Max(value.X, -32767f), 32767f);
|
||||
Y = (short)Math.Min(Math.Max(value.Y, -32767f), 32767f);
|
||||
Z = (short)Math.Min(Math.Max(value.Z, -32767f), 32767f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user