Removed physics for now.
This commit is contained in:
31
archive/physics_components/3d/SphereCollider.cpp
Normal file
31
archive/physics_components/3d/SphereCollider.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "SphereCollider.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
SphereCollider::SphereCollider(std::weak_ptr<SceneItem> item) : Collider3D(item) {
|
||||
|
||||
}
|
||||
|
||||
enum Collider3DType SphereCollider::getColliderType() {
|
||||
return COLLIDER3D_TYPE_SPHERE;
|
||||
}
|
||||
|
||||
bool_t SphereCollider::performRaycast(
|
||||
struct Collider3DRayResult *result,
|
||||
struct Ray3D ray
|
||||
) {
|
||||
assertNotNull(result, "SphereCollider::performRaycast: Result cannot be null");
|
||||
|
||||
return raytestSphere(
|
||||
ray,
|
||||
{ .center = item.lock()->getLocalPosition(), .radius = this->radius },
|
||||
&result->point,
|
||||
&result->normal,
|
||||
&result->distance
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user