本文整理汇总了Java中com.badlogic.gdx.graphics.VertexAttributes.Usage.Generic方法的典型用法代码示例。如果您正苦于以下问题:Java Usage.Generic方法的具体用法?Java Usage.Generic怎么用?Java Usage.Generic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.VertexAttributes.Usage
的用法示例。
在下文中一共展示了Usage.Generic方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PositionalLight
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
public PositionalLight (RayHandler rayHandler, int rays, Color color, float distance, float x, float y, float directionDegree) {
super(rayHandler, rays, color, directionDegree, distance);
start.x = x;
start.y = y;
sin = new float[rays];
cos = new float[rays];
endX = new float[rays];
endY = new float[rays];
lightMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
"vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
softShadowMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum * 2, 0, new VertexAttribute(Usage.Position, 2,
"vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
setMesh();
}
示例2: DirectionalLight
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
/** Directional lights simulate light source that locations is at infinite distance. Direction and intensity is same everywhere.
* -90 direction is straight from up.
*
* @param rayHandler
* @param rays
* @param color
* @param directionDegree */
public DirectionalLight (RayHandler rayHandler, int rays, Color color, float directionDegree) {
super(rayHandler, rays, color, directionDegree, Float.POSITIVE_INFINITY);
vertexNum = (vertexNum - 1) * 2;
start = new Vector2[rayNum];
end = new Vector2[rayNum];
for (int i = 0; i < rayNum; i++) {
start[i] = new Vector2();
end[i] = new Vector2();
}
setDirection(direction);
lightMesh = new Mesh(VertexDataType.VertexArray, staticLight, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
"vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
softShadowMesh = new Mesh(VertexDataType.VertexArray, staticLight, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
"vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
update();
}
示例3: RavChainLight
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
/** Creates chain light from specified vertices
*
* @param rayHandler not {@code null} instance of RayHandler
* @param rays number of rays - more rays make light to look more realistic but will decrease performance, can't be less than
* MIN_RAYS
* @param color color, set to {@code null} to use the default color
* @param distance distance of light
* @param rayDirection direction of rays
* <ul>
* <li>1 = left</li>
* <li>-1 = right</li>
* </ul>
* @param chain float array of (x, y) vertices from which rays will be evenly distributed */
public RavChainLight (RayHandler rayHandler, int rays, Color color, float distance, int rayDirection, float[] chain) {
super(rayHandler, rays, color, distance, 0f);
rayStartOffset = ChainLight.defaultRayStartOffset;
this.rayDirection = rayDirection;
vertexNum = (vertexNum - 1) * 2;
endX = new float[rays];
endY = new float[rays];
startX = new float[rays];
startY = new float[rays];
this.chain = (chain != null) ? new FloatArray(chain) : new FloatArray();
lightMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum, 0,
new VertexAttribute(Usage.Position, 2, "vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
softShadowMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum * 2, 0,
new VertexAttribute(Usage.Position, 2, "vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
setMesh();
}
示例4: ChainLight
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
/**
* Creates chain light from specified vertices
*
* @param rayHandler
* not {@code null} instance of RayHandler
* @param rays
* number of rays - more rays make light to look more realistic
* but will decrease performance, can't be less than MIN_RAYS
* @param color
* color, set to {@code null} to use the default color
* @param distance
* distance of light
* @param rayDirection
* direction of rays
* <ul>
* <li>1 = left</li>
* <li>-1 = right</li>
* </ul>
* @param chain
* float array of (x, y) vertices from which rays will be
* evenly distributed
*/
public ChainLight(RayHandler rayHandler, int rays, Color color,
float distance, int rayDirection, float[] chain) {
super(rayHandler, rays, color, distance, 0f);
rayStartOffset = ChainLight.defaultRayStartOffset;
this.rayDirection = rayDirection;
vertexNum = (vertexNum - 1) * 2;
endX = new float[rays];
endY = new float[rays];
startX = new float[rays];
startY = new float[rays];
this.chain = (chain != null) ?
new FloatArray(chain) : new FloatArray();
lightMesh = new Mesh(
VertexDataType.VertexArray, false, vertexNum, 0,
new VertexAttribute(Usage.Position, 2, "vertex_positions"),
new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
softShadowMesh = new Mesh(
VertexDataType.VertexArray, false, vertexNum * 2,
0, new VertexAttribute(Usage.Position, 2, "vertex_positions"),
new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
setMesh();
}
示例5: DirectionalLight
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
/**
* Creates directional light which source is at infinite distance,
* direction and intensity is same everywhere
*
* <p>-90 direction is straight from up
*
* @param rayHandler
* not {@code null} instance of RayHandler
* @param rays
* number of rays - more rays make light to look more realistic
* but will decrease performance, can't be less than MIN_RAYS
* @param color
* color, set to {@code null} to use the default color
* @param directionDegree
* direction in degrees
*/
public DirectionalLight(RayHandler rayHandler, int rays, Color color,
float directionDegree) {
super(rayHandler, rays, color, Float.POSITIVE_INFINITY, directionDegree);
vertexNum = (vertexNum - 1) * 2;
start = new Vector2[rayNum];
end = new Vector2[rayNum];
for (int i = 0; i < rayNum; i++) {
start[i] = new Vector2();
end[i] = new Vector2();
}
lightMesh = new Mesh(
VertexDataType.VertexArray, staticLight, vertexNum, 0,
new VertexAttribute(Usage.Position, 2, "vertex_positions"),
new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
softShadowMesh = new Mesh(
VertexDataType.VertexArray, staticLight, vertexNum, 0,
new VertexAttribute(Usage.Position, 2, "vertex_positions"),
new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
update();
}
示例6: initVertices
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
@Override
protected void initVertices() {
/** STARS **/
meshes = new MeshData[1];
curr = new MeshData();
meshes[0] = curr;
aux1 = new Vector3();
maxVertices = 3000000;
VertexAttribute[] attribs = buildVertexAttributes();
curr.mesh = new Mesh(false, maxVertices, 0, attribs);
curr.vertices = new float[maxVertices * (curr.mesh.getVertexAttributes().vertexSize / 4)];
curr.vertexSize = curr.mesh.getVertexAttributes().vertexSize / 4;
curr.colorOffset = curr.mesh.getVertexAttribute(Usage.ColorPacked) != null ? curr.mesh.getVertexAttribute(Usage.ColorPacked).offset / 4 : 0;
pmOffset = curr.mesh.getVertexAttribute(Usage.Tangent) != null ? curr.mesh.getVertexAttribute(Usage.Tangent).offset / 4 : 0;
additionalOffset = curr.mesh.getVertexAttribute(Usage.Generic) != null ? curr.mesh.getVertexAttribute(Usage.Generic).offset / 4 : 0;
/** NEBULA **/
// Max of 5000 nebula clouds
int maxQuads = 5000;
int maxQuadVertices = maxQuads * 4;
int maxQuadIndices = maxQuads * 6;
quad = new MeshData();
quad.mesh = new Mesh(false, maxQuadVertices, maxQuadIndices, VertexAttribute.Position(), VertexAttribute.Normal(), VertexAttribute.TexCoords(0), new VertexAttribute(Usage.Generic, 2, "a_additional"));
quad.vertices = new float[maxQuadVertices * (quad.mesh.getVertexAttributes().vertexSize / 4)];
quad.vertexSize = quad.mesh.getVertexAttributes().vertexSize / 4;
quad.indices = new short[maxQuadIndices];
}
示例7: PositionalLight
import com.badlogic.gdx.graphics.VertexAttributes.Usage; //导入方法依赖的package包/类
/**
* Creates new positional light and automatically adds it to the specified
* {@link RayHandler} instance.
*
* @param rayHandler
* not null instance of RayHandler
* @param rays
* number of rays - more rays make light to look more realistic
* but will decrease performance, can't be less than MIN_RAYS
* @param color
* light color
* @param distance
* light distance (if applicable)
* @param x
* horizontal position in world coordinates
* @param y
* vertical position in world coordinates
* @param directionDegree
* direction in degrees (if applicable)
*/
public PositionalLight(RayHandler rayHandler, int rays, Color color, float distance, float x, float y, float directionDegree) {
super(rayHandler, rays, color, distance, directionDegree);
start.x = x;
start.y = y;
lightMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
"vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
softShadowMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum * 2, 0, new VertexAttribute(Usage.Position, 2,
"vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
new VertexAttribute(Usage.Generic, 1, "s"));
setMesh();
}