1
This commit is contained in:
parent
490491df00
commit
90b3684bf8
@ -15,6 +15,8 @@ void ReverseBuff::Activate()
|
|||||||
{
|
{
|
||||||
hold_param1_ = meta->GetBuffParam1(this);
|
hold_param1_ = meta->GetBuffParam1(this);
|
||||||
if (caster_.Get()) {
|
if (caster_.Get()) {
|
||||||
|
if (!GlmHelper::IsEqual2D(caster_.Get()->GetPos().ToGlmVec3(),
|
||||||
|
owner->GetPos().ToGlmVec3())) {
|
||||||
glm::vec3 dir = caster_.Get()->GetPos().CalcDir(owner->GetPos());
|
glm::vec3 dir = caster_.Get()->GetPos().CalcDir(owner->GetPos());
|
||||||
if ((std::isfinite(dir.x) &&
|
if ((std::isfinite(dir.x) &&
|
||||||
std::isfinite(dir.z))) {
|
std::isfinite(dir.z))) {
|
||||||
@ -26,6 +28,8 @@ void ReverseBuff::Activate()
|
|||||||
owner->ForwardMove(hold_param1_);
|
owner->ForwardMove(hold_param1_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,3 +71,8 @@ void GlmHelper::FillVert(const glm::vec3& v, float* vert)
|
|||||||
vert[1] = v.y;
|
vert[1] = v.y;
|
||||||
vert[2] = v.z;
|
vert[2] = v.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GlmHelper::IsEqual2D(const glm::vec3& v1, const glm::vec3& v2)
|
||||||
|
{
|
||||||
|
return std::abs(v1.x - v2.x) > 0.00001f || std::abs(v1.z - v2.z) > 0.00001f;
|
||||||
|
}
|
||||||
|
@ -13,6 +13,8 @@ class GlmHelper
|
|||||||
static float Norm(const glm::vec3& v);
|
static float Norm(const glm::vec3& v);
|
||||||
static bool IsZero(const glm::vec3& v);
|
static bool IsZero(const glm::vec3& v);
|
||||||
|
|
||||||
|
static bool IsEqual2D(const glm::vec3& v1, const glm::vec3& v2);
|
||||||
|
|
||||||
static float CalcAngle(const glm::vec3& v1, const glm::vec3& v2);
|
static float CalcAngle(const glm::vec3& v1, const glm::vec3& v2);
|
||||||
|
|
||||||
static void FillVert(const glm::vec3& v, float* vert);
|
static void FillVert(const glm::vec3& v, float* vert);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user