Package com.ardor3d.renderer.state.record

Examples of com.ardor3d.renderer.state.record.ClipStateRecord


public abstract class LwjglClipStateUtil {

    public static void apply(final ClipState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final ClipStateRecord record = (ClipStateRecord) context.getStateRecord(StateType.Clip);
        context.setCurrentState(StateType.Clip, state);

        final ContextCapabilities caps = context.getCapabilities();
        final int max = Math.min(ClipState.MAX_CLIP_PLANES, caps.getMaxUserClipPlanes());

        if (state.isEnabled()) {
            for (int i = 0; i < max; i++) {
                enableClipPlane(i, state.getPlaneEnabled(i), state, record);
            }
        } else {
            for (int i = 0; i < max; i++) {
                enableClipPlane(i, false, state, record);
            }
        }

        if (!record.isValid()) {
            record.validate();
        }
    }
View Full Code Here


        planeEquations = capsule.readDoubleArray2D("planeEquations", new double[MAX_CLIP_PLANES][4]);
    }

    @Override
    public StateRecord createStateRecord(final ContextCapabilities caps) {
        return new ClipStateRecord(caps);
    }
View Full Code Here

public abstract class JoglClipStateUtil {

    public static void apply(final JoglRenderer renderer, final ClipState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final ClipStateRecord record = (ClipStateRecord) context.getStateRecord(StateType.Clip);
        context.setCurrentState(StateType.Clip, state);

        final ContextCapabilities caps = context.getCapabilities();
        final int max = Math.min(ClipState.MAX_CLIP_PLANES, caps.getMaxUserClipPlanes());

        if (state.isEnabled()) {
            for (int i = 0; i < max; i++) {
                enableClipPlane(i, state.getPlaneEnabled(i), state, record);
            }
        } else {
            for (int i = 0; i < max; i++) {
                enableClipPlane(i, false, state, record);
            }
        }

        if (!record.isValid()) {
            record.validate();
        }
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.state.record.ClipStateRecord

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.