mirror of
https://github.com/zeldaret/botw
synced 2026-08-28 08:09:07 -04:00
ksys/phys: Add RayCastPlusBody
This commit is contained in:
@@ -145,6 +145,8 @@ target_sources(uking PRIVATE
|
||||
System/physQueryContactPointInfo.h
|
||||
System/physRayCast.cpp
|
||||
System/physRayCast.h
|
||||
System/physRayCastPlusBody.cpp
|
||||
System/physRayCastPlusBody.h
|
||||
System/physSensorContactListener.cpp
|
||||
System/physSensorContactListener.h
|
||||
System/physSensorGroupFilter.cpp
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#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
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Physics/System/physRayCast.h"
|
||||
|
||||
namespace ksys::phys {
|
||||
|
||||
class RayCastPlusBody : public RayCast {
|
||||
SEAD_RTTI_OVERRIDE(RayCastPlusBody, RayCast)
|
||||
public:
|
||||
RayCastPlusBody(SystemGroupHandler* group_handler, GroundHit ground_hit);
|
||||
~RayCastPlusBody() override;
|
||||
|
||||
bool worldRayCast(ContactLayerType layer_type);
|
||||
bool shapeRayCast(RigidBody* rigid_body);
|
||||
bool phantomRayCast(Phantom* phantom);
|
||||
|
||||
RigidBody* getHitRigidBody() const { return mHitRigidBody; }
|
||||
|
||||
void onRigidBodyHit(RigidBody* body) override;
|
||||
|
||||
private:
|
||||
RigidBody* mHitRigidBody{};
|
||||
};
|
||||
|
||||
} // namespace ksys::phys
|
||||
Reference in New Issue
Block a user