1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-10 16:19:59 +00:00

Move hair functions to Entity; add quad_setSegs() & obj_setRealRenderPass()

This commit is contained in:
fgenesis 2013-01-03 00:36:24 +01:00
parent 366838d800
commit 32aca3b768
5 changed files with 85 additions and 63 deletions

View file

@ -3096,3 +3096,39 @@ bool Entity::doCollisionAvoidance(float dt, int search, float mod, Vector *vp, i
return false;
}
void Entity::initHair(int numSegments, int segmentLength, int width, const std::string &tex)
{
if (hair)
{
errorLog("Trying to init hair when hair is already present");
}
hair = new Hair(numSegments, segmentLength, width);
hair->setTexture(tex);
dsq->game->addRenderObject(hair, layer);
}
void Entity::setHairHeadPosition(const Vector &pos)
{
if (hair)
{
hair->setHeadPosition(pos);
}
}
void Entity::updateHair(float dt)
{
if (hair)
{
hair->updatePositions();
}
}
void Entity::exertHairForce(const Vector &force, float dt)
{
if (hair)
{
hair->exertForce(force, dt);
}
}