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:
parent
366838d800
commit
32aca3b768
5 changed files with 85 additions and 63 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue