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