First Brush commands nearly done. I have coded it in such a way that once the first brush command works, it will be very easy to add more.
The system calls a function that computes a brush. It passes a function pointer to this function to the function which calculates the point heights. Heres 2 of functions that will be used.
float BT_CircleBrush_Raise(float XDist,float ZDist,float MidHeight,float Radius,float Amount,float CurrentHeight)
{
return CurrentHeight+((cos(float(sqrt(XDist*XDist+ZDist*ZDist)*90.0/Radius))+1)/2)*Amount;
}
float BT_CircleBrush_Flatten(float XDist,float ZDist,float MidHeight,float Radius,float Amount,float CurrentHeight)
{
return MidHeight;
}
Parameters:
X dist: X distance from the centre of the brush to this vertex.
Y dist: Y distance from the centre of the brush to this vertex.
MidHeight: Height of the centre of the brush.
Radius: The radius of the brush.
Amount: The amount the vertex must be moved.
CurrentHeight: Current height of this vertex.
It returns the new height of the vertex.
This part of BlitzTerrain will be released open source to pro users so you will be able to write your own brushes and find out how to use the BlitzTerrain internals.