Updated PersonalMotionPreviewElement

This commit is contained in:
Luca Warmenhoven
2024-05-29 16:11:43 +02:00
parent 6ffbb503c9
commit 2426e7b2e2

View File

@@ -102,12 +102,12 @@ public class PersonalMotionPreviewElement extends View {
this.axisVectors = new Vector2f[] {
projectVertex(new Vector3f(-1.0f, 0, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(1.0f, 0, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(0, -1.0f, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(0, 1.0f, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(0, 0, -1.0f), getWidth(), getHeight()),
projectVertex(new Vector3f(0, 0, 1.0f), getWidth(), getHeight())
projectVertex(new Vector3f(-100.0f, 0, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(100.0f, 0, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(0, -100.0f, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(0, 100.0f, 0), getWidth(), getHeight()),
projectVertex(new Vector3f(0, 0, -100.0f), getWidth(), getHeight()),
projectVertex(new Vector3f(0, 0, 100.0f), getWidth(), getHeight())
};
}
@@ -142,6 +142,9 @@ public class PersonalMotionPreviewElement extends View {
Log.i("MotionProcessor", "Processed data: " + progress + " (" + preprocessed + ")");
Vector2f parsed = projectVertex(processed, this.getWidth(), this.getHeight());
this.vectors.add(parsed);
// Remove the first element if the array is too big
if (this.vectors.size() > 100)
this.vectors.poll();
});
saySomethingNice();
}