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

Method updateCollisionPoly

source/game/StarItemDrop.cpp:420–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420void ItemDrop::updateCollisionPoly() {
421 RectF fallback = RectF{ -0.499, -0.499, 0.499, 0.499 };
422 if (auto mat = as<MaterialItem>(m_item.get()))
423 m_boundBox = fallback;
424 else {
425 m_boundBox = Drawable::boundBoxAll(m_item->dropDrawables(), true);
426 m_boundBox.rangeSetIfEmpty(fallback);
427 }
428 MovementParameters parameters;
429 parameters.collisionPoly = PolyF(collisionArea());
430 m_movementController.applyParameters(parameters);
431}
432
433
434void ItemDrop::updateTaken(bool master) {

Callers

nothing calls this directly

Calls 4

rangeSetIfEmptyMethod · 0.80
getMethod · 0.45
dropDrawablesMethod · 0.45
applyParametersMethod · 0.45

Tested by

no test coverage detected