Replay fixes (#17)
Fixes to work with our game. Replay fixes and improvements. Removed shape names (save memory). B3_DEFAULT_CATEGORY_BITS is now UINT64_MAX to make selection easier.
This commit is contained in:
parent
5c9b516486
commit
0c8ef46931
51 changed files with 5653 additions and 3853 deletions
|
|
@ -627,13 +627,15 @@ public:
|
|||
break;
|
||||
}
|
||||
|
||||
b3QueryFilter filter = b3DefaultQueryFilter();
|
||||
filter.name = "cast_world";
|
||||
if ( m_castType == e_rayCast )
|
||||
{
|
||||
b3World_CastRay( m_worldId, m_origin, m_translation, b3DefaultQueryFilter(), modeFcn, &m_castContext );
|
||||
b3World_CastRay( m_worldId, m_origin, m_translation, filter, modeFcn, &m_castContext );
|
||||
}
|
||||
else
|
||||
{
|
||||
b3World_CastShape( m_worldId, m_origin, &proxy, m_translation, b3DefaultQueryFilter(), modeFcn, &m_castContext );
|
||||
b3World_CastShape( m_worldId, m_origin, &proxy, m_translation, filter, modeFcn, &m_castContext );
|
||||
}
|
||||
|
||||
if ( m_castContext.count > 0 )
|
||||
|
|
@ -1073,16 +1075,6 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
void Render() override
|
||||
{
|
||||
Sample::Render();
|
||||
|
||||
DrawTextLine( "Shift + LMB and drag to shift start position" );
|
||||
|
||||
DrawGroundGrid( 10 );
|
||||
DrawAxes( b3WorldTransform_identity, 1.0f );
|
||||
}
|
||||
|
||||
void MouseDown( b3Vec2 p, int button, int modifiers ) override
|
||||
{
|
||||
if ( button == 0 )
|
||||
|
|
@ -1124,9 +1116,15 @@ public:
|
|||
|
||||
void Step() override
|
||||
{
|
||||
Sample::Step();
|
||||
|
||||
CastSpheres();
|
||||
CastCapsules();
|
||||
CastHulls();
|
||||
DrawTextLine( "Shift + LMB and drag to shift start position" );
|
||||
|
||||
DrawGroundGrid( 10 );
|
||||
DrawAxes( b3WorldTransform_identity, 1.0f );
|
||||
}
|
||||
|
||||
static Sample* Create( SampleContext* context )
|
||||
|
|
@ -1277,18 +1275,6 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void Render() override
|
||||
{
|
||||
Sample::Render();
|
||||
|
||||
DrawTextLine( "Shift + LMB and drag to move shapes" );
|
||||
|
||||
DrawGroundGrid( 10 );
|
||||
DrawLine( b3Pos_zero, b3OffsetPos( b3Pos_zero, 0.4f * b3Vec3_axisX ), MakeColor( b3_colorRed ) );
|
||||
DrawLine( b3Pos_zero, b3OffsetPos( b3Pos_zero, 0.4f * b3Vec3_axisY ), MakeColor( b3_colorGreen ) );
|
||||
DrawLine( b3Pos_zero, b3OffsetPos( b3Pos_zero, 0.4f * b3Vec3_axisZ ), MakeColor( b3_colorBlue ) );
|
||||
}
|
||||
|
||||
void MouseDown( b3Vec2 p, int button, int modifiers ) override
|
||||
{
|
||||
if ( button == 0 )
|
||||
|
|
@ -1319,9 +1305,17 @@ public:
|
|||
|
||||
void Step() override
|
||||
{
|
||||
Sample::Step();
|
||||
|
||||
OverlapSpheres();
|
||||
OverlapCapsules();
|
||||
OverlapHulls();
|
||||
DrawTextLine( "Shift + LMB and drag to move shapes" );
|
||||
|
||||
DrawGroundGrid( 10 );
|
||||
DrawLine( b3Pos_zero, b3OffsetPos( b3Pos_zero, 0.4f * b3Vec3_axisX ), MakeColor( b3_colorRed ) );
|
||||
DrawLine( b3Pos_zero, b3OffsetPos( b3Pos_zero, 0.4f * b3Vec3_axisY ), MakeColor( b3_colorGreen ) );
|
||||
DrawLine( b3Pos_zero, b3OffsetPos( b3Pos_zero, 0.4f * b3Vec3_axisZ ), MakeColor( b3_colorBlue ) );
|
||||
}
|
||||
|
||||
b3BoxHull m_box;
|
||||
|
|
|
|||
Loading…
Reference in a new issue