Package com.jme3.material.plugins
Class ConditionParser
java.lang.Object
com.jme3.material.plugins.ConditionParser
A utility class that parses a define condition in a GLSL language
style.
extractDefines is able to get a list of defines in an expression and update
the formatter expression with uppercased defines
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionextractDefines
(String expression) Parses a condition and returns the list of defines of this condition.static void
-
Constructor Details
-
ConditionParser
public ConditionParser()
-
-
Method Details
-
main
-
extractDefines
Parses a condition and returns the list of defines of this condition. Additionally, this method updates the formattedExpression with uppercased defines names. supported expression syntax example:
"(LightMap && SeparateTexCoord) || !ColorMap"
"#if (defined(LightMap) && defined(SeparateTexCoord)) || !defined(ColorMap)"
"#ifdef LightMap"
"#ifdef (LightMap && SeparateTexCoord) || !ColorMap"
- Parameters:
expression
- the expression to parse- Returns:
- the list of defines
-
getFormattedExpression
- Returns:
- the formatted expression previously updated by extractDefines
-