Skip to content
Snippets Groups Projects
Commit 5ca8f95a authored by Florian Hölzl's avatar Florian Hölzl
Browse files

added xyzStaticImpl

refs 1589
parent d582ea0e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@ Export-Package: org.fortiss.tooling.graphicsGL,
org.fortiss.tooling.graphicsGL.model.graph,
org.fortiss.tooling.graphicsGL.model.graph.impl,
org.fortiss.tooling.graphicsGL.model.graph.util,
org.fortiss.tooling.graphicsGL.model.impl,
org.fortiss.tooling.graphicsGL.model.mesh,
org.fortiss.tooling.graphicsGL.model.mesh.impl,
org.fortiss.tooling.graphicsGL.model.mesh.util,
......
......@@ -101,17 +101,17 @@
<eClassifiers xsi:type="ecore:EClass" name="Light3D" eSuperTypes="#//LightSystemEntity3DBase #//Positioned3DBase platform:/resource/org.fortiss.tooling.kernel/model/kernel.ecore#//INamedCommentedElement">
<eOperations name="getConstantAttenuation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="if (this.getAttenuation() != null) {&#xA;return this.getAttenuation().getX();&#xA;}&#xA;return 1.0f;"/>
<details key="body" value="return Light3DStaticImpl.getConstantAttenuation(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getLinearAttenuation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="if (this.getAttenuation() != null) {&#xA;return this.getAttenuation().getY();&#xA;}&#xA;return 0.0f;"/>
<details key="body" value="return Light3DStaticImpl.getLinearAttenuation(this);"/>
</eAnnotations>
</eOperations>
<eOperations name="getQuadraticAttenuation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="if (this.getAttenuation() != null) {&#xA;return this.getAttenuation().getZ();&#xA;}&#xA;return 0.0f;"/>
<details key="body" value="return Light3DStaticImpl.getQuadraticAttenuation(this);"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="attenuation" eType="#//Vector3D"
......
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2013 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.graphicsGL.model.scene.impl;
import org.fortiss.tooling.graphicsGL.model.scene.Light3D;
/**
* Static implementations of {@link Light3D}.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
class Light3DStaticImpl {
/** Returns the constant attenuation of the given light. */
static float getConstantAttenuation(Light3D lght) {
if(lght.getAttenuation() != null) {
return lght.getAttenuation().getX();
}
return 1.0f;
}
/** Returns the linear attenuation of the given light. */
static float getLinearAttenuation(Light3D lght) {
if(lght.getAttenuation() != null) {
return lght.getAttenuation().getY();
}
return 0.0f;
}
/** Returns the quadratic attenuation of the given light. */
static float getQuadraticAttenuation(Light3D lght) {
if(lght.getAttenuation() != null) {
return lght.getAttenuation().getZ();
}
return 0.0f;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment