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

IllegalArgumentException Thrown from ColladaMeshShape.createNormals() #93

Open
mkelly1495 opened this issue Jan 27, 2017 · 0 comments
Open
Labels

Comments

@mkelly1495
Copy link

When working with Collada models (with lighting enabled), the ColladaMeshShape.createNormals() method throws an IllegalArgumentException intermittently. I looked at the code, and the offending line appears to be line 896:
this.normalBuffer.position(this.normalBuffer.position() + thisSize);

It looks like the position specified by this.normalBuffer.position()+thisSize is not a valid position in some cases. I think this issue can be resolved by simply introducing a check to ensure the position is valid:

if(this.normalBuffer.limit() >= this.normalBuffer.position() + thisSize)
{
this.normalBuffer.position(this.normalBuffer.position() + thisSize);
}

It may also be a good idea to provide a similar check in the ColladaMeshShape.createTexCoords() method.

@pdavidc pdavidc added the bug label Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants