Search in sources :

Example 1 with FloatChannel

use of com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel in project libgdx by libgdx.

the class ParticleController method calculateBoundingBox.

/** Updates the bounding box using the position channel. */
protected void calculateBoundingBox() {
    boundingBox.clr();
    FloatChannel positionChannel = particles.getChannel(ParticleChannels.Position);
    for (int pos = 0, c = positionChannel.strideSize * particles.size; pos < c; pos += positionChannel.strideSize) {
        boundingBox.ext(positionChannel.data[pos + ParticleChannels.XOffset], positionChannel.data[pos + ParticleChannels.YOffset], positionChannel.data[pos + ParticleChannels.ZOffset]);
    }
}
Also used : FloatChannel(com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel)

Example 2 with FloatChannel

use of com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel in project libgdx by libgdx.

the class BillboardParticleBatch method fillVerticesToScreenCPU.

private void fillVerticesToScreenCPU(int[] particlesOffset) {
    Vector3 // normal
    look = TMP_V3.set(camera.direction).scl(-1), // tangent
    right = TMP_V4.set(camera.up).crs(look).nor(), up = camera.up;
    int tp = 0;
    for (BillboardControllerRenderData data : renderData) {
        FloatChannel scaleChannel = data.scaleChannel;
        FloatChannel regionChannel = data.regionChannel;
        FloatChannel positionChannel = data.positionChannel;
        FloatChannel colorChannel = data.colorChannel;
        FloatChannel rotationChannel = data.rotationChannel;
        for (int p = 0, c = data.controller.particles.size; p < c; ++p, ++tp) {
            int baseOffset = particlesOffset[tp] * currentVertexSize * 4;
            float scale = scaleChannel.data[p * scaleChannel.strideSize];
            int regionOffset = p * regionChannel.strideSize;
            int positionOffset = p * positionChannel.strideSize;
            int colorOffset = p * colorChannel.strideSize;
            int rotationOffset = p * rotationChannel.strideSize;
            float px = positionChannel.data[positionOffset + ParticleChannels.XOffset], py = positionChannel.data[positionOffset + ParticleChannels.YOffset], pz = positionChannel.data[positionOffset + ParticleChannels.ZOffset];
            float u = regionChannel.data[regionOffset + ParticleChannels.UOffset];
            float v = regionChannel.data[regionOffset + ParticleChannels.VOffset];
            float u2 = regionChannel.data[regionOffset + ParticleChannels.U2Offset];
            float v2 = regionChannel.data[regionOffset + ParticleChannels.V2Offset];
            float sx = regionChannel.data[regionOffset + ParticleChannels.HalfWidthOffset] * scale, sy = regionChannel.data[regionOffset + ParticleChannels.HalfHeightOffset] * scale;
            float r = colorChannel.data[colorOffset + ParticleChannels.RedOffset];
            float g = colorChannel.data[colorOffset + ParticleChannels.GreenOffset];
            float b = colorChannel.data[colorOffset + ParticleChannels.BlueOffset];
            float a = colorChannel.data[colorOffset + ParticleChannels.AlphaOffset];
            float cosRotation = rotationChannel.data[rotationOffset + ParticleChannels.CosineOffset];
            float sinRotation = rotationChannel.data[rotationOffset + ParticleChannels.SineOffset];
            TMP_V1.set(right).scl(sx);
            TMP_V2.set(up).scl(sy);
            if (cosRotation != 1) {
                TMP_M3.setToRotation(look, cosRotation, sinRotation);
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x - TMP_V2.x, -TMP_V1.y - TMP_V2.y, -TMP_V1.z - TMP_V2.z).mul(TMP_M3).add(px, py, pz), u, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x - TMP_V2.x, TMP_V1.y - TMP_V2.y, TMP_V1.z - TMP_V2.z).mul(TMP_M3).add(px, py, pz), u2, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x + TMP_V2.x, TMP_V1.y + TMP_V2.y, TMP_V1.z + TMP_V2.z).mul(TMP_M3).add(px, py, pz), u2, v, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x + TMP_V2.x, -TMP_V1.y + TMP_V2.y, -TMP_V1.z + TMP_V2.z).mul(TMP_M3).add(px, py, pz), u, v, r, g, b, a);
            } else {
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x - TMP_V2.x + px, -TMP_V1.y - TMP_V2.y + py, -TMP_V1.z - TMP_V2.z + pz), u, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x - TMP_V2.x + px, TMP_V1.y - TMP_V2.y + py, TMP_V1.z - TMP_V2.z + pz), u2, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x + TMP_V2.x + px, TMP_V1.y + TMP_V2.y + py, TMP_V1.z + TMP_V2.z + pz), u2, v, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x + TMP_V2.x + px, -TMP_V1.y + TMP_V2.y + py, -TMP_V1.z + TMP_V2.z + pz), u, v, r, g, b, a);
            }
        }
    }
}
Also used : FloatChannel(com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel) Vector3(com.badlogic.gdx.math.Vector3) BillboardControllerRenderData(com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardControllerRenderData)

