Package fcagnin.jglsdk.glm

Examples of fcagnin.jglsdk.glm.Vec3


        ;


        public Vec3 interpolate(float alpha) {
            if ( values.isEmpty() ) {
                new Vec3();
            }

            if ( values.size() == 1 ) {
                return new Vec3( values.get( 0 ).data );
            }

            // Find which segment we are within.
            int segment = 1;
            for (; segment < values.size(); segment++ ) {
                if ( alpha < values.get( segment ).weight ) {
                    break;
                }
            }

            if ( segment == values.size() ) {
                return new Vec3( values.get( segment - 1 ).data );
            }

            float sectionAlpha = alpha - values.get( segment - 1 ).weight;
            sectionAlpha /= values.get( segment ).weight - values.get( segment - 1 ).weight;
View Full Code Here


        void setValues(ArrayList<Vec3> data, boolean isLoop) {
            values.clear();

            for ( Vec3 curr : data ) {
                Data currData = new Data();
                currData.data = new Vec3( curr );
                currData.weight = 0.0f;
                values.add( currData );
            }

            if ( isLoop ) {
                Data currData = new Data();
                currData.data = new Vec3( data.get( 0 ) );
                currData.weight = 0.0f;
                values.add( currData );
            }

            // Compute the distances of each segment.
View Full Code Here


    public static class UniformVec3Binder extends UniformBinderBase {

        public void setValue(Vec3 val) {
            this.val = new Vec3( val );
        }
View Full Code Here

TOP

Related Classes of fcagnin.jglsdk.glm.Vec3

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.