载入中...
搜索中...
未找到
JoltContactPolicy.cpp
浏览该文件的文档.
1// eve-hot-path
2// Jolt requires its platform header before any other native header.
3#include <Jolt/Jolt.h>
4
5// Provider implementation dependencies.
6#include "physics/World3D.h"
9namespace eve::physics::jolt {
10bool WorldBackend::isContactAllowed(const Shape3D& a, const Shape3D& b, double x, double y, double z, float nx,
11 float ny, float nz) {
12 return isPairAllowed(a, b) && a.allowsOneWayContact(x, y, z, nx, ny, nz) &&
13 b.allowsOneWayContact(x, y, z, -nx, -ny, -nz);
14}
16 auto key = [](int first, int second) {
17 return (uint64_t(uint32_t(std::max(first, second))) << 32) | uint32_t(std::min(first, second));
18 };
19 const auto& world = *a.world_;
20 if (world.disabledBodyPairs_.contains(key(a.body_->getId(), b.body_->getId())) ||
21 world.disabledShapePairs_.contains(key(a.getId(), b.getId())))
22 return false;
23 return true;
24}
25} // namespace eve::physics::jolt
double z
double y
double x
SQObjectPtr key
Definition ECS.cpp:155
std::int32_t second
std::int32_t first
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
3D shape (box/sphere/capsule) attached to a Body3D with material settings. Created via Body3D::new*Sh...
Definition Shape3D.h:34
static bool isPairAllowed(const Shape3D &, const Shape3D &)
Reads explicit body/shape pair exclusions for solid and sensor contacts without callbacks.
static bool isContactAllowed(const Shape3D &, const Shape3D &, double, double, double, float, float, float)
Reads built-in pair overrides and prepared one-way planes synchronously; no user callbacks or locks.