22 #ifndef PLAYRHO_DYNAMICS_FIXTURE_HPP
23 #define PLAYRHO_DYNAMICS_FIXTURE_HPP
148 m_userData{def.userData},
150 m_filter{def.filter},
151 m_isSensor{def.isSensor}
165 union FixtureProxies {
166 FixtureProxies() noexcept: asArray{} {}
167 ~FixtureProxies() noexcept {}
169 std::array<FixtureProxy, 2> asArray;
170 std::unique_ptr<FixtureProxy[]> asBuffer;
174 void SetProxies(std::unique_ptr<FixtureProxy[]> value, std::size_t count) noexcept;
177 void ResetProxies() noexcept;
183 void* m_userData =
nullptr;
191 FixtureProxies m_proxies;
199 bool m_isSensor = false;
245 const auto ptr = (m_proxyCount <= 2)? &(m_proxies.asArray[0]): m_proxies.asBuffer.get();
249 inline void Fixture::SetProxies(std::unique_ptr<
FixtureProxy[]> value, std::size_t count) noexcept
251 assert(count < std::numeric_limits<ChildCounter>::max());
255 m_proxies.asArray[1] = value[1];
258 m_proxies.asArray[0] = value[0];
263 m_proxies.asBuffer = std::move(value);
266 m_proxyCount =
static_cast<decltype(m_proxyCount)
>(count);
269 inline void Fixture::ResetProxies() noexcept
271 if (m_proxyCount > 2)
273 m_proxies.asBuffer.reset();
321 return ShouldCollide(fixtureA.GetFilterData(), fixtureB.GetFilterData());
327 #endif // PLAYRHO_DYNAMICS_FIXTURE_HPP