Added Capsule Collider, AABB Query & SimulateBody for Trajectory path prediction #402
|
@ -375,7 +375,7 @@ namespace SHADE
|
|||
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)) * rotation;
|
||||
SHQuaternion circleOrientation = SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(90.0f), 0.0f, 0.0f)) * rotation;
|
||||
|
||||
// Compute top and bottom of the cylinder
|
||||
const SHVec3 HALF_UP = LOCAL_UP * (height * 0.5f);
|
||||
|
@ -383,7 +383,7 @@ namespace SHADE
|
|||
const SHVec3 BOT_POS = position - HALF_UP;
|
||||
|
||||
// Render circles
|
||||
const SHVec3 CIRCLE_SCALE = SHVec3(radius * 2.0f, radius * 2.0, radius * 2.0);
|
||||
const SHVec3 CIRCLE_SCALE = SHVec3(radius * 2.0f, radius * 2.0f, radius * 2.0f);
|
||||
drawCircle(meshBatch, SHMatrix::Transform(TOP_POS, circleOrientation, CIRCLE_SCALE), color);
|
||||
drawCircle(meshBatch, SHMatrix::Transform(BOT_POS, circleOrientation, CIRCLE_SCALE), color);
|
||||
|
||||
|
@ -394,7 +394,7 @@ namespace SHADE
|
|||
drawLine(lineBatch, TOP_POS - LOCAL_FORWARD * radius, BOT_POS - LOCAL_FORWARD * radius, color);
|
||||
|
||||
// Render caps
|
||||
const SHVec3 RADIUS_SCALE = SHVec3(radius * 2.0, radius * 2.0f, radius * 2.0);
|
||||
const SHVec3 RADIUS_SCALE = SHVec3(radius * 2.0f, radius * 2.0f, radius * 2.0f);
|
||||
const SHMatrix TOP_CAP_MAT = SHMatrix::Transform(TOP_POS, rotation, RADIUS_SCALE);
|
||||
drawMesh
|
||||
(
|
||||
|
@ -404,7 +404,7 @@ namespace SHADE
|
|||
const SHMatrix BOT_CAP_MAT = SHMatrix::Transform
|
||||
(
|
||||
BOT_POS,
|
||||
SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(180.0), 0.0f, 0.0f)) * rotation,
|
||||
SHQuaternion::FromEuler(SHVec3(SHMath::DegreesToRadians(180.0f), 0.0f, 0.0f)) * rotation,
|
||||
RADIUS_SCALE
|
||||
);
|
||||
drawMesh
|
||||
|
|
Loading…
Reference in New Issue