Fixed raycast sphere.

This commit is contained in:
2023-03-18 22:58:26 -07:00
parent d97d19f93c
commit 765c9015ae
9 changed files with 249 additions and 189 deletions

View File

@ -39,12 +39,13 @@ void PlayerController::onStart() {
// tEST
auto collider = item->getComponent<CapsuleCollider>();
auto collider = item->getComponent<Collider3D>();
assertNotNull(collider);
Collider3DRayResult result;
struct Ray3D ray;
ray.origin = glm::vec3(0, 0.5f, 1);
ray.direction = glm::vec3(10, 0, 0);
ray.origin = glm::vec3(0, 0.0f, 5);
ray.direction = glm::vec3(0, 0.0f, -4);
struct Color color = COLOR_MAGENTA;
@ -54,7 +55,7 @@ void PlayerController::onStart() {
getScene()->debugRay({
.start = result.point,
.direction = (result.normal * 100.0f),
.direction = result.normal,
.color = COLOR_GREEN
});
}