Пример #1
0
void AddBox()
{
	Box* box = new Box(ColouredParticleSystem::RandomVector(60.0) + Vec3(0, 15, 0), ColouredParticleSystem::RandomVector(10.0) + Vec3(5, 5, 5));
	//box->ApplyImpulse(Vec3(0, -0.05, 0));
	box->ApplyAngularMomentum(ColouredParticleSystem::RandomVector(1), ((float)rand() * 0.01) / RAND_MAX);
	box->ConvexPolyhedron::SetDebugColour(Vec4(ColouredParticleSystem::RandomVector(1), 1));
	boxes.push_back(box);
	PhysicsSystem::GetCurrentInstance()->AddRigidBody(box);
}