ボールが跳ね回る小さな jMonkey プログラムがあります。各ボールの 3d ベクトルを毎秒記録したいと考えています。
コードを実行すると:
@Override
public void simpleUpdate(float tpf) {
if(getTimer().getTimeInSeconds() >= 1) {
out.write("\n" + count + " ");
out.write(ball1g.getLocalTranslation() + " ");
out.write(ball2g.getLocalTranslation() + " ");
out.write(ball3g.getLocalTranslation().toString());
count++;
getTimer().reset();
}
}
テキスト ファイルが完全に空白です。しかし、私が実行すると:
@Override
public void simpleUpdate(float tpf) {
out.write("this can be anything bigger than one character wide");
if(getTimer().getTimeInSeconds() >= 1) {
out.write("\n" + count + " ");
out.write(ball1g.getLocalTranslation() + " ");
out.write(ball2g.getLocalTranslation() + " ");
out.write(ball3g.getLocalTranslation().toString());
count++;
getTimer().reset();
}
}
私の実際のデータの間に途方もない量の文字があるだけで機能します。
out.write("");
何もしません。少なくとも
out.write(" ");
またはそれ以上。
私は何か間違ったことをしていますか?そうでない場合、どうすればこれを回避でき、同じタスクを達成できますか?