//------------------------------------------------------------------------------ void CGUIWgtScrollPanel::UpdateDirtyRect() { CGUIWidget::UpdateDirtyRect(); //clip rect for client if( m_UseSelfCreatedScrollbar ) { if( m_pScrollbarVert->IsOpen() ) { m_aClientClipRect.SetWidth(m_aWidgetRect.GetWidth() - m_pScrollbarVert->GetSize().GetWidth()*m_pScrollbarVert->GetDerivedScale().GetWidth()); } if( m_pScrollbarHorz->IsOpen() ) { m_aClientClipRect.SetHeight(m_aWidgetRect.GetHeight() - m_pScrollbarHorz->GetSize().GetHeight()*m_pScrollbarHorz->GetDerivedScale().GetHeight()); } } //update client rect m_aClientRect = m_aWidgetRect; m_aClientRect.SetSize(m_aScrollClientRect.GetSize()); CGUIVector2 aWorkPos(m_aClientRect.m_fLeft, m_aClientRect.m_fTop); if ( m_pScrollbarHorz && m_pScrollbarHorz->IsOpen()) { aWorkPos.x -= m_pScrollbarHorz->GetCurrentPos()*GetDerivedScale().m_fWidth; } if ( m_pScrollbarVert && m_pScrollbarVert->IsOpen()) { aWorkPos.y -= m_pScrollbarVert->GetCurrentPos()*GetDerivedScale().m_fHeight; } m_aClientRect.SetPosition(aWorkPos); }
void DiBone::GetOffsetTransform( DiMat4& m ) const { DiVec3 locScale = GetDerivedScale() * mBindDerivedInverseScale; DiQuat locRotate = GetDerivedOrientation() * mBindDerivedInverseOrientation; DiVec3 locTranslate = GetDerivedPosition() + locRotate * (locScale * mBindDerivedInversePosition); m.makeTransform(locTranslate, locScale, locRotate); }
void DiBone::SetBindingPose() { SetInitialState(); mBindDerivedInversePosition = -GetDerivedPosition(); mBindDerivedInverseScale = DiVec3::UNIT_SCALE / GetDerivedScale(); mBindDerivedInverseOrientation = GetDerivedOrientation().Inverse(); }
void DiBone::GetOffsetTransform(btTransform& t) const { DiVec3 locScale = GetDerivedScale() * mBindDerivedInverseScale; DiQuat locRotate = GetDerivedOrientation() * mBindDerivedInverseOrientation; DiVec3 locTranslate = GetDerivedPosition() + locRotate * (locScale * mBindDerivedInversePosition); t.setOrigin(btVector3(locTranslate.x,locTranslate.y,locTranslate.z)); btQuaternion qt; qt.setValue(locRotate.x,locRotate.y,locRotate.z,locRotate.w); t.setRotation(qt); t.setBasis(t.getBasis().scaled(btVector3(locScale.x, locScale.y, locScale.z))); }