FileDocCategorySizeDatePackage
Float4.javaAPI DocAndroid 5.1 API8598Thu Mar 12 22:22:42 GMT 2015android.renderscript

Float4

public class Float4 extends Object
Vector version of the basic float type. Provides four float fields packed.

Fields Summary
public float
x
public float
y
public float
z
public float
w
Constructors Summary
public Float4()

    
public Float4(Float4 data)

hide

        this.x = data.x;
        this.y = data.y;
        this.z = data.z;
        this.w = data.w;
    
public Float4(float x, float y, float z, float w)

        this.x = x;
        this.y = y;
        this.z = z;
        this.w = w;
    
Methods Summary
public static android.renderscript.Float4add(android.renderscript.Float4 a, android.renderscript.Float4 b)

hide
Vector add
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x + b.x;
        res.y = a.y + b.y;
        res.z = a.z + b.z;
        res.w = a.w + b.w;

        return res;
    
public voidadd(android.renderscript.Float4 value)

hide
Vector add
param
value

        x += value.x;
        y += value.y;
        z += value.z;
        w += value.w;
    
public voidadd(float value)

hide
Vector add
param
value

        x += value;
        y += value;
        z += value;
        w += value;
    
public static android.renderscript.Float4add(android.renderscript.Float4 a, float b)

hide
Vector add
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x + b;
        res.y = a.y + b;
        res.z = a.z + b;
        res.w = a.w + b;

        return res;
    
public voidaddAt(int i, float value)

hide
add the vector field value by index
param
i
param
value

        switch (i) {
        case 0:
            x += value;
            return;
        case 1:
            y += value;
            return;
        case 2:
            z += value;
            return;
        case 3:
            w += value;
            return;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public voidaddMultiple(android.renderscript.Float4 a, float factor)

hide
Vector add Multiple
param
a
param
factor

        x += a.x * factor;
        y += a.y * factor;
        z += a.z * factor;
        w += a.w * factor;
    
public voidcopyTo(float[] data, int offset)

hide
copy the vector to float array
param
data
param
offset

        data[offset] = x;
        data[offset + 1] = y;
        data[offset + 2] = z;
        data[offset + 3] = w;
    
public voiddiv(android.renderscript.Float4 value)

hide
Vector division
param
value

        x /= value.x;
        y /= value.y;
        z /= value.z;
        w /= value.w;
    
public voiddiv(float value)

hide
Vector division
param
value

        x /= value;
        y /= value;
        z /= value;
        w /= value;
    
public static android.renderscript.Float4div(android.renderscript.Float4 a, float b)

hide
Vector division
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x / b;
        res.y = a.y / b;
        res.z = a.z / b;
        res.w = a.w / b;

        return res;
    
public static android.renderscript.Float4div(android.renderscript.Float4 a, android.renderscript.Float4 b)

hide
Vector division
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x / b.x;
        res.y = a.y / b.y;
        res.z = a.z / b.z;
        res.w = a.w / b.w;

        return res;
    
public floatdotProduct(android.renderscript.Float4 a)

hide
Vector dot Product
param
a
return

        return (x * a.x) + (y * a.y) + (z * a.z) + (w * a.w);
    
public static floatdotProduct(android.renderscript.Float4 a, android.renderscript.Float4 b)

hide
Vector dot Product
param
a
param
b
return

        return (b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w);
    
public floatelementSum()

hide
return the element sum of vector
return

        return x + y + z + w;
    
public floatget(int i)

hide
get the vector field value by index
param
i
return

        switch (i) {
        case 0:
            return x;
        case 1:
            return y;
        case 2:
            return z;
        case 3:
            return w;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public intlength()

hide
get vector length
return

        return 4;
    
public voidmul(android.renderscript.Float4 value)

hide
Vector multiplication
param
value

        x *= value.x;
        y *= value.y;
        z *= value.z;
        w *= value.w;
    
public voidmul(float value)

hide
Vector multiplication
param
value

        x *= value;
        y *= value;
        z *= value;
        w *= value;
    
public static android.renderscript.Float4mul(android.renderscript.Float4 a, android.renderscript.Float4 b)

hide
Vector multiplication
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x * b.x;
        res.y = a.y * b.y;
        res.z = a.z * b.z;
        res.w = a.w * b.w;

        return res;
    
public static android.renderscript.Float4mul(android.renderscript.Float4 a, float b)

hide
Vector multiplication
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x * b;
        res.y = a.y * b;
        res.z = a.z * b;
        res.w = a.w * b;

        return res;
    
public voidnegate()

hide
set vector negate

        x = -x;
        y = -y;
        z = -z;
        w = -w;
    
public voidset(android.renderscript.Float4 a)

hide
set vector value by float4
param
a

        this.x = a.x;
        this.y = a.y;
        this.z = a.z;
        this.w = a.w;
    
public voidsetAt(int i, float value)

hide
set the vector field value by index
param
i
param
value

        switch (i) {
        case 0:
            x = value;
            return;
        case 1:
            y = value;
            return;
        case 2:
            z = value;
            return;
        case 3:
            w = value;
            return;
        default:
            throw new IndexOutOfBoundsException("Index: i");
        }
    
public voidsetValues(float x, float y, float z, float w)

hide
set the vector field value
param
x
param
y
param
z
param
w

        this.x = x;
        this.y = y;
        this.z = z;
        this.w = w;
    
public static android.renderscript.Float4sub(android.renderscript.Float4 a, float b)

hide
Vector subtraction
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x - b;
        res.y = a.y - b;
        res.z = a.z - b;
        res.w = a.w - b;

        return res;
    
public static android.renderscript.Float4sub(android.renderscript.Float4 a, android.renderscript.Float4 b)

hide
Vector subtraction
param
a
param
b
return

        Float4 res = new Float4();
        res.x = a.x - b.x;
        res.y = a.y - b.y;
        res.z = a.z - b.z;
        res.w = a.w - b.w;

        return res;
    
public voidsub(android.renderscript.Float4 value)

hide
Vector subtraction
param
value

        x -= value.x;
        y -= value.y;
        z -= value.z;
        w -= value.w;
    
public voidsub(float value)

hide
Vector subtraction
param
value

        x -= value;
        y -= value;
        z -= value;
        w -= value;