本文整理汇总了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;
}