Search in sources :

Example 1 with CollisionGroupManager

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);
}
Also used : AudioManager(org.terasology.audio.AudioManager) AssetManager(org.terasology.assets.management.AssetManager) BlockManager(org.terasology.world.block.BlockManager) Config(org.terasology.config.Config) FileSystem(java.nio.file.FileSystem) CollisionGroupManager(org.terasology.physics.CollisionGroupManager) ModuleManager(org.terasology.engine.module.ModuleManager) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Name(org.terasology.naming.Name) BeforeClass(org.junit.BeforeClass)

Example 2 with CollisionGroupManager

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));
}
Also used : CollisionGroupTypeHandler(org.terasology.persistence.typeHandling.extensionTypes.CollisionGroupTypeHandler) CollisionGroupManager(org.terasology.physics.CollisionGroupManager) TypeSerializationLibrary(org.terasology.persistence.typeHandling.TypeSerializationLibrary)

Aggregations

CollisionGroupManager (org.terasology.physics.CollisionGroupManager)2 FileSystem (java.nio.file.FileSystem)1 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)1 BeforeClass (org.junit.BeforeClass)1 AssetManager (org.terasology.assets.management.AssetManager)1 AudioManager (org.terasology.audio.AudioManager)1 Config (org.terasology.config.Config)1 ModuleManager (org.terasology.engine.module.ModuleManager)1 Name (org.terasology.naming.Name)1 TypeSerializationLibrary (org.terasology.persistence.typeHandling.TypeSerializationLibrary)1 CollisionGroupTypeHandler (org.terasology.persistence.typeHandling.extensionTypes.CollisionGroupTypeHandler)1 BlockManager (org.terasology.world.block.BlockManager)1