Example 3 with FloatChannel

use of com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel in project libgdx by libgdx.

the class BillboardParticleBatch method fillVerticesGPU.

private void fillVerticesGPU(int[] particlesOffset) {
    int tp = 0;
    for (BillboardControllerRenderData data : renderData) {
        FloatChannel scaleChannel = data.scaleChannel;
        FloatChannel regionChannel = data.regionChannel;
        FloatChannel positionChannel = data.positionChannel;
        FloatChannel colorChannel = data.colorChannel;
        FloatChannel rotationChannel = data.rotationChannel;
        for (int p = 0, c = data.controller.particles.size; p < c; ++p, ++tp) {
            int baseOffset = particlesOffset[tp] * currentVertexSize * 4;
            float scale = scaleChannel.data[p * scaleChannel.strideSize];
            int regionOffset = p * regionChannel.strideSize;
            int positionOffset = p * positionChannel.strideSize;
            int colorOffset = p * colorChannel.strideSize;
            int rotationOffset = p * rotationChannel.strideSize;
            float px = positionChannel.data[positionOffset + ParticleChannels.XOffset], py = positionChannel.data[positionOffset + ParticleChannels.YOffset], pz = positionChannel.data[positionOffset + ParticleChannels.ZOffset];
            float u = regionChannel.data[regionOffset + ParticleChannels.UOffset];
            float v = regionChannel.data[regionOffset + ParticleChannels.VOffset];
            float u2 = regionChannel.data[regionOffset + ParticleChannels.U2Offset];
            float v2 = regionChannel.data[regionOffset + ParticleChannels.V2Offset];
            float sx = regionChannel.data[regionOffset + ParticleChannels.HalfWidthOffset] * scale, sy = regionChannel.data[regionOffset + ParticleChannels.HalfHeightOffset] * scale;
            float r = colorChannel.data[colorOffset + ParticleChannels.RedOffset];
            float g = colorChannel.data[colorOffset + ParticleChannels.GreenOffset];
            float b = colorChannel.data[colorOffset + ParticleChannels.BlueOffset];
            float a = colorChannel.data[colorOffset + ParticleChannels.AlphaOffset];
            float cosRotation = rotationChannel.data[rotationOffset + ParticleChannels.CosineOffset];
            float sinRotation = rotationChannel.data[rotationOffset + ParticleChannels.SineOffset];
            // bottom left, bottom right, top right, top left
            putVertex(vertices, baseOffset, px, py, pz, u, v2, -sx, -sy, cosRotation, sinRotation, r, g, b, a);
            baseOffset += currentVertexSize;
            putVertex(vertices, baseOffset, px, py, pz, u2, v2, sx, -sy, cosRotation, sinRotation, r, g, b, a);
            baseOffset += currentVertexSize;
            putVertex(vertices, baseOffset, px, py, pz, u2, v, sx, sy, cosRotation, sinRotation, r, g, b, a);
            baseOffset += currentVertexSize;
            putVertex(vertices, baseOffset, px, py, pz, u, v, -sx, sy, cosRotation, sinRotation, r, g, b, a);
            baseOffset += currentVertexSize;
        }
    }
}
Also used : FloatChannel(com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel) BillboardControllerRenderData(com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardControllerRenderData)

Example 4 with FloatChannel

use of com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel in project libgdx by libgdx.

the class PointSpriteParticleBatch method flush.

