using namespace HDK_Sample;
void
{
"hdk_sparticle",
"Simple Particle",
1,
2,
0));
}
};
};
int *
SOP_SParticle::myOffsets = 0;
{
}
, mySystem(NULL)
{
if (!myOffsets)
myOffsets = allocIndirect(32);
myVelocity.clear();
}
SOP_SParticle::~SOP_SParticle() {}
void
{
if (mySource)
{
mySourceNum = 0;
mySourceNum++;
}
{
myVelocity.
set(ptoff, mySourceVel.
get(srcptoff));
else
}
else
{
}
}
int
{
float death = myLife.
get(ptoff, 1);
life += 1;
myLife.
set(ptoff, life, 0);
if (life >= death)
return 0;
float tinc = 1./30.;
myVelocity.
set(ptoff, vel);
if (myCollision)
{
if (myCollision->
sendRay(start, dir, info) > 0)
return 0;
}
pos += tinc*vel;
return 1;
}
void
{
int nbirth = BIRTH(now);
return;
for (int i = 0; i < nbirth; ++i)
{
}
}
void
{
{
mySourceNum = 0;
}
}
{
if (currframe <= reset || !mySystem)
{
}
else
{
if (collision)
{
myCollision->
init(collision);
}
else myCollision = 0;
if (mySource)
{
}
currframe += 0.05;
while (myLastCookTime < currframe)
{
myLastCookTime += 1;
}
if (myCollision) delete myCollision;
}
}
const char *
{
switch (inum)
{
case 0: return "Particle Source Geometry";
case 1: return "Collision Object";
}
return "Unknown source";
}