Collisions editing progress

This commit is contained in:
dexy
2020-01-07 20:51:53 +11:00
Unverified
parent edba2cfae9
commit 3c60801e84
12 changed files with 1113 additions and 7 deletions
+37
View File
@@ -188,6 +188,7 @@ namespace CodeWalker
public WaterQuad WaterQuad { get; set; }
public Bounds CollisionBounds { get; set; }
public BoundPolygon CollisionPoly { get; set; }
public BoundVertex CollisionVertex { get; set; }
public YnvPoly NavPoly { get; set; }
public YnvPoint NavPoint { get; set; }
public YnvPortal NavPortal { get; set; }
@@ -226,6 +227,7 @@ namespace CodeWalker
(WaterQuad != null) ||
(CollisionBounds != null) ||
(CollisionPoly != null) ||
(CollisionVertex != null) ||
(NavPoly != null) ||
(NavPoint != null) ||
(NavPortal != null) ||
@@ -264,6 +266,7 @@ namespace CodeWalker
|| (WaterQuad != mhit.WaterQuad)
|| (CollisionBounds != mhit.CollisionBounds)
|| (CollisionPoly != mhit.CollisionPoly)
|| (CollisionVertex != mhit.CollisionVertex)
|| (NavPoly != mhit.NavPoly)
|| (NavPoint != mhit.NavPoint)
|| (NavPortal != mhit.NavPortal)
@@ -290,6 +293,7 @@ namespace CodeWalker
|| (WaterQuad != null)
|| (CollisionBounds != null)
|| (CollisionPoly != null)
|| (CollisionVertex != null)
|| (NavPoly != null)
|| (NavPoint != null)
|| (NavPortal != null)
@@ -318,6 +322,7 @@ namespace CodeWalker
WaterQuad = null;
CollisionBounds = null;
CollisionPoly = null;
CollisionVertex = null;
NavPoly = null;
NavPoint = null;
NavPortal = null;
@@ -371,6 +376,10 @@ namespace CodeWalker
{
name = "OccludeModel " + (OccludeModel.Ymap?.Name ?? "") + ": " + OccludeModel.Index.ToString();
}
else if (CollisionVertex != null)
{
name = "Vertex " + CollisionVertex.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
}
else if (CollisionPoly != null)
{
name = "Poly " + CollisionPoly.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
@@ -441,6 +450,10 @@ namespace CodeWalker
{
name = Archetype.Hash.ToString();
}
else if (CollisionVertex != null)
{
name = "Vertex " + CollisionVertex.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
}
else if (CollisionPoly != null)
{
name = "Poly " + CollisionPoly.Index.ToString() + ((CollisionBounds != null) ? (": " + CollisionBounds.GetName()) : string.Empty);
@@ -540,6 +553,10 @@ namespace CodeWalker
{
res = true;
}
else if (CollisionVertex != null)
{
res = true;
}
else if (CollisionPoly != null)
{
res = true;
@@ -591,6 +608,10 @@ namespace CodeWalker
{
return CarGenerator.Position;
}
else if (CollisionVertex != null)
{
return CollisionVertex.Position;
}
else if (CollisionPoly != null)
{
return CollisionPoly.Position;
@@ -646,6 +667,10 @@ namespace CodeWalker
{
return CarGenerator.Orientation;
}
else if (CollisionVertex != null)
{
return Quaternion.Identity;
}
else if (CollisionPoly != null)
{
return Quaternion.Identity;
@@ -701,6 +726,10 @@ namespace CodeWalker
{
return WidgetAxis.Z;
}
else if (CollisionVertex != null)
{
return WidgetAxis.None;
}
else if (CollisionPoly != null)
{
return WidgetAxis.XYZ;
@@ -756,6 +785,10 @@ namespace CodeWalker
{
return new Vector3(CarGenerator.CCarGen.perpendicularLength);
}
else if (CollisionVertex != null)
{
return Vector3.One;
}
else if (CollisionPoly != null)
{
return Vector3.One;
@@ -824,6 +857,10 @@ namespace CodeWalker
{
PathNode.SetPosition(newpos);
}
else if (CollisionVertex != null)
{
CollisionVertex.Position = newpos;
}
else if (CollisionPoly != null)
{
CollisionPoly.Position = newpos;