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

Function InitializeLaraAnims

TombEngine/Game/Lara/lara_initialise.cpp:125–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void InitializeLaraAnims(ItemInfo* item)
126{
127 auto& player = GetLaraInfo(*item);
128
129 player.Control.HandStatus = HandStatus::Free;
130 player.TargetEntity = nullptr;
131 player.LeftArm.FrameNumber = 0;
132 player.RightArm.FrameNumber = 0;
133 player.LeftArm.Locked = false;
134 player.RightArm.Locked = false;
135
136 if (PlayerVehicleObjectID != GAME_OBJECT_ID::ID_NO_OBJECT)
137 return;
138
139 if (TestEnvironment(ENV_FLAG_WATER, item))
140 {
141 SetAnimation(item, LA_UNDERWATER_IDLE);
142 item->Animation.Velocity.y = 0.0f;
143 player.Control.WaterStatus = WaterStatus::Underwater;
144 }
145 else
146 {
147 player.Control.WaterStatus = WaterStatus::Dry;
148
149 // Allow player to start in crawl idle anim if start position is too low.
150 auto pointColl = GetPointCollision(*item);
151 if (abs(pointColl.GetCeilingHeight() - pointColl.GetFloorHeight()) < LARA_HEIGHT)
152 {
153 SetAnimation(item, LA_CRAWL_IDLE);
154 player.Control.IsLow =
155 player.Control.KeepLow = true;
156 }
157 else
158 {
159 SetAnimation(item, LA_STAND_SOLID);
160 }
161 }
162}
163
164void InitializeLaraLoad(short itemNumber)
165{

Callers 1

InitializeLaraFunction · 0.85

Calls 5

TestEnvironmentFunction · 0.85
SetAnimationFunction · 0.85
GetPointCollisionFunction · 0.85
GetCeilingHeightMethod · 0.45
GetFloorHeightMethod · 0.45

Tested by

no test coverage detected