blob: 736334c56f974748afc7160aa9478b86ea8ad1c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include "KingSystem/Physics/System/physClosestPointQuery.h"
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
#include "KingSystem/Physics/System/physQueryContactPointInfo.h"
#include "KingSystem/Physics/physDefines.h"
#include "KingSystem/Physics/physLayerMaskBuilder.h"
namespace ksys::phys {
ClosestPointQuery::ClosestPointQuery(RigidBody* body, QueryContactPointInfo* contact_point_info)
: mBody(body), mContactPointInfo(contact_point_info) {
reset();
}
ClosestPointQuery::~ClosestPointQuery() = default;
void ClosestPointQuery::reset() {
mIsSuccess = false;
_18 = 0;
}
void ClosestPointQuery::setLayerMasks(const LayerMaskBuilder& builder) {
mContactPointInfo->setLayerMasks(builder);
}
bool ClosestPointQuery::isSuccess() const {
return mIsSuccess;
}
void ClosestPointQuery::setLayerMasksAndBodyCollisionFilterInfo(const LayerMaskBuilder& builder) {
EntityCollisionMask mask;
mask.regular.query_custom_receiver_layer_mask =
builder.getMasks()[int(ContactLayerType::Entity)].layers;
mask.regular.layer = ContactLayer::EntityQueryCustomReceiver;
mBody->setCollisionFilterInfo(mask.raw);
setLayerMasks(builder);
}
} // namespace ksys::phys
|