
beginSETUP
// MODE 'Add' can be applied
fl_modeAdd	= 1

// MODE 'Compare' can be applied
fl_modeCompare	= 1

// MODE 'Force' can be applied
fl_modeForce	= 0

// Computes points only within modifier square radius
fl_squareRadius	= 0

// Computes points only within modifier radius
fl_Radius	= 0

// Height can't never be negative
fl_positiveHeight	= 0
endSETUP

//////////////////////////////////////////////
//
//	PX PY PZ - current point to modify
//	MX MY    - modifier position
//	MH MR    - modifier height and radius
//	MAXZ     - max z value of the grid
//	MINZ     - min z value of the grid
//	PI       - pigreco 3.14 etc etc
//	NEWZ     - when you want, load here the new value for Z
//
// this modifier does:	
//
//
//	d = distance ( P , M )
//	if (MH>=0)
//	{
//		NEWZ = sqrt( sqr(MR) - sqr(d) )
//	}
//	else
//	{
//		NEWZ = - sqrt( sqr(MR) - sqr(d) )
//	}
//		
//	NEWZ = NEWZ + MH
//
beginCODE

	ex_dist2 d2,PX,PY,MX,MY

	mov NEWZ,MR
	sqr NEWZ
	sub NEWZ,d2
	sqrt NEWZ

	cmp MH,0
	jge greater

	opp NEWZ

	greater:

	add NEWZ,MH		

endCODE
