Package com.ardor3d.renderer

Examples of com.ardor3d.renderer.Camera


        bQuad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        bQuad.getSceneHints().setCullHint(CullHint.Never);
    }

    public static void drawBuffer(final TextureStoreFormat rttFormat, final int location, final Renderer r) {
        final Camera cam = Camera.getCurrentCamera();
        drawBuffer(rttFormat, location, r, cam.getWidth() / 6.25);
    }
View Full Code Here


        drawBuffer(rttFormat, location, r, cam.getWidth() / 6.25);
    }

    public static void drawBuffer(final TextureStoreFormat rttFormat, final int location, final Renderer r,
            final double size) {
        final Camera cam = Camera.getCurrentCamera();
        r.flushGraphics();
        double locationX = cam.getWidth(), locationY = cam.getHeight();
        bQuad.resize(size, (cam.getHeight() / (double) cam.getWidth()) * size);
        if (bQuad.getLocalRenderState(RenderState.StateType.Texture) == null) {
            final TextureState ts = new TextureState();
            bufTexture = new Texture2D();
            ts.setTexture(bufTexture);
            bQuad.setRenderState(ts);
        }

        int width = cam.getWidth();
        if (!MathUtils.isPowerOfTwo(width)) {
            int newWidth = 2;
            do {
                newWidth <<= 1;

            } while (newWidth < width);
            bQuad.getMeshData().getTextureBuffer(0).put(4, width / (float) newWidth);
            bQuad.getMeshData().getTextureBuffer(0).put(6, width / (float) newWidth);
            width = newWidth;
        }

        int height = cam.getHeight();
        if (!MathUtils.isPowerOfTwo(height)) {
            int newHeight = 2;
            do {
                newHeight <<= 1;

View Full Code Here

    protected boolean _swapTargets = false;
    protected final TextureStoreFormat _outputFormat;

    public EffectManager(final DisplaySettings settings, final TextureStoreFormat outputformat) {
        _canvasSettings = settings;
        _fsqCamera = new Camera(settings.getWidth(), settings.getHeight());
        _fsqCamera.setFrustum(-1, 1, -1, 1, 1, -1);
        _fsqCamera.setProjectionMode(ProjectionMode.Parallel);
        _fsqCamera.setAxes(Vector3.NEG_UNIT_X, Vector3.UNIT_Y, Vector3.NEG_UNIT_Z);

        _outputFormat = outputformat;
View Full Code Here

    }

    @Override
    public synchronized void draw(final Renderer r) {
        if (_textString.length() > 0) {
            final Camera cam = Camera.getCurrentCamera();

            if (!(_autoScale == AutoScale.Off && _autoFade == AutoFade.Off)) {
                updateScaleAndAlpha(cam, r);
            }
            correctTransform(cam);
View Full Code Here

    protected double distanceToCam(final Spatial spat) {
        if (spat._queueDistance != Double.NEGATIVE_INFINITY) {
            return spat._queueDistance;
        }

        final Camera cam = Camera.getCurrentCamera();

        if (spat.getWorldBound() != null && Vector3.isValid(spat.getWorldBound().getCenter())) {
            spat._queueDistance = spat.getWorldBound().distanceToEdge(cam.getLocation());
        } else {
            final ReadOnlyVector3 spatPosition = spat.getWorldTranslation();
            if (!Vector3.isValid(spatPosition)) {
                spat._queueDistance = Double.POSITIVE_INFINITY;
            } else {
                spat._queueDistance = cam.getLocation().distance(spatPosition);
            }
        }

        return spat._queueDistance;
    }
View Full Code Here

     *
     * @param camera
     *            Camera
     */
    private void rotateCameraAligned() {
        final Camera camera = Camera.getCurrentCamera();
        _look.set(camera.getLocation()).subtractLocal(_worldTransform.getTranslation());
        // coopt left for our own purposes.
        final Vector3 xzp = _left;
        // The xzp vector is the projection of the look vector on the xz plane
        xzp.set(_look.getX(), 0, _look.getZ());

View Full Code Here

     *
     * @param camera
     *            Camera
     */
    private void rotateScreenAligned() {
        final Camera camera = Camera.getCurrentCamera();
        // coopt diff for our in direction:
        _look.set(camera.getDirection()).negateLocal();
        // coopt loc for our left direction:
        _left.set(camera.getLeft()).negateLocal();
        _orient.fromAxes(_left, camera.getUp(), _look);
        _worldTransform.setRotation(_orient);
    }
View Full Code Here

     *
     * @param camera
     *            Camera
     */
    private void rotateAxial(final Vector3 axis) {
        final Camera camera = Camera.getCurrentCamera();
        // Compute the additional rotation required for the billboard to face
        // the camera. To do this, the camera must be inverse-transformed into
        // the model space of the billboard.
        _look.set(camera.getLocation()).subtractLocal(_worldTransform.getTranslation());
        final Matrix3 worldMatrix = Matrix3.fetchTempInstance().set(_worldTransform.getMatrix());
        worldMatrix.applyPost(_look, _left); // coopt left for our own purposes.
        final ReadOnlyVector3 scale = _worldTransform.getScale();
        _left.divideLocal(scale);

View Full Code Here

            setLastFrustumIntersection(Camera.FrustumIntersect.Intersects);
            draw(r);
            return;
        }

        final Camera camera = Camera.getCurrentCamera();
        final int state = camera.getPlaneState();

        // check to see if we can cull this node
        _frustumIntersects = ((_parent != null && _parent.getWorldBound() != null) ? _parent._frustumIntersects
                : Camera.FrustumIntersect.Intersects);

        if (cm == CullHint.Dynamic && _frustumIntersects == Camera.FrustumIntersect.Intersects) {
            _frustumIntersects = camera.contains(_worldBound);
        }

        if (_frustumIntersects != Camera.FrustumIntersect.Outside) {
            draw(r);
        }
        camera.setPlaneState(state);
    }
View Full Code Here

        final RenderContext context = ContextManager.getCurrentContext();
        final RendererRecord record = context.getRendererRecord();

        if (strict) {
            // grab our camera to get width and height info.
            final Camera cam = Camera.getCurrentCamera();

            gl.glEnable(GL.GL_SCISSOR_TEST);
            gl.glScissor(0, 0, cam.getWidth(), cam.getHeight());
            record.setClippingTestEnabled(true);
        }

        gl.glClear(clear);
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.Camera

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.