Skip to content

Commit 89e01a6

Browse files
committed
chore: simplify example by removing automatic idle motion logic
1 parent dbb8a35 commit 89e01a6

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

  • example/src/main/java/dev/eatgrapes/live2d/example

example/src/main/java/dev/eatgrapes/live2d/example/Main.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ private void init() {
6666

6767
if (model.isHit("HitArea", nx, ny)) {
6868
System.out.println("Hit Body!");
69-
// Priority 3: Override the idle motion
7069
model.startMotion(motions.get("m04"), 3, false, null);
7170
}
7271
} catch (Exception e) { e.printStackTrace(); }
@@ -87,7 +86,6 @@ private void setup() throws Exception {
8786
model.registerTexture(0, loadTex("/model/Hiyori/Hiyori.2048/texture_00.png"));
8887
model.registerTexture(1, loadTex("/model/Hiyori/Hiyori.2048/texture_01.png"));
8988

90-
motions.put("idle", load("/model/Hiyori/motions/Hiyori_m01.motion3.json"));
9189
motions.put("m04", load("/model/Hiyori/motions/Hiyori_m04.motion3.json"));
9290
}
9391

@@ -104,11 +102,6 @@ private void loop() {
104102
mvp[0] = 1.0f / aspect; mvp[5] = 1.0f; mvp[10] = 1.0f; mvp[15] = 1.0f;
105103
}
106104

107-
// Standard state machine: if nothing is playing, play idle
108-
if (model.isMotionFinished()) {
109-
model.startMotion(motions.get("idle"), 1, false, null);
110-
}
111-
112105
model.update(0.016f);
113106
model.draw(mvp);
114107
glfwSwapBuffers(window);
@@ -149,4 +142,4 @@ private int loadTex(String p) throws Exception {
149142
}
150143

151144
public static void main(String[] args) throws Exception { new Main().run(); }
152-
}
145+
}

0 commit comments

Comments
 (0)