You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the following piece of code to create a custom Body shape for my player, the application crashes with "Fatal signal 11 (SIGSEGV)" (see error message after method).
But when I remove just 3 Vector entries from the array, the application does not crash.
private static Body createPlayerBody(final PhysicsWorld pPhysicsWorld, final IEntity pEntity, final BodyType pBodyType, final FixtureDef pFixtureDef) {
if (mPlayerBody == null) {
final float width = pEntity.getWidth() / PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT;
final float height = pEntity.getHeight() / PhysicsConstants.PIXEL_TO_METER_RATIO_DEFAULT;
final Vector2[] vertices = {
new Vector2(-0.06771f*width, -0.23047f*height),
new Vector2(-0.07292f*width, -0.48047f*height),
new Vector2(+0.14062f*width, -0.48438f*height),
new Vector2(+0.11979f*width, -0.23438f*height),
new Vector2(+0.46875f*width, -0.02344f*height),
new Vector2(+0.34896f*width, +0.36328f*height),
new Vector2(-0.06771f*width, +0.48828f*height),
new Vector2(-0.40104f*width, +0.32422f*height),
new Vector2(-0.40625f*width, -0.04688f*height)
};
mPlayerBody = PhysicsFactory.createPolygonBody(pPhysicsWorld, pEntity, vertices, pBodyType, pFixtureDef);
}
return mPlayerBody;
}
The entity is a TiledSprite, by the way, if that helps. And the problem is definitely due to the size of the Vector2[] array. I've just tested changing the size from 6 items to 9 items - and the application did crash again. Same error.
When I use the following piece of code to create a custom Body shape for my player, the application crashes with "Fatal signal 11 (SIGSEGV)" (see error message after method).
But when I remove just 3 Vector entries from the array, the application does not crash.
Error message:
The text was updated successfully, but these errors were encountered: