Esempio n. 1
0
void PowerUpSpawner::feed(std::vector<Powerup> powerUps, int stageSize)
{
	m_stageSize = stageSize;

	for (std::vector<Powerup>::iterator it = powerUps.begin() ; it != powerUps.end(); ++it)
	{
		addPowerUp((*it));
	}
}
Esempio n. 2
0
void EntityManager::createPowerup(char* path, btTransform &trans, int type)
{
	btScalar mass = btScalar(0.f);
	
	PowerUp* pup = new PowerUp();
	pup->SetType(type);

	pup->initRenderObject(path);
	
	//Taking this out for a bit; doesn't need to be a trimesh really
	//btCollisionShape* triMesh = sFactory.createStaticTriangleMesh(pup->renderObject);
	btScalar radius = 2.5f;
	btCollisionShape* sphereMesh = sFactory.createSphere(radius);

	pup->initPhysicsObject(sphereMesh, mass, trans);

	addPowerUp(pup);

	Physics::Inst()->addEntity(*pup);
}