am a3c745da: Merge change 24057 into eclair
Merge commit 'a3c745dafa2679b73a6d499324b6ffaac819fdc9' into eclair-plus-aosp * commit 'a3c745dafa2679b73a6d499324b6ffaac819fdc9': checkpoint
This commit is contained in:
@@ -210,26 +210,27 @@ void generateRipples() {
|
|||||||
int x = 0;
|
int x = 0;
|
||||||
int yOffset = y * width;
|
int yOffset = y * width;
|
||||||
for ( ; x < width; x += 1) {
|
for ( ; x < width; x += 1) {
|
||||||
int o = ((yOffset + x) << 3);
|
struct vert_s *v = (struct vec3_s *)(vertices + x);
|
||||||
int o1 = o + 8 + 5;
|
//int o = ((yOffset + x) << 3);
|
||||||
int ow = o + w8 + 5;
|
//int o1 = o + 8 + 5;
|
||||||
int ow1 = ow + 8;
|
//int ow = o + w8 + 5;
|
||||||
|
//int ow1 = ow + 8;
|
||||||
|
|
||||||
struct vec3_s n1, n2, n3;
|
struct vec3_s n1, n2, n3;
|
||||||
vec3Sub(&n1, (struct vec3_s *)(vertices + o1 + 5), (struct vec3_s *)(vertices + o + 5));
|
vec3Sub(&n1, (struct vec3_s *)&(v+1)->x, (struct vec3_s *)&v->x);
|
||||||
vec3Sub(&n2, (struct vec3_s *)(vertices + ow + 5), (struct vec3_s *)(vertices + o + 5));
|
vec3Sub(&n2, (struct vec3_s *)&(v+width)->x, (struct vec3_s *)&v->x);
|
||||||
vec3Cross(&n3, &n1, &n2);
|
vec3Cross(&n3, &n1, &n2);
|
||||||
vec3Norm(&n3);
|
vec3Norm(&n3);
|
||||||
|
|
||||||
// Average of previous normal and N1 x N2
|
// Average of previous normal and N1 x N2
|
||||||
vec3Sub(&n1, (struct vec3_s *)(vertices + ow1 + 5), (struct vec3_s *)(vertices + o + 5));
|
vec3Sub(&n1, (struct vec3_s *)&(v+width+1)->x, (struct vec3_s *)&v->x);
|
||||||
vec3Cross(&n2, &n1, &n2);
|
vec3Cross(&n2, &n1, &n2);
|
||||||
vec3Add(&n3, &n3, &n2);
|
vec3Add(&n3, &n3, &n2);
|
||||||
vec3Norm(&n3);
|
vec3Norm(&n3);
|
||||||
|
|
||||||
vertices[o + 0] = n3.x;
|
v->nx = n3.x;
|
||||||
vertices[o + 1] = n3.y;
|
v->ny = n3.y;
|
||||||
vertices[o + 2] = -n3.z;
|
v->nz = -n3.z;
|
||||||
|
|
||||||
// reset Z
|
// reset Z
|
||||||
//vertices[(yOffset + x) << 3 + 7] = 0.0f;
|
//vertices[(yOffset + x) << 3 + 7] = 0.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user