Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException in Uniform class #1065

rvandoosselaer opened this issue Apr 9, 2019 · 0 comments


None yet
2 participants
Copy link

commented Apr 9, 2019

Fix in: #1066

There is an error in the class cast checking in the Uniform class, line 376.

//feed this.value with the collected values.
if (this.value instanceof ColorRGBA) {
    ((ColorRGBA) this.value).set(vec4.x, vec4.y, vec4.z, vec4.w);
} else if (value instanceof Vector4f) {
    ((Vector4f) this.value).set(vec4);
} else {
    ((Quaternion) this.value).set(vec4.x, vec4.y, vec4.z, vec4.w);

the check is looking for value instead of this.value.


java.lang.ClassCastException: com.jme3.math.Vector4f cannot be cast to com.jme3.math.Quaternion
        at com.jme3.shader.Uniform.setValue( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.material.Material.updateShaderMaterialParameters( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.material.Material.render( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.RenderManager.renderGeometry( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.queue.RenderQueue.renderGeometryList( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.queue.RenderQueue.renderQueue( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.RenderManager.renderViewPortQueues( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.RenderManager.flushQueue( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.RenderManager.renderViewPort( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.renderer.RenderManager.render( ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at ~[jme3-core-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop( ~[jme3-lwjgl-3.3.0-alpha1.jar:3.3-alpha1]
        at com.jme3.system.lwjgl.LwjglDisplay.runLoop( ~[jme3-lwjgl-3.3.0-alpha1.jar:3.3-alpha1]
        at ~[jme3-lwjgl-3.3.0-alpha1.jar:3.3-alpha1]

pspeed42 added a commit that referenced this issue Apr 9, 2019

@stephengold stephengold added this to the v3.3.0 milestone Jun 18, 2019

@stephengold stephengold modified the milestones: v3.3.0, v3.2.4 Jun 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.