X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FJmeRenderingComponent.java;fp=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FJmeRenderingComponent.java;h=159bd98650d23024befc30dd9ce1e89f82854e7f;hb=10f144a2bb2d7bec98b812b83acecb333fd098ea;hp=0000000000000000000000000000000000000000;hpb=3055b543aa5afc0cca4bb3b341704e7c5103fa6a;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/proconf/g3d/base/JmeRenderingComponent.java b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/JmeRenderingComponent.java new file mode 100644 index 00000000..159bd986 --- /dev/null +++ b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/JmeRenderingComponent.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2007- VTT Technical Research Centre of Finland. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.proconf.g3d.base; + +import com.jme.renderer.Camera; +import com.jme.scene.Node; +import com.jme.system.DisplaySystem; + + + + +/** + * Rendering component + * Allows to change underlying rendering so that + * additional information can be presented to the user + * + * @author Marko Luukkainen + * + */ +public abstract class JmeRenderingComponent { + public static final int PARALLEL_PROJECTION = 0; + public static final int PERSPECTIVE_PROJECTION = 1; + + /** + * Returns root node for nodes that cast and receive shadows. + * @return + */ + public abstract Node getShadowRoot(); + + /** + * Returns root node for nodes that do not cast shadows. + * @return + */ + public abstract Node getNoCastRoot(); + + /** + * Returns root node of the scenegraph + * @return + */ + public abstract Node getRoot(); + + /** + * Returns root node of orthogonal nodes (nodes that always face the camera) + * @return + */ + public abstract Node getOrthoNode(); + + /** + * Returns root node for nodes that do not cast or receive shadows. + * @return + */ + public abstract Node getNoShadowRoot(); + + public abstract void init(DisplaySystem displaySystem); + + /** + * Sets projection policy. + * FIXME : this was for Xith compatibility! + * @param policy + */ + public abstract void setProjectionPolicy(int policy); + public abstract int getProjectionPolicy(); + + public abstract float getScreenScale(); + public abstract void setScreenScale(float screenScale); + public abstract float getFieldOfView(); + public abstract void dispose(); + + /** + * Update flag (Return true if view needs to be rendered) + * @return + */ + public boolean update() {return false;} + public abstract Camera getCamera(); + + public abstract void render(); + public abstract void resize(int width, int height); + public abstract DisplaySystem getDisplaySystem(); + + /** + * TODO : this is for debugging purposes and will be removed. + * @param text + */ + public abstract void setDebugText(String text); +}