예제 #1
0
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
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;
}