punchButton.setEnabled(false);
}
});
basePanel.add(punchButton);
headCheck = new UICheckBox("Procedurally turn head");
headCheck.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, punchButton, Alignment.BOTTOM_LEFT, 0, -5));
headCheck.setSelected(true);
headCheck.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent event) {
manager.getValuesStore().put("head_blend", headCheck.isSelected() ? 1.0 : 0.0);
}
});
basePanel.add(headCheck);
final UICheckBox gpuSkinningCheck = new UICheckBox("Use GPU skinning");
gpuSkinningCheck
.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, headCheck, Alignment.BOTTOM_LEFT, 0, -5));
gpuSkinningCheck.setSelected(false);
gpuSkinningCheck.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent event) {
_root.acceptVisitor(new Visitor() {
@Override
public void visit(final Spatial spatial) {
if (spatial instanceof SkinnedMesh) {
final SkinnedMesh skinnedSpatial = (SkinnedMesh) spatial;
if (gpuSkinningCheck.isSelected()) {
skinnedSpatial.setGPUShader(gpuShader);
skinnedSpatial.setUseGPU(true);
} else {
skinnedSpatial.setGPUShader(null);
skinnedSpatial.clearRenderState(StateType.GLSLShader);
skinnedSpatial.setUseGPU(false);
}
}
}
}, true);
}
});
basePanel.add(gpuSkinningCheck);
final UICheckBox vboCheck = new UICheckBox("Use VBO");
vboCheck.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, gpuSkinningCheck, Alignment.BOTTOM_LEFT, 0, -5));
vboCheck.setSelected(false);
vboCheck.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent event) {
skNode.getSceneHints().setDataMode(vboCheck.isSelected() ? DataMode.VBO : DataMode.Arrays);
gpuShader.setUseAttributeVBO(vboCheck.isSelected());
}
});
basePanel.add(vboCheck);
final UICheckBox skeletonCheck = new UICheckBox("Show skeleton");
final UICheckBox boneLabelCheck = new UICheckBox("Show joint labels");
skeletonCheck.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, vboCheck, Alignment.BOTTOM_LEFT, 0, -5));
skeletonCheck.setSelected(showSkeleton);
skeletonCheck.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent event) {
showSkeleton = skeletonCheck.isSelected();
boneLabelCheck.setEnabled(showSkeleton);
}
});
basePanel.add(skeletonCheck);
boneLabelCheck.setLayoutData(new AnchorLayoutData(Alignment.TOP_LEFT, skeletonCheck, Alignment.BOTTOM_LEFT, 0,
-5));
boneLabelCheck.setSelected(false);
boneLabelCheck.setEnabled(showSkeleton);
boneLabelCheck.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent event) {
showJointLabels = boneLabelCheck.isSelected();
}
});
basePanel.add(boneLabelCheck);
optionsFrame.updateMinimumSizeFromContents();