MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / SetActorPosition

Method SetActorPosition

ogsr_engine/xrGame/script_game_object2.cpp:333–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void 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
361void CScriptGameObject::SetActorDirection(float dir)
362{

Callers

nothing calls this directly

Calls 9

CharacterExistMethod · 0.80
movementMethod · 0.80
script_logMethod · 0.80
objectFunction · 0.50
setMethod · 0.45
SetPositionMethod · 0.45
SetVelocityMethod · 0.45
ForceTransformMethod · 0.45

Tested by

no test coverage detected