Some revisions to grass brush.

- Made some changes to the way I check for deleting instances.
- Added a new bounding box check for painting grass.
- Made GetNewGrassBounds return a bounding box instead of our parameters
- Added new Expand method to bounding box util
- Added instance radius check and instance brush check to project form for possible future instance types (Props)
- Added grass brush gizmo
- Updated gui for grass instance batch panel
- Fixed bug with GoToPosition (with bounds)
This commit is contained in:
Soloman N
2018-06-10 09:36:50 -04:00
Unverified
parent b971beb5bf
commit 6bce9acbcd
7 changed files with 385 additions and 340 deletions
+27
View File
@@ -684,6 +684,33 @@ namespace CodeWalker.Rendering
}
public void RenderBrushRadiusOutline(Vector3 position, Vector3 dir, Vector3 up, float radius, uint col)
{
const int Reso = 36;
const float MaxDeg = 360f;
const float DegToRad = 0.0174533f;
const float Ang = MaxDeg / Reso;
var axis = Vector3.Cross(dir, up);
var c = new VertexTypePC[Reso];
for (var i = 0; i < Reso; i++)
{
var rDir = Quaternion.RotationAxis(dir, (i * Ang) * DegToRad).Multiply(axis);
c[i].Position = position + (rDir * radius);
c[i].Colour = col;
}
for (var i = 0; i < c.Length; i++)
{
SelectionLineVerts.Add(c[i]);
SelectionLineVerts.Add(c[(i + 1) % c.Length]);
}
SelectionLineVerts.Add(new VertexTypePC{Colour = col, Position = position});
SelectionLineVerts.Add(new VertexTypePC { Colour = col, Position = position + dir * 2f});
}
public void RenderSelectionArrowOutline(Vector3 pos, Vector3 dir, Vector3 up, Quaternion ori, float len, float rad, uint colour)
{
Vector3 ax = Vector3.Cross(dir, up);