mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-04 02:24:00 +00:00
Remove RenderObject::collidePosition and related code
This was always (0, 0) and optionally used for bones if defined in skeletal files. None of the official skeletal files used this, so this should be safe to remove.
This commit is contained in:
parent
d4a1e1ef1d
commit
35a3888c94
5 changed files with 5 additions and 21 deletions
|
@ -2767,7 +2767,6 @@ void Game::generateCollisionMask(Quad *q, float overrideCollideRadius /* = 0 */)
|
|||
#ifdef BBGE_BUILD_OPENGL
|
||||
if (q->texture)
|
||||
{
|
||||
q->collidePosition = Vector(0,0,0);
|
||||
if (overrideCollideRadius)
|
||||
q->collideRadius = overrideCollideRadius;
|
||||
else
|
||||
|
|
|
@ -364,7 +364,7 @@ Vector RenderObject::getWorldCollidePosition(const Vector &vec)
|
|||
#ifdef BBGE_USE_GLM
|
||||
glm::mat4 transformMatrix = glm::translate(
|
||||
matrixChain(this),
|
||||
glm::vec3(collidePosition.x + vec.x, collidePosition.y + vec.y, 0.0f)
|
||||
glm::vec3(vec.x, vec.y, 0.0f)
|
||||
);
|
||||
|
||||
return Vector(transformMatrix[3][0], transformMatrix[3][1], 0);
|
||||
|
@ -374,7 +374,7 @@ Vector RenderObject::getWorldCollidePosition(const Vector &vec)
|
|||
glLoadIdentity();
|
||||
|
||||
matrixChain(this);
|
||||
glTranslatef(collidePosition.x+vec.x, collidePosition.y+vec.y, 0);
|
||||
glTranslatef(vec.x, vec.y, 0);
|
||||
|
||||
float m[16];
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, m);
|
||||
|
|
|
@ -282,7 +282,6 @@ public:
|
|||
#endif
|
||||
|
||||
float collideRadius;
|
||||
Vector collidePosition;
|
||||
std::vector<Vector> collisionMask;
|
||||
std::vector<Vector> transformedCollisionMask;
|
||||
|
||||
|
|
|
@ -969,9 +969,6 @@ bool SkeletalSprite::saveSkeletal(const std::string &fn)
|
|||
}
|
||||
bone->SetAttribute("crects", os.str().c_str());
|
||||
}
|
||||
std::ostringstream os;
|
||||
os << this->bones[i]->collidePosition.x << " " << this->bones[i]->collidePosition.y;
|
||||
bone->SetAttribute("cp", os.str().c_str());
|
||||
if (this->bones[i]->rbp)
|
||||
bone->SetAttribute("rbp", this->bones[i]->rbp);
|
||||
if (this->bones[i]->originalRenderPass)
|
||||
|
@ -1129,7 +1126,7 @@ Bone *SkeletalSprite::getBoneByIdx(int idx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
Bone *SkeletalSprite::initBone(int idx, std::string gfx, int pidx, int rbp, std::string name, float cr, bool fh, bool fv, const Vector &cp)
|
||||
Bone *SkeletalSprite::initBone(int idx, std::string gfx, int pidx, int rbp, std::string name, float cr, bool fh, bool fv)
|
||||
{
|
||||
Bone *b = new Bone;
|
||||
b->boneIdx = idx;
|
||||
|
@ -1140,7 +1137,6 @@ Bone *SkeletalSprite::initBone(int idx, std::string gfx, int pidx, int rbp, std:
|
|||
b->renderBeforeParent = rbp;
|
||||
b->pidx = pidx;
|
||||
b->collideRadius = cr;
|
||||
b->collidePosition = cp;
|
||||
b->name = name;
|
||||
//core->generateCollisionMask(b);
|
||||
if (fh)
|
||||
|
@ -1381,7 +1377,6 @@ void SkeletalSprite::loadSkeletal(const std::string &fn)
|
|||
int pidx = -1, rbp=0, cr=0, fh=0, fv=0;
|
||||
|
||||
std::string name;
|
||||
Vector cp;
|
||||
if (bone->Attribute("pidx"))
|
||||
pidx = atoi(bone->Attribute("pidx"));
|
||||
if (bone->Attribute("rbp"))
|
||||
|
@ -1395,18 +1390,9 @@ void SkeletalSprite::loadSkeletal(const std::string &fn)
|
|||
fh = atoi(bone->Attribute("fh"));
|
||||
if (bone->Attribute("fv"))
|
||||
fv = atoi(bone->Attribute("fv"));
|
||||
if (bone->Attribute("cp"))
|
||||
{
|
||||
SimpleIStringStream is(bone->Attribute("cp"));
|
||||
is >> cp.x >> cp.y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std::string gfx = bone->Attribute("gfx");
|
||||
Bone *newb = initBone(idx, gfx, pidx, rbp, name, cr, fh, fv, cp);
|
||||
Bone *newb = initBone(idx, gfx, pidx, rbp, name, cr, fh, fv);
|
||||
if (bone->Attribute("offx"))
|
||||
newb->offset.x = atoi(bone->Attribute("offx"));
|
||||
if (bone->Attribute("offy"))
|
||||
|
|
|
@ -278,7 +278,7 @@ protected:
|
|||
int selectedBone;
|
||||
friend class AnimationLayer;
|
||||
std::vector<AnimationLayer> animLayers;
|
||||
Bone* initBone(int idx, std::string gfx, int pidx, int rbp=0, std::string name="", float cr=0, bool fh=false, bool fv=false, const Vector &cp=Vector(0,0,0));
|
||||
Bone* initBone(int idx, std::string gfx, int pidx, int rbp=0, std::string name="", float cr=0, bool fh=false, bool fv=false);
|
||||
void deleteBones();
|
||||
void onUpdate(float dt);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue