Package com.badlogic.gdx.graphics.g3d
Class Attribute
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.Attribute
-
- All Implemented Interfaces:
java.lang.Comparable<Attribute>
- Direct Known Subclasses:
BlendingAttribute
,ColorAttribute
,CubemapAttribute
,DepthTestAttribute
,DirectionalLightsAttribute
,FloatAttribute
,IntAttribute
,PointLightsAttribute
,SpotLightsAttribute
,TextureAttribute
public abstract class Attribute extends java.lang.Object implements java.lang.Comparable<Attribute>
Extend this class to implement a material attribute. Register the attribute type by statically calling theregister(String)
method, whose return value should be used to instantiate the attribute. A class can implement multiple types
-
-
Field Summary
Fields Modifier and Type Field Description long
type
The type of this attribute
-
Constructor Summary
Constructors Modifier Constructor Description protected
Attribute(long type)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Attribute
copy()
protected boolean
equals(Attribute other)
boolean
equals(java.lang.Object obj)
static java.lang.String
getAttributeAlias(long type)
static long
getAttributeType(java.lang.String alias)
int
hashCode()
protected static long
register(java.lang.String alias)
Call this method to register a custom attribute type, see the wiki for an example.java.lang.String
toString()
-
-
-
Method Detail
-
getAttributeType
public static final long getAttributeType(java.lang.String alias)
- Returns:
- The ID of the specified attribute type, or zero if not available
-
getAttributeAlias
public static final java.lang.String getAttributeAlias(long type)
- Returns:
- The alias of the specified attribute type, or null if not available.
-
register
protected static final long register(java.lang.String alias)
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 unambiguously and will by default be returned by the call totoString()
. A maximum of 64 attributes can be registered as a long bitmask can only hold 64 bits.- Parameters:
alias
- The alias of the type to register, must be different for each direct type, will be used for debugging- Returns:
- the ID of the newly registered type, or the ID of the existing type if the alias was already registered
- Throws:
GdxRuntimeException
- if maximum attribute count reached
-
copy
public abstract Attribute copy()
- Returns:
- An exact copy of this attribute
-
equals
protected boolean equals(Attribute other)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-