Class Attribute
java.lang.Object
gaiasky.util.gdx.shader.attribute.Attribute
- All Implemented Interfaces:
Comparable<Attribute>
- Direct Known Subclasses:
BlendingAttribute
,CascadeShadowMapAttribute
,ClippingPlaneAttribute
,ColorAttribute
,CubemapAttribute
,DepthTestAttribute
,DirectionalLightsAttribute
,FloatAttribute
,FogAttribute
,IntAttribute
,Matrix3Attribute
,Matrix4Attribute
,MirrorAttribute
,MirrorSourceAttribute
,OcclusionCloudsAttribute
,PBRFlagAttribute
,PBRHDRColorAttribute
,PBRIridescenceAttribute
,PBRVolumeAttribute
,PointLightsAttribute
,SpotLightsAttribute
,TextureAttribute
,Vector2Attribute
,Vector3Attribute
,Vector4Attribute
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Attribute
copy()
protected boolean
boolean
static String
getAttributeAlias
(Bits type) static int
getAttributeIndex
(Bits type) static int
getAttributeIndex
(String alias) static Bits
getAttributeType
(String alias) protected static int
getIndex
(long oldType) static int
static com.badlogic.gdx.utils.Array
<String> getTypes()
boolean
has
(int index) int
hashCode()
protected static int
Call this method to register a custom attribute type, see the wiki for an example.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
type
The type of this attribute -
index
public final int index
-
-
Constructor Details
-
Attribute
protected Attribute(int index) -
Attribute
protected Attribute(long oldType)
-
-
Method Details
-
getIndex
protected static int getIndex(long oldType) -
getAttributeType
- Returns:
- The ID of the specified attribute type, or zero if not available
-
getAttributeAlias
- Returns:
- The alias of the specified attribute type, or null if not available.
-
getAttributeIndex
- Returns:
- The index of the specified attribute type, or -1 if not available.
-
getAttributeIndex
- Returns:
- The index of the specified attribute alias, or -1 if not available.
-
register
Call this method to register a custom attribute type, see the wiki for an example. If the alias already exists, then that ID will be reused. The alias should be unambiguous and will by default be returned by the call totoString()
.- Parameters:
alias
- The alias of the type to register, must be different for each direct type, will be used for debugging.- Returns:
- the index of the newly registered type, or the index of the existing type if the alias was already registered.
-
getNumAttributes
public static int getNumAttributes() -
getTypes
-
has
public boolean has(int index) -
copy
- Returns:
- An exact copy of this attribute
-
equals
-
equals
-
toString
-
hashCode
public int hashCode()
-