@Override
protected void flush(int[] offsets) {
    int tp = 0;
    for (PointSpriteControllerRenderData data : renderData) {
        FloatChannel scaleChannel = data.scaleChannel;
        FloatChannel regionChannel = data.regionChannel;
        FloatChannel positionChannel = data.positionChannel;
        FloatChannel colorChannel = data.colorChannel;
        FloatChannel rotationChannel = data.rotationChannel;
        for (int p = 0; p < data.controller.particles.size; ++p, ++tp) {
            int offset = offsets[tp] * CPU_VERTEX_SIZE;
            int regionOffset = p * regionChannel.strideSize;
            int positionOffset = p * positionChannel.strideSize;
            int colorOffset = p * colorChannel.strideSize;
            int rotationOffset = p * rotationChannel.strideSize;
            vertices[offset + CPU_POSITION_OFFSET] = positionChannel.data[positionOffset + ParticleChannels.XOffset];
            vertices[offset + CPU_POSITION_OFFSET + 1] = positionChannel.data[positionOffset + ParticleChannels.YOffset];
            vertices[offset + CPU_POSITION_OFFSET + 2] = positionChannel.data[positionOffset + ParticleChannels.ZOffset];
            vertices[offset + CPU_COLOR_OFFSET] = colorChannel.data[colorOffset + ParticleChannels.RedOffset];
            vertices[offset + CPU_COLOR_OFFSET + 1] = colorChannel.data[colorOffset + ParticleChannels.GreenOffset];
            vertices[offset + CPU_COLOR_OFFSET + 2] = colorChannel.data[colorOffset + ParticleChannels.BlueOffset];
            vertices[offset + CPU_COLOR_OFFSET + 3] = colorChannel.data[colorOffset + ParticleChannels.AlphaOffset];
            vertices[offset + CPU_SIZE_AND_ROTATION_OFFSET] = scaleChannel.data[p * scaleChannel.strideSize];
            vertices[offset + CPU_SIZE_AND_ROTATION_OFFSET + 1] = rotationChannel.data[rotationOffset + ParticleChannels.CosineOffset];
            vertices[offset + CPU_SIZE_AND_ROTATION_OFFSET + 2] = rotationChannel.data[rotationOffset + ParticleChannels.SineOffset];
            vertices[offset + CPU_REGION_OFFSET] = regionChannel.data[regionOffset + ParticleChannels.UOffset];
            vertices[offset + CPU_REGION_OFFSET + 1] = regionChannel.data[regionOffset + ParticleChannels.VOffset];
            vertices[offset + CPU_REGION_OFFSET + 2] = regionChannel.data[regionOffset + ParticleChannels.U2Offset];
            vertices[offset + CPU_REGION_OFFSET + 3] = regionChannel.data[regionOffset + ParticleChannels.V2Offset];
        }
    }
    renderable.meshPart.size = bufferedParticlesCount;
    renderable.meshPart.mesh.setVertices(vertices, 0, bufferedParticlesCount * CPU_VERTEX_SIZE);
    renderable.meshPart.update();
}
Also used : FloatChannel(com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel) PointSpriteControllerRenderData(com.badlogic.gdx.graphics.g3d.particles.renderers.PointSpriteControllerRenderData)

Example 5 with FloatChannel

use of com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel in project libgdx by libgdx.

the class BillboardParticleBatch method fillVerticesToViewPointCPU.

