本文整理匯總了Java中com.jme3.scene.Node.addLight方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.addLight方法的具體用法?Java Node.addLight怎麽用?Java Node.addLight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.scene.Node
的用法示例。
在下文中一共展示了Node.addLight方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setPbrScene
import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* Set the scene to put a light probe.
*
* @param scene the scene to put a light probe.
*/
public void setPbrScene(@Nullable final Node scene) {
final Node prevScene = getPbrScene();
if (prevScene != null) {
prevScene.removeLight(lightProbe);
}
this.pbrScene = scene;
if (scene != null) {
scene.addLight(lightProbe);
}
this.frame = 0;
}
示例2: onEnable
import com.jme3.scene.Node; //導入方法依賴的package包/類
@Override
protected void onEnable() {
super.onEnable();
final Node pbrScene = getPbrScene();
if (pbrScene == null) {
return;
}
final LightList lightList = pbrScene.getLocalLightList();
for (int i = 0; i < lightList.size(); i++) {
if (lightList.get(i) == lightProbe) {
return;
}
}
pbrScene.addLight(lightProbe);
}
示例3: updateLightEnabledImpl
import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* Update the light in the scene in the {@link EditorThread}.
*
* @param enabled true if light should be enabled.
*/
@JMEThread
protected void updateLightEnabledImpl(final boolean enabled) {
if (enabled == isLightEnabled()) return;
final DirectionalLight light = getLightForCamera();
final Node stateNode = getStateNode();
if (enabled) {
stateNode.addLight(light);
} else {
stateNode.removeLight(light);
}
setLightEnabled(enabled);
}
示例4: updateLightEnabledImpl
import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* The process of updating the light.
*/
@JMEThread
private void updateLightEnabledImpl(boolean enabled) {
if (enabled == isLightEnabled()) return;
final DirectionalLight light = getLightForCamera();
final Node stateNode = getStateNode();
if (enabled) {
stateNode.addLight(light);
} else {
stateNode.removeLight(light);
}
setLightEnabled(enabled);
}
示例5: AdvancedAbstractEditor3DState
import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* Instantiates a new Advanced abstract editor app state.
*
* @param fileEditor the file editor
*/
public AdvancedAbstractEditor3DState(@NotNull final T fileEditor) {
super(fileEditor);
this.cameraMoving = new AtomicInteger();
this.editorCamera = needEditorCamera() ? createEditorCamera() : null;
this.lightForCamera = needLightForCamera() ? createLightForCamera() : null;
this.prevCameraLocation = new Vector3f();
this.cameraKeysState = new boolean[4];
this.cameraSpeed = 1F;
if (lightForCamera != null) {
final Node stateNode = getStateNode();
stateNode.addLight(lightForCamera);
}
this.analogListener = this::onAnalogImpl;
this.actionListener = this::onActionImpl;
this.actionHandlers = DictionaryFactory.newObjectDictionary();
this.analogHandlers = DictionaryFactory.newObjectDictionary();
registerActionHandlers(actionHandlers);
registerAnalogHandlers(analogHandlers);
}
示例6: prepareScene
import com.jme3.scene.Node; //導入方法依賴的package包/類
/**
* Prepare a transfer processor to transfer preview result to a image view.
*
* @return the transfer processor.
*/
@JMEThread
private @NotNull FrameTransferSceneProcessor prepareScene() {
final Editor editor = Editor.getInstance();
final AssetManager assetManager = editor.getAssetManager();
final Spatial sky = SkyFactory.createSky(assetManager, "graphics/textures/sky/studio.hdr",
SkyFactory.EnvMapType.EquirectMap);
final DirectionalLight light = new DirectionalLight();
light.setDirection(LIGHT_DIRECTION);
final Node cameraNode = new Node("Camera node");
final Node rootNode = editor.getPreviewNode();
rootNode.addControl(this);
rootNode.attachChild(sky);
rootNode.addLight(light);
rootNode.attachChild(cameraNode);
rootNode.attachChild(modelNode);
final Camera camera = editor.getPreviewCamera();
final EditorCamera editorCamera = new EditorCamera(camera, cameraNode);
editorCamera.setMaxDistance(10000);
editorCamera.setMinDistance(0.01F);
editorCamera.setSmoothMotion(false);
editorCamera.setRotationSensitivity(1);
editorCamera.setZoomSensitivity(0.2F);
//TODO added supporting moving the camera
processor = bind(editor, imageView, imageView, editor.getPreviewViewPort(), false);
processor.setTransferMode(ON_CHANGES);
processor.setEnabled(false);
return processor;
}