mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 22:54:46 +08:00
Collisions editing progress
This commit is contained in:
+47
-6
@@ -3136,18 +3136,34 @@ namespace CodeWalker.Project
|
||||
return true;
|
||||
}
|
||||
|
||||
var parent = CurrentCollisionBounds.Parent;
|
||||
|
||||
bool res = false;
|
||||
if (WorldForm != null)
|
||||
{
|
||||
lock (WorldForm.RenderSyncRoot) //don't try to do this while rendering...
|
||||
{
|
||||
res = CurrentYbnFile.RemoveBounds(CurrentCollisionBounds);
|
||||
if (parent != null)
|
||||
{
|
||||
res = parent.DeleteChild(CurrentCollisionBounds);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CurrentYbnFile.RemoveBounds(CurrentCollisionBounds);
|
||||
}
|
||||
//WorldForm.SelectItem(null, null, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CurrentYbnFile.RemoveBounds(CurrentCollisionBounds);
|
||||
if (parent != null)
|
||||
{
|
||||
res = parent.DeleteChild(CurrentCollisionBounds);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CurrentYbnFile.RemoveBounds(CurrentCollisionBounds);
|
||||
}
|
||||
}
|
||||
if (!res)
|
||||
{
|
||||
@@ -3163,8 +3179,20 @@ namespace CodeWalker.Project
|
||||
|
||||
CurrentCollisionBounds = null;
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
if (WorldForm != null)
|
||||
{
|
||||
WorldForm.UpdateCollisionBoundsGraphics(parent);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
public bool IsCurrentCollisionBounds(Bounds bounds)
|
||||
{
|
||||
return bounds == CurrentCollisionBounds;
|
||||
}
|
||||
|
||||
public void NewCollisionPoly(BoundPolygonType type, BoundPolygon copy = null)
|
||||
{
|
||||
@@ -3218,13 +3246,13 @@ namespace CodeWalker.Project
|
||||
{
|
||||
lock (WorldForm.RenderSyncRoot) //don't try to do this while rendering...
|
||||
{
|
||||
res = CurrentYbnFile.RemovePoly(CurrentCollisionPoly);
|
||||
res = CurrentCollisionPoly.Owner.DeletePolygon(CurrentCollisionPoly);
|
||||
//WorldForm.SelectItem(null, null, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CurrentYbnFile.RemovePoly(CurrentCollisionPoly);
|
||||
res = CurrentCollisionPoly.Owner.DeletePolygon(CurrentCollisionPoly);
|
||||
}
|
||||
if (!res)
|
||||
{
|
||||
@@ -3240,8 +3268,17 @@ namespace CodeWalker.Project
|
||||
|
||||
CurrentCollisionPoly = null;
|
||||
|
||||
if (WorldForm != null)
|
||||
{
|
||||
WorldForm.UpdateCollisionBoundsGraphics(CurrentCollisionBounds);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
public bool IsCurrentCollisionPoly(BoundPolygon poly)
|
||||
{
|
||||
return poly == CurrentCollisionPoly;
|
||||
}
|
||||
|
||||
public void AddCollisionVertexToProject()
|
||||
{
|
||||
@@ -3288,13 +3325,13 @@ namespace CodeWalker.Project
|
||||
{
|
||||
lock (WorldForm.RenderSyncRoot) //don't try to do this while rendering...
|
||||
{
|
||||
res = CurrentYbnFile.RemoveVertex(CurrentCollisionVertex);
|
||||
res = CurrentCollisionVertex.Owner.DeleteVertex(CurrentCollisionVertex.Index);
|
||||
//WorldForm.SelectItem(null, null, null);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res = CurrentYbnFile.RemoveVertex(CurrentCollisionVertex);
|
||||
res = CurrentCollisionVertex.Owner.DeleteVertex(CurrentCollisionVertex.Index);
|
||||
}
|
||||
if (!res)
|
||||
{
|
||||
@@ -3312,6 +3349,10 @@ namespace CodeWalker.Project
|
||||
|
||||
return true;
|
||||
}
|
||||
public bool IsCurrentCollisionVertex(BoundVertex vertex)
|
||||
{
|
||||
return vertex == CurrentCollisionVertex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user