mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Update debug interaction box drawing
This commit is contained in:
parent
01129f62b5
commit
06ee8fa4b8
2 changed files with 21 additions and 3 deletions
|
@ -331,9 +331,27 @@ void TestForObjectOnLedge(ItemInfo* item, CollisionInfo* coll)
|
||||||
|
|
||||||
bool TestLaraPosition(const ObjectCollisionBounds& bounds, ItemInfo* item, ItemInfo* laraItem)
|
bool TestLaraPosition(const ObjectCollisionBounds& bounds, ItemInfo* item, ItemInfo* laraItem)
|
||||||
{
|
{
|
||||||
|
constexpr auto DEBUG_BOX_COLOR = Color(1.0f, 0.0f, 0.0f);
|
||||||
|
|
||||||
|
// Draw oriented debug interaction box.
|
||||||
if (DebugMode)
|
if (DebugMode)
|
||||||
{
|
{
|
||||||
DrawDebugBox(bounds.BoundingBox.ToBoundingOrientedBox(item->Pose), Color(1.0f, 0.0f, 0.0f), RendererDebugPage::CollisionStats);
|
auto obb = bounds.BoundingBox.ToBoundingOrientedBox(item->Pose);
|
||||||
|
auto rotMatrix = item->Pose.Orientation.ToRotationMatrix();
|
||||||
|
|
||||||
|
DrawDebugBox(obb, DEBUG_BOX_COLOR, RendererDebugPage::CollisionStats);
|
||||||
|
DrawDebugLine(
|
||||||
|
obb.Center + Vector3::Transform(Vector3(0.0f, -obb.Extents.y, 0.0f), rotMatrix),
|
||||||
|
obb.Center + Vector3::Transform(Vector3(0.0f, -obb.Extents.y, obb.Extents.z), rotMatrix),
|
||||||
|
DEBUG_BOX_COLOR, RendererDebugPage::CollisionStats);
|
||||||
|
DrawDebugLine(
|
||||||
|
obb.Center + Vector3::Transform(Vector3(0.0f, -obb.Extents.y, obb.Extents.z), rotMatrix),
|
||||||
|
obb.Center + Vector3::Transform(Vector3(0.0f, obb.Extents.y, obb.Extents.z), rotMatrix),
|
||||||
|
DEBUG_BOX_COLOR, RendererDebugPage::CollisionStats);
|
||||||
|
DrawDebugLine(
|
||||||
|
obb.Center + Vector3::Transform(Vector3(0.0f, obb.Extents.y, 0.0f), rotMatrix),
|
||||||
|
obb.Center + Vector3::Transform(Vector3(0.0f, obb.Extents.y, obb.Extents.z), rotMatrix),
|
||||||
|
DEBUG_BOX_COLOR, RendererDebugPage::CollisionStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto deltaOrient = laraItem->Pose.Orientation - item->Pose.Orientation;
|
auto deltaOrient = laraItem->Pose.Orientation - item->Pose.Orientation;
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
#include "Renderer/Structures/RendererShader.h"
|
#include "Renderer/Structures/RendererShader.h"
|
||||||
#include "Specific/configuration.h"
|
#include "Specific/configuration.h"
|
||||||
#include "Specific/trutils.h"
|
#include "Specific/trutils.h"
|
||||||
#include "version.h"
|
#include "Version.h"
|
||||||
|
|
||||||
using namespace TEN::Utils;
|
|
||||||
using namespace TEN::Renderer::Structures;
|
using namespace TEN::Renderer::Structures;
|
||||||
|
using namespace TEN::Utils;
|
||||||
|
|
||||||
namespace TEN::Renderer::Utils
|
namespace TEN::Renderer::Utils
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue