1
0

Add a formatting function for Vector3 (#4282)

* Vector3: Add custom fmt compatible formatter.

* cLuaState: Add fmt version of ApiParamError

* Use vector formatting in manual bindings

* Always log vectors with FLOG
This commit is contained in:
peterbell10
2018-09-24 21:33:39 +01:00
committed by Alexander Harkness
parent 73689024f0
commit 4727ed2084
27 changed files with 192 additions and 181 deletions

View File

@@ -60,11 +60,11 @@ protected:
{
/*
// DEBUG:
LOGD("Hit block %d:%d at {%d, %d, %d} face %d, %s (%s)",
FLOGD("Hit block {0}:{1} at {2} face {3}, {4} ({5})",
a_BlockType, a_BlockMeta,
a_BlockX, a_BlockY, a_BlockZ, a_EntryFace,
Vector3i{a_BlockX, a_BlockY, a_BlockZ}, a_EntryFace,
cBlockInfo::IsSolid(a_BlockType) ? "solid" : "non-solid",
ItemToString(cItem(a_BlockType, 1, a_BlockMeta)).c_str()
ItemToString(cItem(a_BlockType, 1, a_BlockMeta))
);
*/
@@ -306,10 +306,8 @@ void cProjectileEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
SetSpeed(0, 0, 0);
// DEBUG:
LOGD("Projectile %d: pos {%.02f, %.02f, %.02f}, hit solid block at face %d",
m_UniqueID,
a_HitPos.x, a_HitPos.y, a_HitPos.z,
a_HitFace
FLOGD("Projectile {0}: pos {1:.02f}, hit solid block at face {2}",
m_UniqueID, a_HitPos, a_HitFace
);
m_IsInGround = true;
@@ -401,11 +399,11 @@ void cProjectileEntity::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a
Vector3d HitPos = Pos + (NextPos - Pos) * EntityCollisionCallback.GetMinCoeff();
// DEBUG:
LOGD("Projectile %d has hit an entity %d (%s) at {%.02f, %.02f, %.02f} (coeff %.03f)",
FLOGD("Projectile {0} has hit an entity {1} ({2}) at {3:.02f} (coeff {4:.03f})",
m_UniqueID,
EntityCollisionCallback.GetHitEntity()->GetUniqueID(),
EntityCollisionCallback.GetHitEntity()->GetClass(),
HitPos.x, HitPos.y, HitPos.z,
HitPos,
EntityCollisionCallback.GetMinCoeff()
);
@@ -438,11 +436,8 @@ void cProjectileEntity::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a
SetPitchFromSpeed();
/*
LOGD("Projectile %d: pos {%.02f, %.02f, %.02f}, speed {%.02f, %.02f, %.02f}, rot {%.02f, %.02f}",
m_UniqueID,
GetPosX(), GetPosY(), GetPosZ(),
GetSpeedX(), GetSpeedY(), GetSpeedZ(),
GetYaw(), GetPitch()
FLOGD("Projectile {0}: pos {1:.02f}, speed {2:.02f}, rot {{{3:.02f}, {4:.02f}}}",
m_UniqueID, GetPos(), GetSpeed(), GetYaw(), GetPitch()
);
*/
}