mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-16 15:52:32 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user