use of org.terasology.physics.CollisionGroupManager in project Terasology by MovingBlocks.
the class TerasologyTestingEnvironment method setupEnvironment.
@BeforeClass
public static void setupEnvironment() throws Exception {
final JavaArchive homeArchive = ShrinkWrap.create(JavaArchive.class);
final FileSystem vfs = ShrinkWrapFileSystems.newFileSystem(homeArchive);
PathManager.getInstance().useOverrideHomePath(vfs.getPath(""));
/*
* Create at least for each class a new headless environemnt as it is fast and prevents side effects
* (Reusing a headless environment after other tests have modified the core registry isn't really clean)
*/
env = new HeadlessEnvironment(new Name("engine"));
context = env.getContext();
assetManager = context.get(AssetManager.class);
blockManager = context.get(BlockManager.class);
config = context.get(Config.class);
audioManager = context.get(AudioManager.class);
collisionGroupManager = context.get(CollisionGroupManager.class);
moduleManager = context.get(ModuleManager.class);
}
use of org.terasology.physics.CollisionGroupManager in project Terasology by MovingBlocks.
the class HeadlessEnvironment method setupCollisionManager.
@Override
protected void setupCollisionManager() {
CollisionGroupManager collisionGroupManager = new CollisionGroupManager();
context.put(CollisionGroupManager.class, collisionGroupManager);
context.get(TypeSerializationLibrary.class).add(CollisionGroup.class, new CollisionGroupTypeHandler(collisionGroupManager));
}
Aggregations