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

Comments

Projects
None yet
2 participants
@stephengold
Copy link
Contributor

commented Jan 9, 2019

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor Author

commented Jan 9, 2019

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 added a commit that referenced this issue Jan 10, 2019

@stephengold

This comment has been minimized.

Copy link
Contributor Author

commented Jan 10, 2019

Fixed in master branch at hash 51b12e1.

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.