| 235 | GetHead()->Deanimate(*GetHeadType(), GetHeadShape(), level, false, M3Identity, false); |
| 236 | } |
| 237 | |
| 238 | void CHead::Simulate() |
| 239 | { |
| 240 | UITime time = Glob.uiTime; |
| 241 | const float t0 = 4.0; |
| 242 | float oldT = fastFmod(_lastSimulation.toFloat(), t0); |
| 243 | float newT = fastFmod(time.toFloat(), t0); |
| 244 | float angle = (H_PI * 2.0 / t0) * newT; |
| 245 | Matrix3 orient(MRotationY, angle); |
| 246 | float scale = Scale(); |
| 247 | SetOrientation(orient); |
| 248 | SetScale(scale); |
| 249 | |
| 250 | const float tChange = 0.5 * t0; |
| 251 | if (oldT < tChange && newT >= tChange) |
| 252 | { |
| 253 | int size = (Pars >> "CfgMimics" >> "States").GetEntryCount(); |
| 254 | int i = toIntFloor(size * GRandGen.RandomValue()); |
| 255 | GetHead()->SetMimic((Pars >> "CfgMimics" >> "States").GetEntry(i).GetName()); |
| 256 | } |
| 257 | |
| 258 | GetHead()->Simulate(*GetHeadType(), time - _lastSimulation, SimulateVisibleNear, false); |
| 259 | _lastSimulation = time; |
| 260 | } |
| 261 | |
| 262 | void CHead::SetFace(RString name) |
no test coverage detected