public class Decal extends Object
DecalBatch
.Modifier and Type | Field and Description |
---|---|
static int |
C1 |
static int |
C2 |
static int |
C3 |
static int |
C4 |
static int |
SIZE
Size of the decal in floats.
|
Vector2 |
transformationOffset
The transformation offset can be used to change the pivot point for rotation and scaling.
|
static int |
U1 |
static int |
U2 |
static int |
U3 |
static int |
U4 |
static int |
V1 |
static int |
V2 |
static int |
V3 |
static int |
V4 |
int |
value
Set a multipurpose value which can be queried and used for things like group identification.
|
static int |
X1 |
static int |
X2 |
static int |
X3 |
static int |
X4 |
static int |
Y1 |
static int |
Y2 |
static int |
Y3 |
static int |
Y4 |
static int |
Z1 |
static int |
Z2 |
static int |
Z3 |
static int |
Z4 |
Constructor and Description |
---|
Decal() |
Modifier and Type | Method and Description |
---|---|
float |
getHeight() |
DecalMaterial |
getMaterial() |
Vector3 |
getPosition()
Returns the position of this decal.
|
Quaternion |
getRotation()
Returns the rotation.
|
float |
getScaleX() |
float |
getScaleY() |
TextureRegion |
getTextureRegion() |
float[] |
getVertices()
Returns the vertices backing this sprite.
The returned value should under no circumstances be modified. |
float |
getWidth() |
float |
getX() |
float |
getY() |
float |
getZ() |
void |
lookAt(Vector3 position,
Vector3 up)
Sets the rotation of the Decal to face the given point.
|
static Decal |
newDecal(float width,
float height,
TextureRegion textureRegion)
Creates a decal using the region for texturing
|
static Decal |
newDecal(float width,
float height,
TextureRegion textureRegion,
boolean hasTransparency)
Creates a decal using the region for texturing
|
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
|
static Decal |
newDecal(TextureRegion textureRegion)
Creates a decal assuming the dimensions of the texture region
|
static Decal |
newDecal(TextureRegion textureRegion,
boolean hasTransparency)
Creates a decal assuming the dimensions of the texture region and adding transparency
|
void |
rotateX(float angle)
Rotates along local X axis by the specified angle
|
void |
rotateY(float angle)
Rotates along local Y axis by the specified angle
|
void |
rotateZ(float angle)
Rotates along local Z axis by the specified angle
|
void |
setBlending(int srcBlendFactor,
int dstBlendFactor)
Sets the blending parameters for this decal
|
void |
setColor(Color tint)
Sets the color used to tint this decal.
|
void |
setColor(float color) |
void |
setColor(float r,
float g,
float b,
float a)
Sets the color of all four vertices to the specified color
|
void |
setDimensions(float width,
float height)
Sets the width and height in world units
|
void |
setHeight(float height)
Sets the height in world units
|
void |
setPosition(float x,
float y,
float z)
Sets the position to the given world coordinates
|
void |
setRotation(Vector3 dir,
Vector3 up)
Sets the rotation of this decal based on the (normalized) direction and up vector.
|
void |
setRotationX(float angle)
Sets the rotation on the local X axis to the specified angle
|
void |
setRotationY(float angle)
Sets the rotation on the local Y axis to the specified angle
|
void |
setRotationZ(float angle)
Sets the rotation on the local Z axis to the specified angle
|
void |
setScale(float scale)
Sets scale along both the x and y axis
|
void |
setScale(float scaleX,
float scaleY)
Sets scale along both the x and y axis
|
void |
setScaleX(float scale)
Sets scale along the x axis
|
void |
setScaleY(float scale)
Sets scale along the y axis
|
void |
setTextureRegion(TextureRegion textureRegion)
Sets the texture region
|
void |
setWidth(float width)
Sets the width in world units
|
void |
setX(float x)
Sets the position on the x axis
|
void |
setY(float y)
Sets the position on the y axis
|
void |
setZ(float z)
Sets the position on the z axis
|
void |
translate(float x,
float y,
float z)
Translates by the specified amount of units
|
void |
translateX(float units)
Moves by the specified amount of units along the x axis
|
void |
translateY(float units)
Moves by the specified amount of units along the y axis
|
void |
translateZ(float units)
Moves by the specified amount of units along the z axis
|
public static final int SIZE
public int value
public Vector2 transformationOffset
public static final int X1
public static final int Y1
public static final int Z1
public static final int C1
public static final int U1
public static final int V1
public static final int X2
public static final int Y2
public static final int Z2
public static final int C2
public static final int U2
public static final int V2
public static final int X3
public static final int Y3
public static final int Z3
public static final int C3
public static final int U3
public static final int V3
public static final int X4
public static final int Y4
public static final int Z4
public static final int C4
public static final int U4
public static final int V4
public void setColor(float r, float g, float b, float a)
r
- Red componentg
- Green componentb
- Blue componenta
- Alpha componentpublic void setColor(Color tint)
Color.WHITE
.public void setColor(float color)
setColor(Color)
public void setRotationX(float angle)
angle
- Angle in degrees to set rotation topublic void setRotationY(float angle)
angle
- Angle in degrees to set rotation topublic void setRotationZ(float angle)
angle
- Angle in degrees to set rotation topublic void rotateX(float angle)
angle
- Angle in degrees to rotate bypublic void rotateY(float angle)
angle
- Angle in degrees to rotate bypublic void rotateZ(float angle)
angle
- Angle in degrees to rotate bypublic void setRotation(Vector3 dir, Vector3 up)
dir
- the direction vectorup
- the up vectorpublic Quaternion getRotation()
public void translateX(float units)
units
- Units to move the decalpublic void setX(float x)
x
- Position to locate the decal atpublic float getX()
public void translateY(float units)
units
- Units to move the decalpublic void setY(float y)
y
- Position to locate the decal atpublic float getY()
public void translateZ(float units)
units
- Units to move the decalpublic void setZ(float z)
z
- Position to locate the decal atpublic float getZ()
public void translate(float x, float y, float z)
x
- Units to move along the x axisy
- Units to move along the y axisz
- Units to move along the z axispublic void setPosition(float x, float y, float z)
x
- X positiony
- Y Positionz
- Z Positionpublic Vector3 getPosition()
public void setScaleX(float scale)
scale
- New scale along x axispublic float getScaleX()
public void setScaleY(float scale)
scale
- New scale along y axispublic float getScaleY()
public void setScale(float scaleX, float scaleY)
scaleX
- Scale on the x axisscaleY
- Scale on the y axispublic void setScale(float scale)
scale
- New scalepublic void setWidth(float width)
width
- Width in world unitspublic float getWidth()
public void setHeight(float height)
height
- Height in world unitspublic float getHeight()
public void setDimensions(float width, float height)
width
- Width in world unitsheight
- Height in world unitspublic float[] getVertices()
public void setTextureRegion(TextureRegion textureRegion)
textureRegion
- Texture region to applypublic TextureRegion getTextureRegion()
public void setBlending(int srcBlendFactor, int dstBlendFactor)
srcBlendFactor
- Source blend factor used by glBlendFuncdstBlendFactor
- Destination blend factor used by glBlendFuncpublic DecalMaterial getMaterial()
public void lookAt(Vector3 position, Vector3 up)
position
- up
- public static Decal newDecal(TextureRegion textureRegion)
textureRegion
- Texture region to usepublic static Decal newDecal(TextureRegion textureRegion, boolean hasTransparency)
textureRegion
- Texture region to usehasTransparency
- Whether or not this sprite will be treated as having transparency (transparent png, etc.)public static Decal newDecal(float width, float height, TextureRegion textureRegion)
width
- Width of the decal in world unitsheight
- Height of the decal in world unitstextureRegion
- TextureRegion to usepublic static Decal newDecal(float width, float height, TextureRegion textureRegion, boolean hasTransparency)
width
- Width of the decal in world unitsheight
- Height of the decal in world unitstextureRegion
- TextureRegion to usehasTransparency
- Whether or not this sprite will be treated as having transparency (transparent png, etc.)public static Decal newDecal(float width, float height, TextureRegion textureRegion, int srcBlendFactor, int dstBlendFactor)
width
- Width of the decal in world unitsheight
- Height of the decal in world unitstextureRegion
- TextureRegion to usesrcBlendFactor
- Source blend used by glBlendFuncdstBlendFactor
- Destination blend used by glBlendFuncCopyright © 2014. All Rights Reserved.