MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetWaterProbeOffset

Method GetWaterProbeOffset

TombEngine/Game/effects/hair.cpp:160–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158 }
159
160 Vector3 HairUnit::GetWaterProbeOffset(const ItemInfo& item)
161 {
162 const auto& player = GetLaraInfo(item);
163
164 // TODO: Not needed?
165 if (player.HitDirection >= 0)
166 {
167 int animNumber = 0;
168 switch (player.HitDirection)
169 {
170 case NORTH:
171 animNumber = (player.Control.IsLow) ? LA_CROUCH_HIT_FRONT : LA_STAND_HIT_FRONT;
172 break;
173
174 case SOUTH:
175 animNumber = (player.Control.IsLow) ? LA_CROUCH_HIT_BACK : LA_STAND_HIT_BACK;
176 break;
177
178 case EAST:
179 animNumber = (player.Control.IsLow) ? LA_CROUCH_HIT_LEFT : LA_STAND_HIT_LEFT;
180 break;
181
182 default:
183 animNumber = (player.Control.IsLow) ? LA_CROUCH_HIT_RIGHT : LA_STAND_HIT_RIGHT;
184 break;
185 }
186
187 const auto& frame = GetAnimData(item.ObjectNumber, animNumber).Keyframes[player.HitFrame];
188 return frame.BoundingBox.GetCenter();
189 }
190
191 const auto& frame = GetClosestKeyframe(item);
192 return frame.BoundingBox.GetCenter();
193 }
194
195 Quaternion HairUnit::GetSegmentOrientation(const Vector3& origin, const Vector3& target, const Quaternion& baseOrient)
196 {

Callers

nothing calls this directly

Calls 1

GetCenterMethod · 0.80

Tested by

no test coverage detected