#define MIN_CHUNK 8
#define SPRITE_LIMIT 1000
#define META_CORRECT 0.5
#define DEFAULT_ATTRIB_PATTERN ""
#define DEFAULT_SIZE 0.05F
namespace HDK_Sample {
class ray_SpriteAttribMap
{
public:
};
}
using namespace HDK_Sample;
};
{
public:
{
}
};
void
{
}
static void
{
while (map)
{
delete map;
map = next;
}
}
static void
{
if (!gdp)
return;
{
if (
name.multiMatch(pattern))
{
{
map->mySourceAttrib = atr;
map->myDIndex = index++;
map->myNext = maphead;
maphead = map;
}
}
}
}
{
myVelBox = myBox;
myParms = 0;
}
static void
{
vbox = box;
{
vel *= tscale;
}
}
int
{
myParms = sprite->
myParms;
{
{
}
}
{
getRoughSpriteBox(tbox, tvbox, *gdp, ptoff, sprite_scale,
if (i == 0)
{
myBox = tbox;
myVelBox = tvbox;
}
else
{
}
}
return 0;
return 1;
}
{
{
delete myParms;
}
}
const char *
{
return "sprite";
}
int
{
int vblur;
name = 0;
if (import("object", str))
name = str.
isstring() ? (
const char *)str : 0;
if (!handle)
{
return 0;
}
name = queryObjectName(handle);
gdp = myParms->
myGdp = parent_geo.
get();
if (!gdp)
{
return 0;
}
if (!
import(
"object:velocityscale", &myParms->
myTimeScale, 1))
vblur = 0;
import("object:velocityblur", &vblur, 1);
if (scale[0] < 0)
"spritescale", 2));
"spriterot", 1));
"spriteshop", 1));
"spriteuv", 3));
if (vblur)
{
str = 0;
import("velocity", str);
{
RAYwarning(
"%s object (%s) couldn't find the '%s' attribute",
}
}
{
getRoughSpriteBox(tbox, tvbox, *gdp, ptoff, sprite_scale,
if (i == 0)
{
myBox = tbox;
myVelBox = tvbox;
}
else
{
}
++i;
}
{
return 1;
}
str = 0;
import("attribute", str);
if (box)
{
{
return 0;
}
}
return 1;
}
void
{
box = myBox;
}
static void
{
while (map)
{
copy->
copy(*dest_attrib, destoff, *map->mySourceAttrib, srcptoff);
map = map->myNext;
}
}
static void
{
P *= xform;
}
static void
convertPath(
const char *src_path,
const char *
path,
UT_String &full_path)
{
if (path && strlen(path) > 0 && path[0] != '/')
{
full_path = src_path;
full_path += "/";
}
else
}
static int
{
{
{
{
}
}
{
for (
auto map = parms.
myAttribMap; map; map = map->myNext)
{
UT_ASSERT(dest_attribs(map->myDIndex) != NULL);
}
}
}
{
{
}
{
}
::transformPoint(*gdp, ptoff, -
size.x(), -
size.y(), xform);
{
}
++ptoff;
::transformPoint(*gdp, ptoff,
size.x(), -
size.y(), xform);
{
}
++ptoff;
::transformPoint(*gdp, ptoff,
size.x(),
size.y(), xform);
{
}
++ptoff;
::transformPoint(*gdp, ptoff, -
size.x(),
size.y(), xform);
{
}
++ptoff;
{
convertPath(srcpath, path, full_path);
}
poly,
*src, srcptoff);
++primoff;
}
}
static void
{
{
for (
int j = 0;
j < 4;
j++)
{
}
}
}
static inline int
{
if (divs < 1) divs = 1;
else if (divs > 4) divs = 4;
}
void
{
int dogeo;
int ix, iy, iz;
fpreal xinc, yinc, zinc, factor;
return;
dogeo = 1;
{
dogeo = 0;
dfactor = (xinc+yinc+zinc)/max;
if (factor > 4)
factor = 4;
max /= factor;
nx = ::computeDivs(xinc, max);
ny = ::computeDivs(yinc, max);
nz = ::computeDivs(zinc, max);
if (nx == 1 && ny == 1 && nz == 1)
{
if (xinc > yinc)
{
if (xinc > zinc) nx = 2;
else nz = 2;
}
else
{
if (yinc > zinc) ny = 2;
else nz = 2;
}
}
for (iz = 0, zv = myBox.
vals[2][0]; iz < nz; iz++, zv += zinc)
{
for (iy = 0, yv = myBox.
vals[1][0]; iy < ny; iy++, yv += yinc)
{
for (ix = 0, xv = myBox.
vals[0][0]; ix < nx; ix++, xv += xinc)
{
delete kid;
else
{
child->addProcedural(kid);
}
}
}
}
}
if (dogeo)
{
if (makeSpritePoly(geo.
get(), getPointGdp(), myPointList, *myParms,
{
if (myParms->myVelH.isValid())
{
velocityMove(geo.
get(), vpos, getPointGdp(), myPointList,
myParms->myVelH, getTime());
}
obj->addGeometry(geo);
}
}
}