use of com.jme3.app.Application in project jmonkeyengine by jMonkeyEngine.
the class VRViewManagerOpenVR method setupFinalFullTexture.
private void setupFinalFullTexture(Camera cam) {
if (environment != null) {
if (environment.getApplication() != null) {
// create offscreen framebuffer
FrameBuffer out = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1);
//offBuffer.setSrgb(true);
//setup framebuffer's texture
dualEyeTex = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8);
dualEyeTex.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
dualEyeTex.setMagFilter(Texture.MagFilter.Bilinear);
logger.config("Dual eye texture " + dualEyeTex.getName() + " (" + dualEyeTex.getImage().getId() + ")");
logger.config(" Type: " + dualEyeTex.getType());
logger.config(" Size: " + dualEyeTex.getImage().getWidth() + "x" + dualEyeTex.getImage().getHeight());
logger.config(" Image depth: " + dualEyeTex.getImage().getDepth());
logger.config(" Image format: " + dualEyeTex.getImage().getFormat());
logger.config(" Image color space: " + dualEyeTex.getImage().getColorSpace());
//setup framebuffer to use texture
out.setDepthBuffer(Image.Format.Depth);
out.setColorTexture(dualEyeTex);
ViewPort viewPort = environment.getApplication().getViewPort();
viewPort.setClearFlags(true, true, true);
viewPort.setBackgroundColor(ColorRGBA.Black);
viewPort.setOutputFrameBuffer(out);
} else {
throw new IllegalStateException("This VR environment is not attached to any application.");
}
} else {
throw new IllegalStateException("This VR view manager is not attached to any VR environment.");
}
}
use of com.jme3.app.Application in project jmonkeyengine by jMonkeyEngine.
the class VideoRecorderAppState method initialize.
@Override
public void initialize(AppStateManager stateManager, Application app) {
super.initialize(stateManager, app);
this.app = app;
this.oldTimer = app.getTimer();
app.setTimer(new IsoTimer(framerate));
if (file == null) {
String filename = System.getProperty("user.home") + File.separator + "jMonkey-" + System.currentTimeMillis() / 1000 + ".avi";
file = new File(filename);
}
processor = new VideoProcessor();
List<ViewPort> vps = app.getRenderManager().getPostViews();
for (int i = vps.size() - 1; i >= 0; i--) {
lastViewPort = vps.get(i);
if (lastViewPort.isEnabled()) {
break;
}
}
lastViewPort.addProcessor(processor);
}
use of com.jme3.app.Application in project openmrs-core by openmrs.
the class HL7ServiceTest method processHL7InQueue_shouldParseOruR01MessageUsingOverriddenParserProvidedByAModule.
/**
* @see HL7Service#processHL7InQueue(HL7InQueue)
*/
@Test
@Ignore("TRUNK-3945")
public void processHL7InQueue_shouldParseOruR01MessageUsingOverriddenParserProvidedByAModule() throws Exception {
executeDataSet("org/openmrs/hl7/include/ORUTest-initialData.xml");
Properties props = super.getRuntimeProperties();
props.setProperty(ModuleConstants.RUNTIMEPROPERTY_MODULE_LIST_TO_LOAD, "org/openmrs/hl7/include/examplehl7handlers-0.1.omod");
// the above module provides a handler for messages of type "ADR" with trigger "A19"
ModuleUtil.startup(props);
// the application context cannot restart here to load in the moduleApplicationContext that
// calls the setHL7Handlers method so we're doing it manually here
Class<Application> c = (Class<Application>) Context.loadClass("org.openmrs.module.examplehl7handlers.AlternateORUR01Handler");
Application classInstance = c.newInstance();
HashMap<String, Application> map = new HashMap<>();
map.put("ORU_R01", classInstance);
HL7ServiceImpl.getInstance().setHL7Handlers(map);
HL7Service hl7service = Context.getHL7Service();
// a valid ORU_R01
HL7InQueue queueItem = hl7service.getHL7InQueue(1);
// this will create 1 HL7InError item
hl7service.processHL7InQueue(queueItem);
List<HL7InError> errors = hl7service.getAllHL7InErrors();
// get the last error, the one made by this test presumably
HL7InError error = errors.get(errors.size() - 1);
Assert.assertTrue(error.getErrorDetails().contains("In alternate oru r01 parser"));
ModuleUtil.shutdown();
}
use of com.jme3.app.Application in project TeachingInSimulation by ScOrPiOzzy.
the class TestJmeToJFXImageView method makeJmeApplication.
@NotNull
private static JmeToJFXApplication makeJmeApplication() {
final AppSettings settings = JmeToJFXIntegrator.prepareSettings(new AppSettings(true), 60);
final JmeToJFXApplication application = new JmeToJFXApplication() {
protected Spatial player;
@Override
public void simpleInitApp() {
super.simpleInitApp();
// stateManager.attach(new SceneCameraState());
float aspect = (float) cam.getWidth() / cam.getHeight();
// flyCam.setDragToRotate(true);
cam.setFrustumPerspective(45f, aspect, 0.01f, 1000);
assetManager.registerLocator("E:\\JME_SDKPROJ_HOME\\robot_assets\\assets\\", FileLocator.class);
assetManager.registerLocator("http://192.168.1.19:8082/assets/", UrlLocator.class);
player = assetManager.loadModel("Models\\elecComp\\DZ47LEC32.j3o");
// player = assetManager.loadModel("Model/RT28N-32X/RT28N-32X.j3o");
// Box b = new Box(1, 1, 1);
// player = new Geometry("Player", b);
// Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
// mat.setColor("Color", ColorRGBA.Blue);
// player.setMaterial(mat);
rootNode.attachChild(player);
}
};
application.setSettings(settings);
application.setShowSettings(false);
return application;
}
Aggregations