Removed physics for now.
This commit is contained in:
32
archive/physics_components/3d/CubeCollider.cpp
Normal file
32
archive/physics_components/3d/CubeCollider.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user