/** * Create a named picture. * * By default a picture's width and height are 1 * and its position is 0, 0. * * @param name the name of the picture in the scene graph * @param flipY If true, the Y coordinates of the texture will be flipped. */ public Picture(String name, boolean flipY){ super(name, new Quad(1, 1, flipY)); setQueueBucket(Bucket.Gui); setCullHint(CullHint.Never); }
pic.setLocalScale(1.5f, 1f, 1f); pic.setQueueBucket(Bucket.Opaque); pic.setTexture(environment.getApplication().getAssetManager(), (Texture2D)tex, false); viewPort.attachScene(pic);
private ViewPort setupMirrorBuffers(Camera cam, Texture2D tex, boolean expand) { if (environment != null) { if (environment.getApplication() != null) { Camera clonecam = cam.clone(); ViewPort viewPort = environment.getApplication().getRenderManager().createPostView("MirrorView", clonecam); clonecam.setParallelProjection(true); viewPort.setClearFlags(true, true, true); viewPort.setBackgroundColor(ColorRGBA.Black); Picture pic = new Picture("fullscene"); pic.setLocalTranslation(-0.75f, -0.5f, 0f); if (expand) { pic.setLocalScale(3f, 1f, 1f); } else { pic.setLocalScale(1.5f, 1f, 1f); } pic.setQueueBucket(Bucket.Opaque); pic.setTexture(environment.getApplication().getAssetManager(), (Texture2D) tex, false); viewPort.attachScene(pic); viewPort.setOutputFrameBuffer(null); pic.updateGeometricState(); return viewPort; } 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."); } }
pic.setLocalScale(1.5f, 1f, 1f); pic.setQueueBucket(Bucket.Opaque); pic.setTexture(environment.getApplication().getAssetManager(), (Texture2D)tex, false); viewPort.attachScene(pic);
/** * Create a named picture. * By default a picture's width and height are 1 * and its position is 0, 0. * * @param name the name of the picture in the scene graph * @param flipY If true, the Y coordinates of the texture will be flipped. */ public Picture(String name, boolean flipY){ super(name, new Quad(1, 1, flipY)); setQueueBucket(Bucket.Gui); setCullHint(CullHint.Never); }
/** * Create a named picture. * * By default a picture's width and height are 1 * and its position is 0, 0. * * @param name the name of the picture in the scene graph * @param flipY If true, the Y coordinates of the texture will be flipped. */ public Picture(String name, boolean flipY){ super(name, new Quad(1, 1, flipY)); setQueueBucket(Bucket.Gui); setCullHint(CullHint.Never); }
public LidarDistortionProcessor(JMERenderer jmeRenderer, int scansPerSweep, int scanHeight, int numberOfCameras, float startAngle, float fieldOfView, LidarSceneViewPort[] lidarSceneProcessors) { ViewPort viewport = jmeRenderer.getRenderManager().createPostView("LidarDistortionViewport", new Camera(scansPerSweep, scanHeight)); this.scansPerSweep = scansPerSweep; this.scanHeight = scanHeight; this.scan = new float[scanHeight * scansPerSweep]; this.lidarOutFloatBuffer = BufferUtils.createFloatBuffer(scansPerSweep * scanHeight); FrameBuffer distortionFrameBuffer = new FrameBuffer(scansPerSweep, scanHeight, 1); distortionFrameBuffer.setColorBuffer(Format.RGBA32F); Material distortionMaterial = createDistortionMaterial(jmeRenderer.getAssetManager(), scansPerSweep, numberOfCameras, startAngle, fieldOfView, lidarSceneProcessors); Picture distortionPicture = new Picture("Distortion"); distortionPicture.setMaterial(distortionMaterial); distortionPicture.setHeight(scanHeight); distortionPicture.setWidth(scansPerSweep); distortionPicture.setQueueBucket(Bucket.Gui); distortionPicture.setCullHint(CullHint.Never); viewport.attachScene(distortionPicture); viewport.setClearFlags(true, true, true); viewport.setOutputFrameBuffer(distortionFrameBuffer); viewport.addProcessor(this); distortionPicture.updateGeometricState(); }
public LidarDistortionProcessor(JMERenderer jmeRenderer, int scansPerSweep, int scanHeight, int numberOfCameras, float startAngle, float fieldOfView, LidarSceneViewPort[] lidarSceneProcessors) { ViewPort viewport = jmeRenderer.getRenderManager().createPostView("LidarDistortionViewport", new Camera(scansPerSweep, scanHeight)); this.scansPerSweep = scansPerSweep; this.scanHeight = scanHeight; this.scan = new float[scanHeight * scansPerSweep]; this.lidarOutFloatBuffer = BufferUtils.createFloatBuffer(scansPerSweep * scanHeight); FrameBuffer distortionFrameBuffer = new FrameBuffer(scansPerSweep, scanHeight, 1); distortionFrameBuffer.setColorBuffer(Format.RGBA32F); Material distortionMaterial = createDistortionMaterial(jmeRenderer.getAssetManager(), scansPerSweep, numberOfCameras, startAngle, fieldOfView, lidarSceneProcessors); Picture distortionPicture = new Picture("Distortion"); distortionPicture.setMaterial(distortionMaterial); distortionPicture.setHeight(scanHeight); distortionPicture.setWidth(scansPerSweep); distortionPicture.setQueueBucket(Bucket.Gui); distortionPicture.setCullHint(CullHint.Never); viewport.attachScene(distortionPicture); viewport.setClearFlags(true, true, true); viewport.setOutputFrameBuffer(distortionFrameBuffer); viewport.addProcessor(this); distortionPicture.updateGeometricState(); }