本文整理匯總了Java中com.jme3.scene.Spatial.getControl方法的典型用法代碼示例。如果您正苦於以下問題:Java Spatial.getControl方法的具體用法?Java Spatial.getControl怎麽用?Java Spatial.getControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.scene.Spatial
的用法示例。
在下文中一共展示了Spatial.getControl方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getChildren
import com.jme3.scene.Spatial; //導入方法依賴的package包/類
@Override
@FXThread
public @NotNull Array<TreeNode<?>> getChildren(@NotNull final NodeTree<?> nodeTree) {
final Array<TreeNode<?>> result = ArrayFactory.newArray(TreeNode.class);
final Spatial element = getElement();
final LightList lightList = element.getLocalLightList();
lightList.forEach(light -> {
if (!(light instanceof InvisibleObject)) {
result.add(FACTORY_REGISTRY.createFor(light));
}
});
final int numControls = element.getNumControls();
for (int i = 0; i < numControls; i++) {
final Control control = element.getControl(i);
result.add(FACTORY_REGISTRY.createFor(control));
}
return result;
}
示例2: checkSpatial
import com.jme3.scene.Spatial; //導入方法依賴的package包/類
/**
* Check a spatial to have a edited wheel.
*
* @param spatial the spatial.
* @return true if the spatial has this wheel.
*/
private boolean checkSpatial(@NotNull final Spatial spatial) {
final VehicleControl control = spatial.getControl(VehicleControl.class);
if (control == null) return false;
final int numWheels = control.getNumWheels();
for (int i = 0; i < numWheels; i++) {
final VehicleWheel wheel = control.getWheel(i);
if (wheel == getEditObject()) return true;
}
return false;
}