Added support for debug drawing wireframe capsules #302

Merged
Pycorax merged 4 commits from SP3-1-DebugDraw into main 2023-01-08 12:20:11 +08:00
1 changed files with 5 additions and 5 deletions
Showing only changes of commit f44e7b7a1c - Show all commits

View File

@ -362,12 +362,12 @@ namespace SHADE
void SHDebugDrawSystem::drawWireCapsule(LinesBatch& lineBatch, MeshBatch& meshBatch, const SHVec3& position, const SHQuaternion& rotation, float height, float radius, const SHColour& color)
{
// Get local axis vectors
const SHVec3 LOCAL_UP = SHVec3::Up;
const SHVec3 LOCAL_RIGHT = SHVec3::Right;
const SHVec3 LOCAL_FORWARD = SHVec3::Forward;
const SHVec3 LOCAL_UP = SHVec3::Rotate(SHVec3::Up, rotation);
const SHVec3 LOCAL_RIGHT = SHVec3::Rotate(SHVec3::Right, rotation);
const SHVec3 LOCAL_FORWARD = SHVec3::Rotate(SHVec3::Forward, rotation);
// Rotate the circle
SHQuaternion circleOrientation = SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(90.0), 0.0f, 0.0f));
SHQuaternion circleOrientation = SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(90.0), 0.0f, 0.0f)) * rotation;
// Compute top and bottom of the cylinder
const SHVec3 HALF_UP = LOCAL_UP * (height * 0.5f - radius);
@ -396,7 +396,7 @@ namespace SHADE
const SHMatrix BOT_CAP_MAT = SHMatrix::Transform
(
BOT_POS,
rotation * SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(180.0), 0.0f, 0.0f)),
SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(180.0), 0.0f, 0.0f)) * rotation,
RADIUS_SCALE
);
drawMesh