MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / queryHit

Method queryHit

source/game/StarObject.cpp:1131–1139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1129}
1130
1131Maybe<HitType> Object::queryHit(DamageSource const& source) const {
1132 if (!m_config->smashable || !inWorld() || m_health.get() <= 0.0f || m_unbreakable)
1133 return {};
1134
1135 if (source.intersectsWithPoly(world()->geometry(), hitPoly().get()))
1136 return HitType::Hit;
1137
1138 return {};
1139}
1140
1141Maybe<PolyF> Object::hitPoly() const {
1142 auto poly = volume();

Callers

nothing calls this directly

Calls 3

intersectsWithPolyMethod · 0.80
getMethod · 0.45
geometryMethod · 0.45

Tested by

no test coverage detected