using namespace HDK_Sample;
void
{
}
namespace HDK_Sample {
{
public:
#if defined(HOUDINI_11)
const GB_AttributeRef &massoffset,
const GB_AttributeRef &veloffset);
#else
#endif
const char *
name)
override;
private:
};
}
: myGdp(gdp)
, myObject(object)
, myTransform(xform)
, myTimestep(timestep)
, myMassHandle(masshandle)
, myVelHandle(velhandle)
{
}
SIM_HairForceCallback::~SIM_HairForceCallback()
{
}
void
{
force->
getPointForces(*
this, myObject, gdh, myTransform, 0, 0,
false);
}
void
{
float mass = myMassHandle.
get(ptoff);
myVelHandle.
set(ptoff, myVelHandle.
get(ptoff) + (force/
mass)*myTimestep);
}
{
}
SIM_SolverHair::~SIM_SolverHair()
{
}
SIM_SolverHair::getSolverHairDopDescription()
{
};
"hdk_hairsolver",
"Hair Solver",
classname(),
theTemplates);
return &theDopDescription;
}
void
{
for (
exint geonum = 0; geonum < srcobjs.
entries(); geonum++)
{
continue;
const GU_Detail *sourcegdp = sourcegdl.getGdp();
#if defined(HOUDINI_11)
const float one = 1.0;
sizeof(
float), GB_ATTRIB_FLOAT, &one);
#else
#endif
masshandle, velhandle);
object.forEachConstSubData(callback,
{
{
dp *= timestep;
}
}
{
if (primit.atEnd())
break;
{
UT_Vector3 startpos = sourcegdp->getPos3(sourceptoff);
startpos *= sourcexform;
vel += dv;
vel *= 0.8;
velhandle.set(hairpt0off, vel);
for (int ptnum = 1; ptnum < 10; ptnum++)
{
if (ptnum < 9)
dp = midline * (0.1 / midline.
length()) +
dv = dp / timestep;
vel = velhandle.get(hairpt1off);
vel += dv;
vel *= 0.8;
velhandle.set(hairpt1off, vel);
hairpt0off = hairpt1off;
hairpt1off = hairpt2off;
}
}
++primit;
}
}
}
void
{
for (
exint geonum = 0; geonum < srcobjs.
entries(); geonum++)
{
continue;
const GU_Detail *sourcegdp = sourcegdl.getGdp();
{
UT_Vector4 startpos = sourcegdp->getPos4(sourceptoff);
startpos *= sourcexform;
for (int i = 0; i < 10; i++)
{
}
}
}
}
bool newobject)
{
if( newobject )
{
{
object.getAffectors(sourceobjects, "SIM_RelationshipSource");
if( hairgeo && sourceobjects.
entries() > 0 )
}
}
else
{
if( hairgeo )
{
object.getAffectors(sourceobjects, "SIM_RelationshipSource");
if( hairgeo && sourceobjects.
entries() > 0 )
solveHair(*hairgeo, sourceobjects,
object, timestep);
}
}
}