Add setUserIndex/getUserIndex (int index) to btCollisionShape

Share physics setup of BasicDemo between different graphics frameworks, see Demos\BasicDemo\BasicDemoPhysicsSetup.*
Plan is to do this for all Bullet demos.
Improve gwen performance and cursor navigation for tree control.
tweak shadowmap size
SimpleOpenGL3App::registerCubeShape accepts half extents
This commit is contained in:
erwin coumans
2014-05-20 12:02:01 -07:00
parent f213b00022
commit eb74688c18
23 changed files with 657 additions and 303 deletions

View File

@@ -105,6 +105,8 @@ void Base::Invalidate()
{
m_bNeedsLayout = true;
m_bCacheTextureDirty = true;
extern int avoidUpdate;
avoidUpdate = -3;
}
void Base::DelayedDelete()
@@ -403,12 +405,13 @@ void Base::OnBoundsChanged(Gwen::Rect oldBounds)
//Anything that needs to update on size changes
//Iterate my children and tell them I've changed
//
if ( GetParent() )
GetParent()->OnChildBoundsChanged( oldBounds, this );
if ( m_Bounds.w != oldBounds.w || m_Bounds.h != oldBounds.h )
{
if ( GetParent() )
GetParent()->OnChildBoundsChanged( oldBounds, this );
Invalidate();
}
@@ -694,6 +697,8 @@ void Base::Layout( Skin::Base* skin )
skin->GetRender()->GetCTT()->CreateControlCacheTexture( this );
}
int avoidUpdate = -15;
void Base::RecurseLayout( Skin::Base* skin )
{
if ( m_Skin ) skin = m_Skin;
@@ -704,6 +709,10 @@ void Base::RecurseLayout( Skin::Base* skin )
m_bNeedsLayout = false;
Layout( skin );
}
if (avoidUpdate>0)
return;
Gwen::Rect rBounds = GetRenderBounds();
@@ -713,13 +722,21 @@ void Base::RecurseLayout( Skin::Base* skin )
rBounds.y += m_Padding.top;
rBounds.h -= m_Padding.top + m_Padding.bottom;
int sz = Children.size();
if (sz>100)
{
// printf("!\n");
}
int curChild = 0;
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
curChild++;
if ( pChild->Hidden() )
continue;
int iDock = pChild->GetDock();
if ( iDock & Pos::Fill )
@@ -768,10 +785,12 @@ void Base::RecurseLayout( Skin::Base* skin )
}
pChild->RecurseLayout( skin );
}
m_InnerBounds = rBounds;
curChild = 0;
//
// Fill uses the left over space, so do that now.
//
@@ -779,10 +798,12 @@ void Base::RecurseLayout( Skin::Base* skin )
{
Base* pChild = *iter;
int iDock = pChild->GetDock();
curChild++;
if ( !(iDock & Pos::Fill) )
continue;
const Margin& margin = pChild->GetMargin();
pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, rBounds.w - margin.left - margin.right, rBounds.h - margin.top - margin.bottom );