Represents a sprite in 3d space. Typical 3d transformations such as translation, rotation and scaling are supported. The position includes a z component other than setting the depth no manual layering has to be performed, correct overlay is guaranteed by using the depth buffer.
Decals are handled by the DecalBatch.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| protected Color | |
| protected Vector2 | |
| pack-priv static final Vector3 | |
| protected DecalMaterial | |
| protected Vector3 | |
| protected Quaternion | |
| protected static Quaternion | |
| protected Vector2 | |
| public static final int | SIZE
Size of the decal in floats. |
| private static Vector3 | tmp
Temporary vector for various calculations. |
| private static Vector3 | |
| public Vector2 | transformationOffset
The transformation offset can be used to change the pivot point for rotation and scaling. |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| protected boolean | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public int | value
Set a multipurpose value which can be queried and used for things like group identification. |
| private static final int | VERTEX_SIZE
Size of a decal vertex in floats |
| protected float[] | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Color | |
| public float | |
| public DecalMaterial | |
| public Vector3 | |
| public Quaternion | |
| public float | |
| public float | |
| public TextureRegion | |
| public float[] | |
| public float | |
| public float | |
| public float | |
| public float | |
| public void | |
| public static Decal | Returns: Created decalTexture region to use textureRegion)Creates a decal assuming the dimensions of the texture region |
| public static Decal | Returns: Created decalTexture region to use textureRegion, boolean Whether or not this sprite will be treated as having transparency (transparent png, etc.) hasTransparency)Creates a decal assuming the dimensions of the texture region and adding transparency |
| public static Decal | Returns: Created decalWidth of the decal in world units width, float Height of the decal in world units height, TextureRegion TextureRegion to use textureRegion)Creates a decal using the region for texturing |
| public static Decal | Returns: Created decalWidth of the decal in world units width, float Height of the decal in world units height, TextureRegion TextureRegion to use textureRegion, boolean Whether or not this sprite will be treated as having transparency (transparent png, etc.) hasTransparency)Creates a decal using the region for texturing |
| public static Decal | Returns: Created decalWidth of the decal in world units width, float Height of the decal in world units height, TextureRegion TextureRegion to use textureRegion, int Source blend used by glBlendFunc srcBlendFactor, int Destination blend used by glBlendFunc dstBlendFactor)Creates a decal using the region for texturing and the specified blending parameters for blending |
| public static Decal | Returns: Created decalWidth of the decal in world units width, float Height of the decal in world units height, TextureRegion TextureRegion to use textureRegion, int Source blend used by glBlendFunc srcBlendFactor, int Destination blend used by glBlendFunc dstBlendFactor, DecalMaterial Custom decal material material)Creates a decal using the region for texturing and the specified blending parameters for blending |
| protected void | resetVertices()
Resets the position components of the vertices array based ont he dimensions (preparation for transformation) |
| public void | |
| public void | |
| public void | |
| public void | setBlending(int
Source blend factor used by glBlendFunc srcBlendFactor, int Destination blend factor used by glBlendFunc dstBlendFactor)Sets the blending parameters for this decal |
| public void | setColor(float
Red component r, float Green component g, float Blue component b, float Alpha component a)Sets the color of all four vertices to the specified color |
| public void | |
| public void | setDimensions(float
Width in world units width, float Height in world units height)Sets the width and height in world units |
| public void | |
| public void | |
| public void | |
| public void | setPosition(float
X position x, float Y Position y, float Z Position z)Sets the position to the given world coordinates |
| public void | |
| public void | setRotation(float
Angle in degrees to rotate around the Y axis yaw, float Angle in degrees to rotate around the X axis pitch, float Angle in degrees to rotate around the Z axis roll)Sets the rotation of this decal to the given angles on all axes. |
| public void | setRotation(Vector3
the direction vector dir, Vector3 the up vector up)Sets the rotation of this decal based on the (normalized) direction and up vector. |
| public void | setRotation(Quaternion
desired Rotation q)Sets the rotation of this decal based on the provided Quaternion |
| public void | setRotationX(float
Angle in degrees to set rotation to angle)Sets the rotation on the local X axis to the specified angle |
| public void | setRotationY(float
Angle in degrees to set rotation to angle)Sets the rotation on the local Y axis to the specified angle |
| public void | setRotationZ(float
Angle in degrees to set rotation to angle)Sets the rotation on the local Z axis to the specified angle |
| public void | setScale(float
Scale on the x axis scaleX, float Scale on the y axis scaleY)Sets scale along both the x and y axis |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| protected void | transformVertices()
Transforms the position component of the vertices using properties such as position, scale, etc. |
| public void | translate(float
Units to move along the x axis x, float Units to move along the y axis y, float Units to move along the z axis z)Translates by the specified amount of units |
| public void | |
| public void | translateX(float
Units to move the decal units)Moves by the specified amount of units along the x axis |
| public void | translateY(float
Units to move the decal units)Moves by the specified amount of units along the y axis |
| public void | translateZ(float
Units to move the decal units)Moves by the specified amount of units along the z axis |
| protected void | |
| protected void | updateUVs()
Re-applies the uv coordinates from the material's texture region to the uv components of the vertices array |
| C1 | back to summary |
|---|---|
| public static final int C1 | |
| C2 | back to summary |
|---|---|
| public static final int C2 | |
| C3 | back to summary |
|---|---|
| public static final int C3 | |
| C4 | back to summary |
|---|---|
| public static final int C4 | |
| color | back to summary |
|---|---|
| protected Color color | |
| dimensions | back to summary |
|---|---|
| protected Vector2 dimensions | |
| dir | back to summary |
|---|---|
| pack-priv static final Vector3 dir | |
| material | back to summary |
|---|---|
| protected DecalMaterial material | |
| position | back to summary |
|---|---|
| protected Vector3 position | |
| rotation | back to summary |
|---|---|
| protected Quaternion rotation | |
| rotator | back to summary |
|---|---|
| protected static Quaternion rotator | |
| scale | back to summary |
|---|---|
| protected Vector2 scale | |
| SIZE | back to summary |
|---|---|
| public static final int SIZE Size of the decal in floats. It takes a float[SIZE] to hold the decal. | |
| tmp | back to summary |
|---|---|
| private static Vector3 tmp Temporary vector for various calculations. | |
| tmp2 | back to summary |
|---|---|
| private static Vector3 tmp2 | |
| transformationOffset | back to summary |
|---|---|
| public Vector2 transformationOffset The transformation offset can be used to change the pivot point for rotation and scaling. By default the pivot is the middle of the decal. | |
| U1 | back to summary |
|---|---|
| public static final int U1 | |
| U2 | back to summary |
|---|---|
| public static final int U2 | |
| U3 | back to summary |
|---|---|
| public static final int U3 | |
| U4 | back to summary |
|---|---|
| public static final int U4 | |
| updated | back to summary |
|---|---|
| protected boolean updated | |
| V1 | back to summary |
|---|---|
| public static final int V1 | |
| V2 | back to summary |
|---|---|
| public static final int V2 | |
| V3 | back to summary |
|---|---|
| public static final int V3 | |
| V4 | back to summary |
|---|---|
| public static final int V4 | |
| value | back to summary |
|---|---|
| public int value Set a multipurpose value which can be queried and used for things like group identification. | |
| VERTEX_SIZE | back to summary |
|---|---|
| private static final int VERTEX_SIZE Size of a decal vertex in floats | |
| vertices | back to summary |
|---|---|
| protected float[] vertices | |
| X1 | back to summary |
|---|---|
| public static final int X1 | |
| X2 | back to summary |
|---|---|
| public static final int X2 | |
| X3 | back to summary |
|---|---|
| public static final int X3 | |
| X4 | back to summary |
|---|---|
| public static final int X4 | |
| Y1 | back to summary |
|---|---|
| public static final int Y1 | |
| Y2 | back to summary |
|---|---|
| public static final int Y2 | |
| Y3 | back to summary |
|---|---|
| public static final int Y3 | |
| Y4 | back to summary |
|---|---|
| public static final int Y4 | |
| Z1 | back to summary |
|---|---|
| public static final int Z1 | |
| Z2 | back to summary |
|---|---|
| public static final int Z2 | |
| Z3 | back to summary |
|---|---|
| public static final int Z3 | |
| Z4 | back to summary |
|---|---|
| public static final int Z4 | |
| Decal | back to summary |
|---|---|
| public Decal() | |
| Decal | back to summary |
|---|---|
| public Decal(DecalMaterial material) | |
| getColor | back to summary |
|---|---|
| public Color getColor() Returns the color of this decal. The returned color should under no circumstances be modified.
| |
| getHeight | back to summary |
|---|---|
public float getHeight()
| |
| getMaterial | back to summary |
|---|---|
| public DecalMaterial getMaterial() | |
| getPosition | back to summary |
|---|---|
| public Vector3 getPosition() Returns the position of this decal. The returned vector should under no circumstances be modified.
| |
| getRotation | back to summary |
|---|---|
| public Quaternion getRotation() Returns the rotation. The returned quaternion should under no circumstances be modified.
| |
| getScaleX | back to summary |
|---|---|
public float getScaleX()
| |
| getScaleY | back to summary |
|---|---|
public float getScaleY()
| |
| getTextureRegion | back to summary |
|---|---|
public TextureRegion getTextureRegion()
| |
| getVertices | back to summary |
|---|---|
| public float[] getVertices() Returns the vertices backing this sprite.
| |
| getWidth | back to summary |
|---|---|
public float getWidth()
| |
| getX | back to summary |
|---|---|
public float getX()
| |
| getY | back to summary |
|---|---|
public float getY()
| |
| getZ | back to summary |
|---|---|
public float getZ()
| |
| lookAt | back to summary |
|---|---|
| public void lookAt(Vector3 position, Vector3 up) Sets the rotation of the Decal to face the given point. Useful for billboarding. | |
| newDecal | back to summary |
|---|---|
| public static Decal newDecal(TextureRegion textureRegion) Creates a decal assuming the dimensions of the texture region
| |
| newDecal | back to summary |
|---|---|
| public static Decal newDecal(TextureRegion textureRegion, boolean hasTransparency) Creates a decal assuming the dimensions of the texture region and adding transparency
| |
| newDecal | back to summary |
|---|---|
| public static Decal newDecal(float width, float height, TextureRegion textureRegion) Creates a decal using the region for texturing
| |
| newDecal | back to summary |
|---|---|
| public static Decal newDecal(float width, float height, TextureRegion textureRegion, boolean hasTransparency) Creates a decal using the region for texturing
| |
| newDecal | back to summary |
|---|---|
| public static Decal newDecal(float width, float height, TextureRegion textureRegion, int srcBlendFactor, int dstBlendFactor) Creates a decal using the region for texturing and the specified blending parameters for blending
| |
| newDecal | back to summary |
|---|---|
| public static Decal newDecal(float width, float height, TextureRegion textureRegion, int srcBlendFactor, int dstBlendFactor, DecalMaterial material) Creates a decal using the region for texturing and the specified blending parameters for blending
| |
| resetVertices | back to summary |
|---|---|
| protected void resetVertices() Resets the position components of the vertices array based ont he dimensions (preparation for transformation) | |
| rotateX | back to summary |
|---|---|
| public void rotateX(float angle) Rotates along local X axis by the specified angle
| |
| rotateY | back to summary |
|---|---|
| public void rotateY(float angle) Rotates along local Y axis by the specified angle
| |
| rotateZ | back to summary |
|---|---|
| public void rotateZ(float angle) Rotates along local Z axis by the specified angle
| |
| setBlending | back to summary |
|---|---|
| public void setBlending(int srcBlendFactor, int dstBlendFactor) Sets the blending parameters for this decal
| |
| setColor | back to summary |
|---|---|
| public void setColor(float r, float g, float b, float a) Sets the color of all four vertices to the specified color
| |
| setColor | back to summary |
|---|---|
| public void setColor(Color tint) Sets the color used to tint this decal. Default is | |
| setDimensions | back to summary |
|---|---|
| public void setDimensions(float width, float height) Sets the width and height in world units
| |
| setHeight | back to summary |
|---|---|
| public void setHeight(float height) Sets the height in world units
| |
| setMaterial | back to summary |
|---|---|
| public void setMaterial(DecalMaterial material) Set material
| |
| setPackedColor | back to summary |
|---|---|
| public void setPackedColor(float color) Sets the color of this decal, expanding the alpha from 0-254 to 0-255.
| |
| setPosition | back to summary |
|---|---|
| public void setPosition(float x, float y, float z) Sets the position to the given world coordinates
| |
| setPosition | back to summary |
|---|---|
| public void setPosition(Vector3 pos) | |
| setRotation | back to summary |
|---|---|
| public void setRotation(float yaw, float pitch, float roll) Sets the rotation of this decal to the given angles on all axes.
| |
| setRotation | back to summary |
|---|---|
| public void setRotation(Vector3 dir, Vector3 up) Sets the rotation of this decal based on the (normalized) direction and up vector. | |
| setRotation | back to summary |
|---|---|
| public void setRotation(Quaternion q) Sets the rotation of this decal based on the provided Quaternion
| |
| setRotationX | back to summary |
|---|---|
| public void setRotationX(float angle) Sets the rotation on the local X axis to the specified angle
| |
| setRotationY | back to summary |
|---|---|
| public void setRotationY(float angle) Sets the rotation on the local Y axis to the specified angle
| |
| setRotationZ | back to summary |
|---|---|
| public void setRotationZ(float angle) Sets the rotation on the local Z axis to the specified angle
| |
| setScale | back to summary |
|---|---|
| public void setScale(float scaleX, float scaleY) Sets scale along both the x and y axis
| |
| setScale | back to summary |
|---|---|
| public void setScale(float scale) Sets scale along both the x and y axis
| |
| setScaleX | back to summary |
|---|---|
| public void setScaleX(float scale) Sets scale along the x axis
| |
| setScaleY | back to summary |
|---|---|
| public void setScaleY(float scale) Sets scale along the y axis
| |
| setTextureRegion | back to summary |
|---|---|
| public void setTextureRegion(TextureRegion textureRegion) Sets the texture region
| |
| setWidth | back to summary |
|---|---|
| public void setWidth(float width) Sets the width in world units
| |
| setX | back to summary |
|---|---|
| public void setX(float x) Sets the position on the x axis
| |
| setY | back to summary |
|---|---|
| public void setY(float y) Sets the position on the y axis
| |
| setZ | back to summary |
|---|---|
| public void setZ(float z) Sets the position on the z axis
| |
| transformVertices | back to summary |
|---|---|
| protected void transformVertices() Transforms the position component of the vertices using properties such as position, scale, etc. | |
| translate | back to summary |
|---|---|
| public void translate(float x, float y, float z) Translates by the specified amount of units
| |
| translate | back to summary |
|---|---|
public void translate(Vector3 trans)
| |
| translateX | back to summary |
|---|---|
| public void translateX(float units) Moves by the specified amount of units along the x axis
| |
| translateY | back to summary |
|---|---|
| public void translateY(float units) Moves by the specified amount of units along the y axis
| |
| translateZ | back to summary |
|---|---|
| public void translateZ(float units) Moves by the specified amount of units along the z axis
| |
| update | back to summary |
|---|---|
| protected void update() Recalculates vertices array if it grew out of sync with the properties (position, ..) | |
| updateUVs | back to summary |
|---|---|
| protected void updateUVs() Re-applies the uv coordinates from the material's texture region to the uv components of the vertices array | |