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

RagdollUtils can't handle 16-bit bone indices #1004

Closed
stephengold opened this issue Jan 9, 2019 · 3 comments
Closed

RagdollUtils can't handle 16-bit bone indices #1004

stephengold opened this issue Jan 9, 2019 · 3 comments
Assignees
Labels
Physics Issues with all kinds of Physics and their Bindings
Milestone

Comments

@stephengold
Copy link
Member

Models imported using the GltfLoader typically have 16-bit bone indices.
If a KinematicRagdollControl is added to such a model, a ClassCastException is thrown in RagdollUtils.

Here is a typical stack trace, courtesy of oxplay2:

SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ClassCastException: java.nio.DirectShortBufferU cannot be cast to java.nio.ByteBuffer
at com.jme3.bullet.control.ragdoll.RagdollUtils.getPoints(RagdollUtils.java:229)
at com.jme3.bullet.control.ragdoll.RagdollUtils.makeShapeFromVerticeWeights(RagdollUtils.java:203)
at com.jme3.bullet.control.KinematicRagdollControl.boneRecursion(KinematicRagdollControl.java:534)
at com.jme3.bullet.control.KinematicRagdollControl.scanSpatial(KinematicRagdollControl.java:515)
at com.jme3.bullet.control.KinematicRagdollControl.createSpatialData(KinematicRagdollControl.java:467)
at com.jme3.bullet.control.AbstractPhysicsControl.setSpatial(AbstractPhysicsControl.java:182)
at com.jme3.scene.Spatial.addControl(Spatial.java:769)
at test.RagdollTest3.simpleInitApp(RagdollTest3.java:130)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
at java.lang.Thread.run(Thread.java:748)
@stephengold stephengold self-assigned this Jan 9, 2019
@oxplay2
Copy link

oxplay2 commented Jan 9, 2019

it was simple cube with one bone(p -> automatic weight) using Blender 2.79b.

Was working using blender exporter, but using gltf exporter was above exception.

Anyway KinematicRagdollControl will be replaced by DynamicAnimControl?
based on "If you’re on JME 3.2, you can start using DynamicAnimControl any time you want. You don’t have to wait for JME 3.3 to be released."

but i agree, it might take long time before 3.3

@stephengold
Copy link
Member Author

Thanks for the additional info. I've created my own test case.

This issue should be fixed in 3.2.3, if that ever happens.

@stephengold
Copy link
Member Author

Fixed in master branch at hash 51b12e1.

@stephengold stephengold added this to the v3.2.3 milestone Feb 19, 2019
@stephengold stephengold added the Physics Issues with all kinds of Physics and their Bindings label Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Physics Issues with all kinds of Physics and their Bindings
Projects
None yet
Development

No branches or pull requests

2 participants