int CLuaMatrixDefs::SetRotation ( lua_State* luaVM ) { CLuaMatrix* pMatrix = NULL; CVector vecRotation; CScriptArgReader argStream ( luaVM ); argStream.ReadUserData ( pMatrix ); argStream.ReadVector3D ( vecRotation ); if ( !argStream.HasErrors () ) { ConvertRadiansToDegreesNoWrap ( vecRotation ); pMatrix->SetRotation ( vecRotation ); lua_pushboolean ( luaVM, true ); return 1; } else { m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() ); } lua_pushboolean ( luaVM, false ); return 1; }
void CVehicle::SetMatrix( const CMatrix& matrix ) { // Set position and rotation from matrix SetPosition( matrix.vPos ); CVector vecRotation = matrix.GetRotation(); ConvertRadiansToDegreesNoWrap( vecRotation ); SetRotationDegrees( vecRotation ); }