Game Development Reference
In-Depth Information
public void setPhoneme(PhonemeMouth p){
mouthChannel.setAnim("Phoneme_" + p.name(), 0.2f);
}
public void setExpression(ExpressionEyes e){
eyeBrowChannel.setAnim("Expression_" + e.name(),
0.2f);
}
8. We can reuse any test class we might have from other recipes and just apply some
new code to it as seen in the following code snippet. We set up a simple cinematic
sequence that makes Jaime say (or mime) Hello and look happy.
Tip
When this recipe was written, the following AnimationEvent constructor did
not exist and AnimChannels were not applied properly. A patch has been sub-
mitted but may not have made it into a stable build. If required, the patch can be
found in the The AnimationEvent patch section in Appendix , Information Gather-
ing . It can also be acquired by turning on nightly builds in the SDK.
public void setupHelloCinematic() {
cinematicHello = new Cinematic((Node)jaime, 1f);
stateManager.attach(cinematicHello);
cinematicHello.addCinematicEvent(0.0f, new
AnimationEvent(jaime, "Expression_HAPPY", LoopMode.Cycle,
2, 0.2f));
cinematicHello.addCinematicEvent(0.1f, new
AnimationEvent(jaime, "Phoneme_EEE", LoopMode.Cycle, 1,
0.1f));
cinematicHello.addCinematicEvent(0.2f, new
AnimationEvent(jaime, "Phoneme_LUH", LoopMode.Cycle, 1,
0.1f));
cinematicHello.addCinematicEvent(0.3f, new
AnimationEvent(jaime, "Phoneme_OOOH", LoopMode.Cycle, 1,
0.1f));
cinematicHello.addCinematicEvent(0.7f, new
AnimationEvent(jaime, "Phoneme_RESET", LoopMode.Cycle, 1,
0.2f));
Search WWH ::




Custom Search