!get the orientation of the entity in world space @param [optional] if the parameter is present return the real angles if not the entity angles NOTE: if the entity is bound to another parent entity the real angles are the absolute angles if is not bound there is no difference @return a table containing the x,y,z fields that specify the orientation of the entity(in degrees) */
| 962 | @return a table containing the x,y,z fields that specify the orientation of the entity(in degrees) |
| 963 | */ |
| 964 | int CScriptObjectEntity::GetAngles(IFunctionHandler *pH) |
| 965 | { |
| 966 | // CHECK_PARAMETERS(0); |
| 967 | assert(pH->GetParamCount() == 0 || pH->GetParamCount() == 1); |
| 968 | |
| 969 | Ang3 vec; |
| 970 | if(pH->GetParamCount() == 0) |
| 971 | vec=m_pEntity->GetAngles(0); |
| 972 | else |
| 973 | vec=m_pEntity->GetAngles(1); |
| 974 | vec.Snap360(); |
| 975 | |
| 976 | |
| 977 | m_pObjectAngles->BeginSetGetChain(); |
| 978 | m_pObjectAngles->SetValueChain("x",vec.x); |
| 979 | m_pObjectAngles->SetValueChain("y",vec.y); |
| 980 | m_pObjectAngles->SetValueChain("z",vec.z); |
| 981 | m_pObjectAngles->EndSetGetChain(); |
| 982 | return pH->EndFunction(m_pObjectAngles); |
| 983 | } |
| 984 | |
| 985 | // Get Forward direction if no parameters |
| 986 | // if parameter is passed - get Up direction |
no test coverage detected