the onTouchEvent initializes the world (with its contents) and starts the ticking thread. The ticking thread modifies the world and then requests a redraw. The error happens even if I sync tick and draw. Any chance of learning what's in line 1021?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
if (false){
SimpleVector center = getTransformedCenter();
SimpleVector t = new SimpleVector(speedX + center.x, speedY + center.y, center.z);
SimpleVector avoid = checkForCollisionSpherical(t, 5f);
if (avoid.equals(t))
translate(speedX, speedY, 0);
}
if (false){
SimpleVector avoid = checkForCollisionSpherical(new SimpleVector(speedX, speedY, 0), 5f);
translate(avoid);
}
if (true){
//SimpleVector move = new SimpleVector();//getTransformedCenter();
SimpleVector t = getXAxis();
t.scalarMul(speedX);
move.add(t);
t = getYAxis();
t.scalarMul(speedY);
move.add(t);
move.z = 0;
//System.out.println(t);
move = checkForCollisionSpherical(move, 5f);
translate(move);
}
[...] on creation
try {
zombie = Loader.loadMD2(ctx.getResources().getAssets().open("zombie.md2"), 0.1f);
zombie.translate(0, 7, -3);
zombie.rotateX((float) (-Math.PI / 2));
zombie.rotateZ((float) (Math.PI / 2));
zombie.setTexture("zombieskin");
zombie.compile();// SOLUTION: that line was the problem, so just remove this line!
zombie.strip();
zombie.build();
} catch (IOException ex) {
Logger.getLogger(GameRenderer.class.getName()).log(Level.SEVERE, null, ex);
}
[...] on draw
float anim = 0;
public void onDrawFrame(GL10 gl) {
if (running){
//System.out.println(zombie.getAnimationSequence().getSequence("run"));
zombie.animate(anim, zombie.getAnimationSequence().getSequence("stand"));
zombie.rotateZ(0.01f);
anim += 0.1;
if (anim >= 1)
anim = 0;
fb.clear(BLACK);
world.renderScene(fb);
world.draw(fb);
fb.display();
} else
fb.dispose();
}
Page created in 0.013 seconds with 8 queries.