mirror of
https://github.com/zeldaret/botw
synced 2026-09-01 17:30:00 -04:00
ksys/phys: RayCastPlusBody -> RayCastBodyQuery for clarity
This commit is contained in:
@@ -145,8 +145,8 @@ target_sources(uking PRIVATE
|
||||
System/physQueryContactPointInfo.h
|
||||
System/physRayCast.cpp
|
||||
System/physRayCast.h
|
||||
System/physRayCastPlusBody.cpp
|
||||
System/physRayCastPlusBody.h
|
||||
System/physRayCastBodyQuery.cpp
|
||||
System/physRayCastBodyQuery.h
|
||||
System/physSensorContactListener.cpp
|
||||
System/physSensorContactListener.h
|
||||
System/physSensorGroupFilter.cpp
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#include "KingSystem/Physics/System/physRayCastBodyQuery.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
RayCastBodyQuery::RayCastBodyQuery(SystemGroupHandler* group_handler, GroundHit ground_hit)
|
||||
: RayCast(group_handler, ground_hit) {}
|
||||
|
||||
RayCastBodyQuery::~RayCastBodyQuery() = default;
|
||||
|
||||
bool RayCastBodyQuery::worldRayCast(ContactLayerType layer_type) {
|
||||
mHitRigidBody = nullptr;
|
||||
return RayCast::worldRayCast(layer_type);
|
||||
}
|
||||
|
||||
bool RayCastBodyQuery::shapeRayCast(RigidBody* rigid_body) {
|
||||
mHitRigidBody = nullptr;
|
||||
return RayCast::shapeRayCast(rigid_body);
|
||||
}
|
||||
|
||||
bool RayCastBodyQuery::phantomRayCast(Phantom* phantom) {
|
||||
mHitRigidBody = nullptr;
|
||||
return RayCast::phantomRayCast(phantom);
|
||||
}
|
||||
|
||||
void RayCastBodyQuery::onRigidBodyHit(RigidBody* body) {
|
||||
mHitRigidBody = body;
|
||||
}
|
||||
|
||||
} // namespace ksys::phys
|
||||
+5
-4
@@ -4,11 +4,12 @@
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
class RayCastPlusBody : public RayCast {
|
||||
SEAD_RTTI_OVERRIDE(RayCastPlusBody, RayCast)
|
||||
/// A RayCast that keeps track of the first rigid body that collided with the ray (if any).
|
||||
class RayCastBodyQuery : public RayCast {
|
||||
SEAD_RTTI_OVERRIDE(RayCastBodyQuery, RayCast)
|
||||
public:
|
||||
RayCastPlusBody(SystemGroupHandler* group_handler, GroundHit ground_hit);
|
||||
~RayCastPlusBody() override;
|
||||
RayCastBodyQuery(SystemGroupHandler* group_handler, GroundHit ground_hit);
|
||||
~RayCastBodyQuery() override;
|
||||
|
||||
bool worldRayCast(ContactLayerType layer_type);
|
||||
bool shapeRayCast(RigidBody* rigid_body);
|
||||
@@ -1,29 +0,0 @@
|
||||
#include "KingSystem/Physics/System/physRayCastPlusBody.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
RayCastPlusBody::RayCastPlusBody(SystemGroupHandler* group_handler, GroundHit ground_hit)
|
||||
: RayCast(group_handler, ground_hit) {}
|
||||
|
||||
RayCastPlusBody::~RayCastPlusBody() = default;
|
||||
|
||||
bool RayCastPlusBody::worldRayCast(ContactLayerType layer_type) {
|
||||
mHitRigidBody = nullptr;
|
||||
return RayCast::worldRayCast(layer_type);
|
||||
}
|
||||
|
||||
bool RayCastPlusBody::shapeRayCast(RigidBody* rigid_body) {
|
||||
mHitRigidBody = nullptr;
|
||||
return RayCast::shapeRayCast(rigid_body);
|
||||
}
|
||||
|
||||
bool RayCastPlusBody::phantomRayCast(Phantom* phantom) {
|
||||
mHitRigidBody = nullptr;
|
||||
return RayCast::phantomRayCast(phantom);
|
||||
}
|
||||
|
||||
void RayCastPlusBody::onRigidBodyHit(RigidBody* body) {
|
||||
mHitRigidBody = body;
|
||||
}
|
||||
|
||||
} // namespace ksys::phys
|
||||
Reference in New Issue
Block a user