private void init(int shadowMapSize) { shadowCams = new Camera[CAM_NUMBER]; for (int i = 0; i < CAM_NUMBER; i++) { shadowCams[i] = new Camera(shadowMapSize, shadowMapSize); } }
private void init(int shadowMapSize) { shadowCam = new Camera(shadowMapSize, shadowMapSize); for (int i = 0; i < points.length; i++) { points[i] = new Vector3f(); } }
private void init(int nbSplits, int shadowMapSize) { nbShadowMaps = Math.max(Math.min(nbSplits, 4), 1); if (nbShadowMaps != nbSplits) { throw new IllegalArgumentException("Number of splits must be between 1 and 4. Given value : " + nbSplits); } splits = new ColorRGBA(); splitsArray = new float[nbSplits + 1]; shadowCam = new Camera(shadowMapSize, shadowMapSize); shadowCam.setParallelProjection(true); for (int i = 0; i < points.length; i++) { points[i] = new Vector3f(); } }
private void init(int nbSplits, int shadowMapSize) { nbShadowMaps = Math.max(Math.min(nbSplits, 4), 1); if (nbShadowMaps != nbSplits) { throw new IllegalArgumentException("Number of splits must be between 1 and 4. Given value : " + nbSplits); } splits = new ColorRGBA(); splitsArray = new float[nbSplits + 1]; shadowCam = new Camera(shadowMapSize, shadowMapSize); shadowCam.setParallelProjection(true); for (int i = 0; i < points.length; i++) { points[i] = new Vector3f(); } }
private void parseCamera(Attributes attribs) throws SAXException { camera = new Camera(DEFAULT_CAM_WIDTH, DEFAULT_CAM_HEIGHT); if (SAXUtil.parseString(attribs.getValue("projectionType"), "perspective").equals("parallel")){ camera.setParallelProjection(true); } float fov = SAXUtil.parseFloat(attribs.getValue("fov"), 45f); if (fov < FastMath.PI) { // XXX: Most likely, it is in radians.. fov = fov * FastMath.RAD_TO_DEG; } camera.setFrustumPerspective(fov, (float)DEFAULT_CAM_WIDTH / DEFAULT_CAM_HEIGHT, 1, 1000); cameraNode = new CameraNode(attribs.getValue("name"), camera); cameraNode.setControlDir(ControlDirection.SpatialToCamera); node.attachChild(cameraNode); node = null; }
public Camera getDummyCamera(){ if (dummyCam == null){ if (application != null){ if (application.getCamera() != null){ dummyCam = application.getCamera().clone(); } else { if ((settings != null) && (settings.getWidth() != 0) && (settings.getHeight() != 0)){ dummyCam = new Camera(settings.getWidth(), settings.getHeight()); } else { dummyCam = new Camera(); } } } else { throw new IllegalStateException("VR environment is not attached to any application."); } } return dummyCam; }
dummyCam = new Camera();
/** * Creates an off camera * * @param mapSize the size * @param worldPos the position * @param axisX the x axis * @param axisY the y axis * @param axisZ tha z axis * @return */ protected Camera createOffCamera(final int mapSize, final Vector3f worldPos, final Vector3f axisX, final Vector3f axisY, final Vector3f axisZ) { final Camera offCamera = new Camera(mapSize, mapSize); offCamera.setLocation(worldPos); offCamera.setAxes(axisX, axisY, axisZ); offCamera.setFrustumPerspective(90f, 1f, 0.1f, 1000); offCamera.setLocation(position); return offCamera; }
Camera camera = new Camera(DEFAULT_CAM_WIDTH, DEFAULT_CAM_HEIGHT); int type = ((Number) structure.getFieldValue("type")).intValue(); if (type != 0 && type != 1) {
/** * Creates the camera to use for rendering. Default values are perspective * projection with 45° field of view, with near and far values 1 and 1000 * units respectively. */ private void initCamera(){ cam = new Camera(settings.getWidth(), settings.getHeight()); cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f); cam.setLocation(new Vector3f(0f, 0f, 10f)); cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y); renderManager = new RenderManager(renderer); //Remy - 09/14/2010 setted the timer in the renderManager renderManager.setTimer(timer); viewPort = renderManager.createMainView("Default", cam); viewPort.setClearFlags(true, true, true); // Create a new cam for the gui Camera guiCam = new Camera(settings.getWidth(), settings.getHeight()); guiViewPort = renderManager.createPostView("Gui Default", guiCam); guiViewPort.setClearFlags(false, false, false); }
Camera cam = new Camera(1, 1);
/** * Creates the camera to use for rendering. Default values are perspective * projection with 45° field of view, with near and far values 1 and 1000 * units respectively. */ private void initCamera(){ cam = new Camera(settings.getWidth(), settings.getHeight()); cam.setFrustumPerspective(45f, (float)cam.getWidth() / cam.getHeight(), 1f, 1000f); cam.setLocation(new Vector3f(0f, 0f, 10f)); cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y); renderManager = new RenderManager(renderer); //Remy - 09/14/2010 setted the timer in the renderManager renderManager.setTimer(timer); if (prof != null) { renderManager.setAppProfiler(prof); } viewPort = renderManager.createMainView("Default", cam); viewPort.setClearFlags(true, true, true); // Create a new cam for the gui Camera guiCam = new Camera(settings.getWidth(), settings.getHeight()); guiViewPort = renderManager.createPostView("Gui Default", guiCam); guiViewPort.setClearFlags(false, false, false); }
/** * Creates a BasicShadowRenderer * @param manager the asset manager * @param size the size of the shadow map (the map is square) */ public BasicShadowRenderer(AssetManager manager, int size) { shadowFB = new FrameBuffer(size, size, 1); shadowMap = new Texture2D(size, size, Format.Depth); shadowFB.setDepthTexture(shadowMap); shadowCam = new Camera(size, size); //DO NOT COMMENT THIS (it prevent the OSX incomplete read buffer crash) dummyTex = new Texture2D(size, size, Format.RGBA8); shadowFB.setColorTexture(dummyTex); shadowMapSize = (float)size; preshadowMat = new Material(manager, "Common/MatDefs/Shadow/PreShadow.j3md"); postshadowMat = new Material(manager, "Common/MatDefs/Shadow/BasicPostShadow.j3md"); postshadowMat.setTexture("ShadowMap", shadowMap); dispPic.setTexture(manager, shadowMap, false); for (int i = 0; i < points.length; i++) { points[i] = new Vector3f(); } }
setShadowIntensity(0.7f); shadowCam = new Camera(size, size); shadowCam.setParallelProjection(true);
@Before public void setUp() { filter = new DefaultLightFilter(); cam = new Camera(512, 512); cam.setFrustumPerspective(45, 1, 1, 1000); cam.setLocation(Vector3f.ZERO); cam.lookAtDirection(Vector3f.UNIT_Z, Vector3f.UNIT_Y); filter.setCamera(cam); Box box = new Box(1, 1, 1); geom = new Geometry("geom", box); geom.setLocalTranslation(0, 0, 10); geom.updateGeometricState(); list = new LightList(geom); }
public void setupOffscreenView(){ offCamera = new Camera(width, height);
public Texture setupOffscreenView(){ Camera offCamera = new Camera(512, 512);
public void simpleInitApp() { ViewPort niftyView = renderManager.createPreView("NiftyView", new Camera(1024, 768)); niftyView.setClearFlags(true, true, true); NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
public Texture setupOffscreenView(){ Camera offCamera = new Camera(512, 512);