! Get the position of the entity @return Three component vector containing the entity position */
| 388 | @return Three component vector containing the entity position |
| 389 | */ |
| 390 | int CScriptObjectEntity::GetPos(IFunctionHandler *pH) |
| 391 | { |
| 392 | CHECK_PARAMETERS(0); |
| 393 | Vec3 vec; |
| 394 | #ifndef USE_MEMBER_POS |
| 395 | CScriptObjectVector oVec(m_pScriptSystem); |
| 396 | // vec=m_pEntity->GetPos(false); |
| 397 | vec=m_pEntity->GetPos(true); |
| 398 | oVec=vec; |
| 399 | return pH->EndFunction(*oVec); |
| 400 | #else |
| 401 | vec=m_pEntity->GetPos(true); |
| 402 | m_pObjectPos->BeginSetGetChain(); |
| 403 | m_pObjectPos->SetValueChain("x",vec.x); |
| 404 | m_pObjectPos->SetValueChain("y",vec.y); |
| 405 | m_pObjectPos->SetValueChain("z",vec.z); |
| 406 | m_pObjectPos->EndSetGetChain(); |
| 407 | return pH->EndFunction(m_pObjectPos); |
| 408 | #endif |
| 409 | |
| 410 | } |
| 411 | |
| 412 | |
| 413 | /*! Get the position of the entity's physical center of mass |
no test coverage detected