@WorldBrushClass.h 1.5 KB

123456789101112131415161718192021222324252627282930
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class WorldBrushClass : BrushClass
  4. {
  5. flt size, speed, soft;
  6. WorldBrushClass& create(GuiObj &parent);
  7. // get
  8. virtual bool hasMsWheelFocus()C override;
  9. bool affects(C Edge2 &edge, C VecI2 &xz)C;
  10. RectI affectedAreas(C Edge2 &edge)C;
  11. RectI affectedAreas(int mouse_button=-1)C; // always calculate on demand, and for example not in 'update' because that method may get called later in frame than when other codes need it (resulting in 1 frame delay which could result in wrong behavior)
  12. bool affected(C VecI2 &xz)C; // if area of 'xz' coordinates is affected by brush, this is more precise than the 'affectedAreas'
  13. flt power(C Vec2 &pos, bool texture=true, Cursor &cur=WorldEdit.cur)C; // get brush power (0..1) at world XZ position, 'texture'=if allow applying image coverage, 'cur'=get power from specified cursor
  14. flt powerTotal(C Vec2 &pos, bool texture=true)C; // get brush power (0..1) at world XZ position, 'texture'=if allow applying image coverage, get power from all cursors
  15. Vec randomPos(bool align_heightmap)C;
  16. void setVisibility();
  17. virtual void update(C GuiPC &gpc)override;
  18. };
  19. /******************************************************************************/
  20. /******************************************************************************/
  21. extern WorldBrushClass Brush;
  22. /******************************************************************************/