/*
	 * private void fillVerticesToParticleDirectionGPU (int[] particlesOffset) { int tp=0; for(BillboardControllerRenderData data :
	 * renderData){ FloatChannel scaleChannel = data.scaleChannel; FloatChannel regionChannel = data.regionChannel; FloatChannel
	 * positionChannel = data.positionChannel; FloatChannel colorChannel = data.colorChannel; FloatChannel rotationChannel =
	 * data.rotationChannel;
	 * 
	 * for(int p=0, c = data.controller.particles.size; p < c; ++p, ++tp){ int baseOffset =
	 * particlesOffset[tp]*currentVertexSize*4; float scale = scaleChannel.data[p* scaleChannel.strideSize]; int regionOffset =
	 * p*regionChannel.strideSize; int positionOffset = p*positionChannel.strideSize; int colorOffset = p*colorChannel.strideSize;
	 * int rotationOffset = p*rotationChannel.strideSize; int velocityOffset = p* velocityChannel.strideSize; float px =
	 * positionChannel.data[positionOffset + ParticleChannels.XOffset], py = positionChannel.data[positionOffset +
	 * ParticleChannels.YOffset], pz = positionChannel.data[positionOffset + ParticleChannels.ZOffset]; float u =
	 * regionChannel.data[regionOffset +ParticleChannels.UOffset]; float v = regionChannel.data[regionOffset
	 * +ParticleChannels.VOffset]; float u2 = regionChannel.data[regionOffset +ParticleChannels.U2Offset]; float v2 =
	 * regionChannel.data[regionOffset +ParticleChannels.V2Offset]; float sx = regionChannel.data[regionOffset
	 * +ParticleChannels.HalfWidthOffset] * scale, sy = regionChannel.data[regionOffset+ParticleChannels.HalfHeightOffset] * scale;
	 * float r = colorChannel.data[colorOffset +ParticleChannels.RedOffset]; float g = colorChannel.data[colorOffset
	 * +ParticleChannels.GreenOffset]; float b = colorChannel.data[colorOffset +ParticleChannels.BlueOffset]; float a =
	 * colorChannel.data[colorOffset +ParticleChannels.AlphaOffset]; float cosRotation = rotationChannel.data[rotationOffset
	 * +ParticleChannels.CosineOffset]; float sinRotation = rotationChannel.data[rotationOffset +ParticleChannels.SineOffset];
	 * float vx = velocityChannel.data[velocityOffset + ParticleChannels.XOffset], vy = velocityChannel.data[velocityOffset +
	 * ParticleChannels.YOffset], vz = velocityChannel.data[velocityOffset + ParticleChannels.ZOffset];
	 * 
	 * //bottom left, bottom right, top right, top left TMP_V1.set(vx, vy, vz).nor(); putVertex(vertices, baseOffset, px, py, pz,
	 * u, v2, -sx, -sy, cosRotation, sinRotation, r, g, b, a, TMP_V1); baseOffset += currentVertexSize; putVertex(vertices,
	 * baseOffset, px, py, pz, u2, v2, sx, -sy, cosRotation, sinRotation, r, g, b, a, TMP_V1); baseOffset += currentVertexSize;
	 * putVertex(vertices, baseOffset, px, py, pz, u2, v, sx, sy, cosRotation, sinRotation, r, g, b, a, TMP_V1); baseOffset +=
	 * currentVertexSize; putVertex(vertices, baseOffset, px, py, pz, u, v, -sx, sy, cosRotation, sinRotation, r, g, b, a, TMP_V1);
	 * } } }
	 * 
	 * private void fillVerticesToParticleDirectionCPU (int[] particlesOffset) { int tp=0; for(ParticleController controller :
	 * renderData){ FloatChannel scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); FloatChannel regionChannel
	 * = controller.particles.getChannel(ParticleChannels.TextureRegion); FloatChannel positionChannel =
	 * controller.particles.getChannel(ParticleChannels.Position); FloatChannel colorChannel =
	 * controller.particles.getChannel(ParticleChannels.Color); FloatChannel rotationChannel =
	 * controller.particles.getChannel(ParticleChannels.Rotation2D); FloatChannel velocityChannel =
	 * controller.particles.getChannel(ParticleChannels.Accelleration);
	 * 
	 * for(int p=0, c = controller.particles.size; p < c; ++p, ++tp){ int baseOffset = particlesOffset[tp]*currentVertexSize*4;
	 * float scale = scaleChannel.data[p* scaleChannel.strideSize]; int regionOffset = p*regionChannel.strideSize; int
	 * positionOffset = p*positionChannel.strideSize; int colorOffset = p*colorChannel.strideSize; int rotationOffset =
	 * p*rotationChannel.strideSize; int velocityOffset = p* velocityChannel.strideSize; float px =
	 * positionChannel.data[positionOffset + ParticleChannels.XOffset], py = positionChannel.data[positionOffset +
	 * ParticleChannels.YOffset], pz = positionChannel.data[positionOffset + ParticleChannels.ZOffset]; float u =
	 * regionChannel.data[regionOffset +ParticleChannels.UOffset]; float v = regionChannel.data[regionOffset
	 * +ParticleChannels.VOffset]; float u2 = regionChannel.data[regionOffset +ParticleChannels.U2Offset]; float v2 =
	 * regionChannel.data[regionOffset +ParticleChannels.V2Offset]; float sx = regionChannel.data[regionOffset
	 * +ParticleChannels.HalfWidthOffset] * scale, sy = regionChannel.data[regionOffset+ParticleChannels.HalfHeightOffset] * scale;
	 * float r = colorChannel.data[colorOffset +ParticleChannels.RedOffset]; float g = colorChannel.data[colorOffset
	 * +ParticleChannels.GreenOffset]; float b = colorChannel.data[colorOffset +ParticleChannels.BlueOffset]; float a =
	 * colorChannel.data[colorOffset +ParticleChannels.AlphaOffset]; float cosRotation = rotationChannel.data[rotationOffset
	 * +ParticleChannels.CosineOffset]; float sinRotation = rotationChannel.data[rotationOffset +ParticleChannels.SineOffset];
	 * float vx = velocityChannel.data[velocityOffset + ParticleChannels.XOffset], vy = velocityChannel.data[velocityOffset +
	 * ParticleChannels.YOffset], vz = velocityChannel.data[velocityOffset + ParticleChannels.ZOffset]; Vector3 up =
	 * TMP_V1.set(vx,vy,vz).nor(), look = TMP_V3.set(camera.position).sub(px,py,pz).nor(), //normal right =
	 * TMP_V2.set(up).crs(look).nor(); //tangent look.set(right).crs(up).nor(); right.scl(sx); up.scl(sy);
	 * 
	 * if(cosRotation != 1){ TMP_M3.setToRotation(look, cosRotation, sinRotation); putVertex(vertices, baseOffset,
	 * TMP_V6.set(-TMP_V1.x-TMP_V2.x, -TMP_V1.y-TMP_V2.y, -TMP_V1.z-TMP_V2.z).mul(TMP_M3).add(px, py, pz), u, v2, r, g, b, a);
	 * baseOffset += currentVertexSize; putVertex(vertices, baseOffset,TMP_V6.set(TMP_V1.x-TMP_V2.x, TMP_V1.y-TMP_V2.y,
	 * TMP_V1.z-TMP_V2.z).mul(TMP_M3).add(px, py, pz), u2, v2, r, g, b, a); baseOffset += currentVertexSize; putVertex(vertices,
	 * baseOffset,TMP_V6.set(TMP_V1.x+TMP_V2.x, TMP_V1.y+TMP_V2.y, TMP_V1.z+TMP_V2.z).mul(TMP_M3).add(px, py, pz), u2, v, r, g, b,
	 * a); baseOffset += currentVertexSize; putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x+TMP_V2.x, -TMP_V1.y+TMP_V2.y,
	 * -TMP_V1.z+TMP_V2.z).mul(TMP_M3).add(px, py, pz), u, v, r, g, b, a); } else { putVertex(vertices,
	 * baseOffset,TMP_V6.set(-TMP_V1.x-TMP_V2.x+px, -TMP_V1.y-TMP_V2.y+py, -TMP_V1.z-TMP_V2.z+pz), u, v2, r, g, b, a); baseOffset
	 * += currentVertexSize; putVertex(vertices, baseOffset,TMP_V6.set(TMP_V1.x-TMP_V2.x+px, TMP_V1.y-TMP_V2.y+py,
	 * TMP_V1.z-TMP_V2.z+pz), u2, v2, r, g, b, a); baseOffset += currentVertexSize; putVertex(vertices,
	 * baseOffset,TMP_V6.set(TMP_V1.x+TMP_V2.x+px, TMP_V1.y+TMP_V2.y+py, TMP_V1.z+TMP_V2.z+pz), u2, v, r, g, b, a); baseOffset +=
	 * currentVertexSize; putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x+TMP_V2.x+px, -TMP_V1.y+TMP_V2.y+py,
	 * -TMP_V1.z+TMP_V2.z+pz), u, v, r, g, b, a); } } } }
	 */
