コード例 #1
0
ファイル: Body.cpp プロジェクト: zombihello/lifeEngine
void le::Body::CreatePolygonShape( Vector2f SizeBody, Vector2f Center, float Angle )
{
	if ( body != NULL )
	{
		PolygonShape* Shape = new PolygonShape( SizeBody, Center, Angle );
		Shape->SetPropirtes( fDensity, fRestitution, fFriction );
		Shape->SetFixture( body->CreateFixture( &Shape->GetFixtureDef() ) );
		body->GetFixtureList()->SetFilterData( *Filter );
		vShape.push_back( Shape );
	}
}
コード例 #2
0
ファイル: Body.cpp プロジェクト: zombihello/lifeEngine
void le::Body::SetPropirtes( float Density, float Restitution, float Friction )
{
	for ( int i = 0; i < vShape.size(); i++)
	{
		PolygonShape* Shape = vShape[ i ];
		Shape->SetPropirtes( Density, Restitution, Friction );
	}

	for ( int i = 0; i < vCircle.size(); i++)
	{
		CircleShape* Circle = vCircle[ i ];
		Circle->SetPropirtes( Density, Restitution, Friction );
	}

	fDensity = Density;
	fRestitution = Restitution;
	fFriction = Friction;
}