Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
ObjectLayerPairFilterImpl.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Layers.hpp"
4
5// clang-format off
6#include <Jolt/Jolt.h>
7// clang-format on
8
9#include <Jolt/Physics/Collision/ObjectLayer.h>
10
11namespace Physics::Utils {
12class ObjectLayerPairFilterImpl : public JPH::ObjectLayerPairFilter {
13 public:
14 bool ShouldCollide(JPH::ObjectLayer inObject1, JPH::ObjectLayer inObject2) const override
15 {
16 switch (inObject1)
17 {
18 case Layers::NON_MOVING: return inObject2 == Layers::MOVING;
19 case Layers::MOVING: return true;
20 default: JPH_ASSERT(false); return false;
21 }
22 }
23};
24} // namespace Physics::Utils
Definition ObjectLayerPairFilterImpl.hpp:12
bool ShouldCollide(JPH::ObjectLayer inObject1, JPH::ObjectLayer inObject2) const override
Definition ObjectLayerPairFilterImpl.hpp:14
static constexpr JPH::ObjectLayer MOVING
Definition Layers.hpp:12
static constexpr JPH::ObjectLayer NON_MOVING
Definition Layers.hpp:11
Definition BiMap.hpp:7