Revision e979d285
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/library/effect/MatrixEffectQuaternion.java | ||
---|---|---|
44 | 44 |
*/ |
45 | 45 |
public boolean compute(float[] uniforms, int index, long currentDuration, long step ) |
46 | 46 |
{ |
47 |
mCenter.get(uniforms,index+4,currentDuration,step);
|
|
47 |
mCenter.get(uniforms,index+CENTER_OFFSET,currentDuration,step);
|
|
48 | 48 |
return mQuaternion.get(uniforms,index,currentDuration,step); |
49 | 49 |
} |
50 | 50 |
|
... | ... | |
61 | 61 |
float qZ = uniforms[NUM_UNIFORMS*index+2]; |
62 | 62 |
float qW = uniforms[NUM_UNIFORMS*index+3]; |
63 | 63 |
|
64 |
float x = uniforms[NUM_UNIFORMS*index+4];
|
|
65 |
float y = uniforms[NUM_UNIFORMS*index+5];
|
|
66 |
float z = uniforms[NUM_UNIFORMS*index+6];
|
|
64 |
float x = uniforms[NUM_UNIFORMS*index+CENTER_OFFSET ];
|
|
65 |
float y = uniforms[NUM_UNIFORMS*index+CENTER_OFFSET+1];
|
|
66 |
float z = uniforms[NUM_UNIFORMS*index+CENTER_OFFSET+2];
|
|
67 | 67 |
|
68 | 68 |
Matrix.translateM(matrix, 0, x, y, z); |
69 | 69 |
multiplyByQuat( matrix, qX, qY, qZ, qW); |
Also available in: Unified diff
Add the first two VERTEX 'pseudo-matrix' effects: VERTEX_MOVE & VERTEX_QUATERNION i.e. implementations of those two MATRIX effects in VERTEX queue.
The point(s):
1) preparation for the upcoming MeshBase.preApply(VertexEffect effect) API that's going to supersede the current much more limited MeshBase.apply(MatrixEffect effect)
2) those can be put in any position in the VERTEX queue, whereas the Matrix effects always have to come last