在发动机体创建期间的信号11(SIGSEGV),代码1(SEGV_MAPERR)

时间:2012-04-04 12:15:03

标签: android andengine

在创建具有物理行为的游戏期间使用andengine库时,我发现“SIGSEGV”崩溃。

我确信每个正文和形状修改都是在更新线程内完成的,我在发生这种变化的地方得到了线程ID,它是相同的。然后,我想错误不会从那里传来。

我想要做的是: - 我有一个触摸事件,每次触摸屏幕并移动手指时都会创建一个新的身体。而且我不能回收身体,因为尺寸因手指移动而不同。

这样的事情:

TextureRegion lineTextureRegion = null;
float xDiff = Math.abs(x2 - x1); //info from touch event
float yDiff = Math.abs(y2 - y1);
int width = (int)Math.sqrt((xDiff * xDiff) + (yDiff * yDiff));

lineTextureRegion = gameRepository.getNubeTextureRegion().clone(); //this is a REPEATING_BILINEAR_PREMULTIPLYALPHA
lineTextureRegion.setHeight(32);
lineTextureRegion.setWidth(width);

final Sprite sprite = new Sprite(x1, y1, width, 32, lineTextureRegion);
sprite.setRotationCenter(0, 0);
sprite.setRotation(GameRepository.getAngle(x1, y1, x2, y2));

Body body = PhysicsFactory.createBoxBody(physicsWorld, sprite, BodyType.StaticBody, LINE_FIXTURE_DEF);

attachChild(sprite);

我还有一个TimerHandler,可以在特定时刻创建Bodies:

Sprite sprite = new Sprite(x, y, gameRepository.getCoinTextureRegion());
attachChild(sprite);
FadeInModifier prFadeInModifier = new FadeInModifier(1f, EaseLinear.getInstance());
sprite.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
sprite.registerEntityModifier(prFadeInModifier);
Body theBody = PhysicsFactory.createCircleBody(physicsWorld, entity.getShape(), BodyType.DynamicBody, FIXTURE_DEF);
PhysicsConnector fcH = new PhysicsConnector(entity.getShape(), entity.getBody());
physicsWorld.registerPhysicsConnector(fcH);

我希望通过循环体来改善这一点,因为在这种情况下,对象完全相同。但这是我最后一个避免这种想法的想法:

04-04 08:56:04.021: I/DEBUG(6034): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-04 08:56:04.021: I/DEBUG(6034): Build fingerprint: 'google/passion_vf/passion:2.3.6/GRK39F/224392.2:user/release-keys'
04-04 08:56:04.031: I/DEBUG(6034): pid: 10056, tid: 10067 >>> com.sinplanbsoft.ballsofdroid <<<
04-04 08:56:04.031: I/DEBUG(6034): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 3f800010
04-04 08:56:04.031: I/DEBUG(6034): r0 4300fa15 r1 4300fa15 r2 00000000 r3 8601f42a
04-04 08:56:04.031: I/DEBUG(6034): r4 003c27f8 r5 3f800000 r6 bf43aaab r7 c160542b
04-04 08:56:04.031: I/DEBUG(6034): r8 4582db6c r9 4572dbbc 10 4092c000 fp ffffffff
04-04 08:56:04.031: I/DEBUG(6034): ip 00000079 sp 4582dad0 lr 80a189d0 pc 80a18944 cpsr 20000010
04-04 08:56:04.031: I/DEBUG(6034): d0 4200000041800000 d1 bf9a6f4a3f000000
04-04 08:56:04.031: I/DEBUG(6034): d2 3ff921fb54442d18 d3 3ff921fb54442d18
04-04 08:56:04.031: I/DEBUG(6034): d4 4228000042a00000 d5 0000000042a00000
04-04 08:56:04.031: I/DEBUG(6034): d6 0000000042440000 d7 0000000000000000
04-04 08:56:04.031: I/DEBUG(6034): d8 418000004392c000 d9 4430241a43cd5fdb

有人解决我的问题吗?我做错了什么?

先谢谢,我完全陷入了困境。

0 个答案:

没有答案