Commit 87142f86 authored by iSergio's avatar iSergio
Browse files

Merge branch '1.87.1' into 'develop'

Some functional add and new example

See merge request !16
parents 4efdb1e4 572f6753
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -28,15 +28,15 @@ public class Axis {
     * Denotes the x-axis.
     */
    @JsProperty(name = "X")
    public native Number X();
    public static native Number X();
    /**
     * Denotes the y-axis.
     */
    @JsProperty(name = "Y")
    public native Number Y();
    public static native Number Y();
    /**
     * Denotes the z-axis.
     */
    @JsProperty(name = "Z")
    public native Number Z();
    public static native Number Z();
}
+1 −4
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package org.cesiumjs.cs.scene.experimental;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsType;
import jsinterop.annotations.*;
import org.cesiumjs.cs.core.*;
import org.cesiumjs.cs.scene.experimental.options.CustomShaderOptions;

@@ -27,7 +25,6 @@ import org.cesiumjs.cs.scene.experimental.options.CustomShaderOptions;
 */
@JsType(isNative = true, namespace = "Cesium", name = "CustomShader")
public class CustomShader {

    @JsConstructor
    public CustomShader(CustomShaderOptions options) {}

+17 −17
Original line number Diff line number Diff line
@@ -29,83 +29,83 @@ public class UniformType {
     * A single floating point value.
     */
    @JsProperty(name = "FLOAT")
    public native String FLOAT();
    public static native String FLOAT();
    /**
     * A vector of 2 floating point values.
     */
    @JsProperty(name = "VEC2")
    public native String VEC2();
    public static native String VEC2();
    /**
     * A vector of 3 floating point values.
     */
    @JsProperty(name = "VEC3")
    public native String VEC3();
    public static native String VEC3();
    /**
     * A vector of 4 floating point values.
     */
    @JsProperty(name = "VEC4")
    public native String VEC4();
    public static native String VEC4();
    /**
     * A single integer value
     */
    @JsProperty(name = "INT")
    public native String INT();
    public static native String INT();
    /**
     * A vector of 2 integer values.
     */
    @JsProperty(name = "INT_VEC2")
    public native String INT_VEC2();
    public static native String INT_VEC2();
    /**
     * A vector of 3 integer values.
     */
    @JsProperty(name = "INT_VEC3")
    public native String INT_VEC3();
    public static native String INT_VEC3();
    /**
     * A vector of 4 integer values.
     */
    @JsProperty(name = "INT_VEC4")
    public native String INT_VEC4();
    public static native String INT_VEC4();
    /**
     * A single boolean value.
     */
    @JsProperty(name = "BOOL")
    public native String BOOL();
    public static native String BOOL();
    /**
     * A vector of 2 boolean values.
     */
    @JsProperty(name = "BOOL_VEC2")
    public native String BOOL_VEC2();
    public static native String BOOL_VEC2();
    /**
     * A vector of 3 boolean values.
     */
    @JsProperty(name = "BOOL_VEC3")
    public native String BOOL_VEC3();
    public static native String BOOL_VEC3();
    /**
     * A vector of 4 boolean values.
     */
    @JsProperty(name = "BOOL_VEC4")
    public native String BOOL_VEC4();
    public static native String BOOL_VEC4();
    /**
     * A 2x2 matrix of floating point values.
     */
    @JsProperty(name = "MAT2")
    public native String MAT2();
    public static native String MAT2();
    /**
     * A 3x3 matrix of floating point values.
     */
    @JsProperty(name = "MAT3")
    public native String MAT3();
    public static native String MAT3();
    /**
     * A 3x3 matrix of floating point values.
     */
    @JsProperty(name = "MAT4")
    public native String MAT4();
    public static native String MAT4();
    /**
     * A 2D sampled texture.
     */
    @JsProperty(name = "SAMPLER_2D")
    public native String SAMPLER_2D();
    public static native String SAMPLER_2D();

    @JsProperty(name = "SAMPLER_CUBE")
    public native String SAMPLER_CUBE();
    public static native String SAMPLER_CUBE();
}
+74 −6
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package org.cesiumjs.cs.scene.experimental.options;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import jsinterop.annotations.*;
import org.cesiumjs.cs.Cesium;
import org.cesiumjs.cs.js.JsObject;
import org.cesiumjs.cs.scene.experimental.CustomShader;
import org.cesiumjs.cs.scene.experimental.enums.CustomShaderMode;
import org.cesiumjs.cs.scene.experimental.enums.LightingModel;

@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class CustomShaderOptions {
@@ -40,8 +42,20 @@ public class CustomShaderOptions {
     */
    @JsProperty
    public boolean isTranslucent;
//    uniforms	Object.<String, UniformSpecifier>		optional A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code. The value is an object that describes the uniform type and initial value
//    varyings	Object.<String, VaryingType>		optional A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex shader and using the value in the fragment shader.
    /**
     * A dictionary for user-defined uniforms. The key is the uniform name that will appear in the GLSL code.
     * The value is an object that describes the uniform type and initial value
     */
    @JsProperty
    public JsObject uniforms;
    /**
     * A dictionary for declaring additional GLSL varyings used in the shader. The key is the varying name that will
     * appear in the GLSL code. The value is the data type of the varying. For each varying, the declaration will be
     * added to the top of the shader automatically. The caller is responsible for assigning a value in the vertex
     * shader and using the value in the fragment shader.
     */
    @JsProperty
    public JsObject varyings;
    /**
     * The custom vertex shader as a string of GLSL code. It must include a GLSL function called vertexMain. See the
     * example for the expected signature. If not specified, the custom vertex shader step will be skipped in
@@ -59,4 +73,58 @@ public class CustomShaderOptions {

    @JsConstructor
    public CustomShaderOptions() {}

    @JsOverlay
    public final CustomShaderOptions setMode(String mode) {
        this.mode = mode;
        return this;
    }

    @JsOverlay
    public final CustomShaderOptions setLightingModel(Number lightingModel) {
        this.lightingModel = lightingModel;
        return this;
    }

    @JsOverlay
    public final CustomShaderOptions setTranslucent(boolean isTranslucent) {
        this.isTranslucent = isTranslucent;
        return this;
    }

    @JsOverlay
    public final CustomShaderOptions addUniform(String name, String type, Object value) {
        if (this.uniforms == JsObject.undefined()) {
            this.uniforms = JsObject.create();
        }
        JsObject uniform = JsObject.create();
        uniform.setProperty("type", type);
        uniform.setProperty("value", value);

        JsObject.setProperty(uniforms, name, uniform);

        return this;
    }

    @JsOverlay
    public final CustomShaderOptions addVarying(String name, String type) {
        if (this.varyings == JsObject.undefined()) {
            this.varyings = JsObject.create();
        }
        JsObject.setProperty(this.varyings, name, type);

        return this;
    }

    @JsOverlay
    public final CustomShaderOptions setVertexShaderText(String vertexShaderText) {
        this.vertexShaderText = vertexShaderText;
        return this;
    }

    @JsOverlay
    public final CustomShaderOptions setFragmentShaderText(String fragmentShaderText) {
        this.fragmentShaderText = fragmentShaderText;
        return this;
    }
}
+85 −4
Original line number Diff line number Diff line
@@ -16,10 +16,7 @@

package org.cesiumjs.cs.scene.options;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import jsinterop.annotations.*;
import org.cesiumjs.cs.core.*;
import org.cesiumjs.cs.scene.Camera;

@@ -116,4 +113,88 @@ public class CameraFlyToOptions {
    @JsConstructor
    public CameraFlyToOptions() {
    }

    @JsOverlay
    public final CameraFlyToOptions setDestination(Cartesian3 destination) {
        this.destinationPos = destination;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setDestination(Rectangle destination) {
        this.destinationRec = destination;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setOrientation(HeadingPitchRoll orientation) {
        this.orientation = orientation;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setDuration(double duration) {
        this.duration = duration;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setComplete(Camera.FlightCompleteCallback complete) {
        this.complete = complete;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setCancel(Camera.FlightCancelledCallback cancel) {
        this.cancel = cancel;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setEndTransform(Matrix4 endTransform) {
        this.endTransform = endTransform;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setMaximumHeight(double maximumHeight) {
        this.maximumHeight = maximumHeight;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setPitchAdjustHeight(double pitchAdjustHeight) {
        this.pitchAdjustHeight = pitchAdjustHeight;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setFlyOverLongitude(double flyOverLongitude) {
        this.flyOverLongitude = flyOverLongitude;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setFlyOverLongitudeWeight(double flyOverLongitudeWeight) {
        this.flyOverLongitudeWeight = flyOverLongitudeWeight;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setEasingFunction(EasingFunction easingFunction) {
        this.easingFunction = easingFunction;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setEasingFunctionCallback(EasingFunction.Callback easingFunctionCallback) {
        this.easingFunctionCallback = easingFunctionCallback;
        return this;
    }

    @JsOverlay
    public final CameraFlyToOptions setOffset(HeadingPitchRange offset) {
        this.offset = offset;
        return this;
    }
}
Loading