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

Method loungeAnchor

source/game/objects/StarLoungeableObject.cpp:48–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48LoungeAnchorConstPtr LoungeableObject::loungeAnchor(size_t positionIndex) const {
49 if (positionIndex >= m_sitPositions.size())
50 return {};
51
52 auto loungeAnchor = make_shared<LoungeAnchor>();
53
54 loungeAnchor->suppressTools = false;
55 loungeAnchor->controllable = false;
56 loungeAnchor->direction = m_sitFlipDirection ? -direction() : direction();
57
58 loungeAnchor->position = m_sitPositions.at(positionIndex);
59 if (loungeAnchor->direction == Direction::Left)
60 loungeAnchor->position[0] *= -1;
61 loungeAnchor->position += position();
62
63 loungeAnchor->exitBottomPosition = Vec2F(loungeAnchor->position[0], position()[1] + volume().boundBox().min()[1]);
64
65 loungeAnchor->angle = m_sitAngle;
66 if (loungeAnchor->direction == Direction::Left)
67 loungeAnchor->angle *= -1;
68
69 loungeAnchor->orientation = m_sitOrientation;
70 // Layer all anchored entities one above the object layer, in top to bottom
71 // order based on the anchor index.
72 loungeAnchor->loungeRenderLayer = RenderLayerObject + m_sitPositions.size() - positionIndex;
73
74 loungeAnchor->statusEffects = m_sitStatusEffects;
75 loungeAnchor->effectEmitters = m_sitEffectEmitters;
76 loungeAnchor->emote = m_sitEmote;
77 loungeAnchor->dance = m_sitDance;
78 loungeAnchor->armorCosmeticOverrides = m_sitArmorCosmeticOverrides;
79 loungeAnchor->cursorOverride = m_sitCursorOverride;
80
81 return loungeAnchor;
82}
83
84void LoungeableObject::setOrientationIndex(size_t orientationIndex) {
85 Object::setOrientationIndex(orientationIndex);

Callers 1

loungeableQueryMethod · 0.45

Calls 4

sizeMethod · 0.45
atMethod · 0.45
minMethod · 0.45
boundBoxMethod · 0.45

Tested by

no test coverage detected