ksys/phys: RayCastPlusBody -> RayCastBodyQuery for clarity

This commit is contained in:
Léo Lam 2022-03-21 00:30:56 +01:00
parent eca996b3fa
commit 509d557731
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
5 changed files with 45 additions and 44 deletions

View File

@ -84055,15 +84055,15 @@ Address,Quality,Size,Name
0x0000007100fc5218,O,000112,_ZNK4ksys4phys7RayCast27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x0000007100fc5288,O,000092,_ZNK4ksys4phys7RayCast18getRuntimeTypeInfoEv
0x0000007100fc52e4,O,000004,_ZN4ksys4phys7RayCast14onRigidBodyHitEPNS0_9RigidBodyE
0x0000007100fc52e8,O,000056,_ZN4ksys4phys15RayCastPlusBodyC1EPNS0_18SystemGroupHandlerENS0_9GroundHitE
0x0000007100fc5320,O,000004,_ZN4ksys4phys15RayCastPlusBodyD1Ev
0x0000007100fc5324,O,000036,_ZN4ksys4phys15RayCastPlusBodyD0Ev
0x0000007100fc5348,O,000008,_ZN4ksys4phys15RayCastPlusBody12worldRayCastENS0_16ContactLayerTypeE
0x0000007100fc5350,O,000008,_ZN4ksys4phys15RayCastPlusBody12shapeRayCastEPNS0_9RigidBodyE
0x0000007100fc5358,O,000008,_ZN4ksys4phys15RayCastPlusBody14phantomRayCastEPNS0_7PhantomE
0x0000007100fc5360,O,000008,_ZN4ksys4phys15RayCastPlusBody14onRigidBodyHitEPNS0_9RigidBodyE
0x0000007100fc5368,O,000204,_ZNK4ksys4phys15RayCastPlusBody27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x0000007100fc5434,O,000092,_ZNK4ksys4phys15RayCastPlusBody18getRuntimeTypeInfoEv
0x0000007100fc52e8,O,000056,_ZN4ksys4phys16RayCastBodyQueryC1EPNS0_18SystemGroupHandlerENS0_9GroundHitE
0x0000007100fc5320,O,000004,_ZN4ksys4phys16RayCastBodyQueryD1Ev
0x0000007100fc5324,O,000036,_ZN4ksys4phys16RayCastBodyQueryD0Ev
0x0000007100fc5348,O,000008,_ZN4ksys4phys16RayCastBodyQuery12worldRayCastENS0_16ContactLayerTypeE
0x0000007100fc5350,O,000008,_ZN4ksys4phys16RayCastBodyQuery12shapeRayCastEPNS0_9RigidBodyE
0x0000007100fc5358,O,000008,_ZN4ksys4phys16RayCastBodyQuery14phantomRayCastEPNS0_7PhantomE
0x0000007100fc5360,O,000008,_ZN4ksys4phys16RayCastBodyQuery14onRigidBodyHitEPNS0_9RigidBodyE
0x0000007100fc5368,O,000204,_ZNK4ksys4phys16RayCastBodyQuery27checkDerivedRuntimeTypeInfoEPKN4sead15RuntimeTypeInfo9InterfaceE
0x0000007100fc5434,O,000092,_ZNK4ksys4phys16RayCastBodyQuery18getRuntimeTypeInfoEv
0x0000007100fc5490,O,000140,_ZNK4sead15RuntimeTypeInfo6DeriveIN4ksys4phys7RayCastEE9isDerivedEPKNS0_9InterfaceE
0x0000007100fc551c,U,000076,phys::RayCastDerived2::ctor
0x0000007100fc5568,U,000004,phys::RayCastDerived2::dtor

Can't render this file because it is too large.

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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