2
* dbo_plane.c - sample Dynamic Blob Op
4
* Description: a unit square in the xy-plane, at z=0,
5
* centered at the origin
6
* The blob expects a single float argument that gives
7
* the height at which the field goes to 0
9
* (c) 2003 SiTex Graphics, Inc.
15
EXPORT void ImplicitBound(State *s, float *bd,
17
int nfarg, float *farg,
18
int nsarg, char **sarg)
22
bd[2]=-0.5; bd[3]=0.5;
23
bd[4]=-farg[0]; bd[5]=farg[0];
26
float level(float v, float h)
28
float r=(v/h+1.0f)*0.5f;
34
EXPORT void ImplicitValue(State *s, float *result, float *p,
36
int nfarg, float *farg,
37
int nsarg, char **sarg)
39
if ((p[0]<-0.5)||(p[0]>0.5)||(p[1]<-0.5)||(p[1]>0.5)) {
42
result[0] = level(p[2],farg[0]);
47
EXPORT void ImplicitRange(State *s, float *rng,
50
int nfarg, float *farg,
51
int nsarg, char **sarg)
53
if ((bd[0]>0.5)||(bd[1]<-0.5)||(bd[2]>0.5)||(bd[3]<-0.5)||(bd[4]>farg[0])) {
54
rng[0]=1.0; rng[1]=1.0;
56
rng[0]=level(bd[4],farg[0]); rng[1]=level(bd[5],farg[0]);
60
EXPORT void ImplicitFree(State *s)