Removed physics for now.

This commit is contained in:
2023-11-12 23:29:52 -06:00
parent 54da3733d7
commit 2d4287a277
62 changed files with 452 additions and 362 deletions

View File

@ -0,0 +1,32 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "CubeCollider.hpp"
using namespace Dawn;
CubeCollider::CubeCollider(std::weak_ptr<SceneItem> item) : Collider3D(item) {
}
bool_t CubeCollider::performRaycast(
struct Collider3DRayResult *result,
struct Ray3D ray
) {
assertNotNull(result, "CubeCollider::performRaycast: Result cannot be null");
return Dawn::raytestCube(
ray,
{ .min = this->min, .max = this->max },
item.lock()->getWorldTransform(),
&result->point,
&result->normal,
&result->distance
);
}
enum Collider3DType CubeCollider::getColliderType() {
return COLLIDER3D_TYPE_CUBE;
}