| 331 | } |
| 332 | |
| 333 | void CScriptGameObject::SetActorPosition(Fvector pos, bool skipCollisionCorrect) |
| 334 | { |
| 335 | CActor* actor = smart_cast<CActor*>(&object()); |
| 336 | if (actor) |
| 337 | { |
| 338 | if (skipCollisionCorrect) |
| 339 | { |
| 340 | Fmatrix F = actor->XFORM(); |
| 341 | F.c = pos; |
| 342 | actor->XFORM().set(F); |
| 343 | if (actor->character_physics_support()->movement()->CharacterExist()) |
| 344 | { |
| 345 | actor->character_physics_support()->movement()->SetPosition(F.c); |
| 346 | actor->character_physics_support()->movement()->SetVelocity(0.f, 0.f, 0.f); |
| 347 | } |
| 348 | |
| 349 | } |
| 350 | else |
| 351 | { |
| 352 | Fmatrix F = actor->XFORM(); |
| 353 | F.c = pos; |
| 354 | actor->ForceTransform(F); |
| 355 | } |
| 356 | } |
| 357 | else |
| 358 | ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "ScriptGameObject : attempt to call SetActorPosition method for non-actor object"); |
| 359 | } |
| 360 | |
| 361 | void CScriptGameObject::SetActorDirection(float dir) |
| 362 | { |
nothing calls this directly
no test coverage detected