private void fillVerticesToViewPointCPU(int[] particlesOffset) {
    int tp = 0;
    for (BillboardControllerRenderData data : renderData) {
        FloatChannel scaleChannel = data.scaleChannel;
        FloatChannel regionChannel = data.regionChannel;
        FloatChannel positionChannel = data.positionChannel;
        FloatChannel colorChannel = data.colorChannel;
        FloatChannel rotationChannel = data.rotationChannel;
        for (int p = 0, c = data.controller.particles.size; p < c; ++p, ++tp) {
            int baseOffset = particlesOffset[tp] * currentVertexSize * 4;
            float scale = scaleChannel.data[p * scaleChannel.strideSize];
            int regionOffset = p * regionChannel.strideSize;
            int positionOffset = p * positionChannel.strideSize;
            int colorOffset = p * colorChannel.strideSize;
            int rotationOffset = p * rotationChannel.strideSize;
            float px = positionChannel.data[positionOffset + ParticleChannels.XOffset], py = positionChannel.data[positionOffset + ParticleChannels.YOffset], pz = positionChannel.data[positionOffset + ParticleChannels.ZOffset];
            float u = regionChannel.data[regionOffset + ParticleChannels.UOffset];
            float v = regionChannel.data[regionOffset + ParticleChannels.VOffset];
            float u2 = regionChannel.data[regionOffset + ParticleChannels.U2Offset];
            float v2 = regionChannel.data[regionOffset + ParticleChannels.V2Offset];
            float sx = regionChannel.data[regionOffset + ParticleChannels.HalfWidthOffset] * scale, sy = regionChannel.data[regionOffset + ParticleChannels.HalfHeightOffset] * scale;
            float r = colorChannel.data[colorOffset + ParticleChannels.RedOffset];
            float g = colorChannel.data[colorOffset + ParticleChannels.GreenOffset];
            float b = colorChannel.data[colorOffset + ParticleChannels.BlueOffset];
            float a = colorChannel.data[colorOffset + ParticleChannels.AlphaOffset];
            float cosRotation = rotationChannel.data[rotationOffset + ParticleChannels.CosineOffset];
            float sinRotation = rotationChannel.data[rotationOffset + ParticleChannels.SineOffset];
            Vector3 // normal
            look = TMP_V3.set(camera.position).sub(px, py, pz).nor(), // tangent
            right = TMP_V1.set(camera.up).crs(look).nor(), up = TMP_V2.set(look).crs(right);
            right.scl(sx);
            up.scl(sy);
            if (cosRotation != 1) {
                TMP_M3.setToRotation(look, cosRotation, sinRotation);
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x - TMP_V2.x, -TMP_V1.y - TMP_V2.y, -TMP_V1.z - TMP_V2.z).mul(TMP_M3).add(px, py, pz), u, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x - TMP_V2.x, TMP_V1.y - TMP_V2.y, TMP_V1.z - TMP_V2.z).mul(TMP_M3).add(px, py, pz), u2, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x + TMP_V2.x, TMP_V1.y + TMP_V2.y, TMP_V1.z + TMP_V2.z).mul(TMP_M3).add(px, py, pz), u2, v, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x + TMP_V2.x, -TMP_V1.y + TMP_V2.y, -TMP_V1.z + TMP_V2.z).mul(TMP_M3).add(px, py, pz), u, v, r, g, b, a);
            } else {
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x - TMP_V2.x + px, -TMP_V1.y - TMP_V2.y + py, -TMP_V1.z - TMP_V2.z + pz), u, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x - TMP_V2.x + px, TMP_V1.y - TMP_V2.y + py, TMP_V1.z - TMP_V2.z + pz), u2, v2, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(TMP_V1.x + TMP_V2.x + px, TMP_V1.y + TMP_V2.y + py, TMP_V1.z + TMP_V2.z + pz), u2, v, r, g, b, a);
                baseOffset += currentVertexSize;
                putVertex(vertices, baseOffset, TMP_V6.set(-TMP_V1.x + TMP_V2.x + px, -TMP_V1.y + TMP_V2.y + py, -TMP_V1.z + TMP_V2.z + pz), u, v, r, g, b, a);
            }
        }
    }
}
Also used : FloatChannel(com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel) BillboardControllerRenderData(com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardControllerRenderData) Vector3(com.badlogic.gdx.math.Vector3)

Aggregations

FloatChannel (com.badlogic.gdx.graphics.g3d.particles.ParallelArray.FloatChannel)5 BillboardControllerRenderData (com.badlogic.gdx.graphics.g3d.particles.renderers.BillboardControllerRenderData)3 Vector3 (com.badlogic.gdx.math.Vector3)2 PointSpriteControllerRenderData (com.badlogic.gdx.graphics.g3d.particles.renderers.PointSpriteControllerRenderData)1