fix border behavior in reflection function
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
ab5c556c4c
commit
db388b9b1f
@ -69,16 +69,16 @@ void fluid_grid2_set_bounds_reflection(
|
||||
|
||||
//x-direction boundary planes
|
||||
if(vector_dir==BOUND_SET_VECTOR_DIFFUSE_PHI_U || vector_dir==BOUND_SET_VECTOR_U){
|
||||
// if(boundsArr[IX(0,x,y)] > 0){
|
||||
if(boundsArr[IX(0,x,y)] > 0){
|
||||
target[IX(0,x,y)] = -target[IX(1,x,y)];
|
||||
// } else {
|
||||
// target[IX(0,x,y)] = target[IX(1,x,y)];
|
||||
// }
|
||||
// if(boundsArr[IX(DIM-1,x,y)] > 0){
|
||||
} else {
|
||||
target[IX(0,x,y)] = 0;
|
||||
}
|
||||
if(boundsArr[IX(DIM-1,x,y)] > 0){
|
||||
target[IX(DIM-1,x,y)] = -target[IX(DIM-2,x,y)];
|
||||
// } else {
|
||||
// target[IX(DIM-1,x,y)] = target[IX(DIM-2,x,y)];
|
||||
// }
|
||||
} else {
|
||||
target[IX(DIM-1,x,y)] = 0;
|
||||
}
|
||||
} else {
|
||||
target[IX(0,x,y)] = target[IX(1,x,y)];
|
||||
target[IX(DIM-1,x,y)] = target[IX(DIM-2,x,y)];
|
||||
@ -86,16 +86,16 @@ void fluid_grid2_set_bounds_reflection(
|
||||
|
||||
//y-direction boundary planes
|
||||
if(vector_dir==BOUND_SET_VECTOR_DIFFUSE_PHI_V || vector_dir==BOUND_SET_VECTOR_V){
|
||||
// if(boundsArr[IX(x,0,y)] > 0){
|
||||
if(boundsArr[IX(x,0,y)] > 0){
|
||||
target[IX(x,0,y)] = -target[IX(x,1,y)];
|
||||
// } else {
|
||||
// target[IX(x,0,y)] = target[IX(x,1,y)];
|
||||
// }
|
||||
// if(boundsArr[IX(x,DIM-1,y)] > 0){
|
||||
} else {
|
||||
target[IX(x,0,y)] = 0;
|
||||
}
|
||||
if(boundsArr[IX(x,DIM-1,y)] > 0){
|
||||
target[IX(x,DIM-1,y)] = -target[IX(x,DIM-2,y)];
|
||||
// } else {
|
||||
// target[IX(x,DIM-1,y)] = target[IX(x,DIM-2,y)];
|
||||
// }
|
||||
} else {
|
||||
target[IX(x,DIM-1,y)] = 0;
|
||||
}
|
||||
} else {
|
||||
target[IX(x,0,y)] = target[IX(x,1,y)];
|
||||
target[IX(x,DIM-1,y)] = target[IX(x,DIM-2,y)];
|
||||
@ -103,16 +103,16 @@ void fluid_grid2_set_bounds_reflection(
|
||||
|
||||
//z-direction boundary planes
|
||||
if(vector_dir==BOUND_SET_VECTOR_DIFFUSE_PHI_W || vector_dir==BOUND_SET_VECTOR_W){
|
||||
// if(boundsArr[IX(x,y,0)] > 0){
|
||||
if(boundsArr[IX(x,y,0)] > 0){
|
||||
target[IX(x,y,0)] = -target[IX(x,y,1)];
|
||||
// } else {
|
||||
// target[IX(x,y,0)] = target[IX(x,y,1)];
|
||||
// }
|
||||
// if(boundsArr[IX(x,y,DIM-1)] > 0){
|
||||
} else {
|
||||
target[IX(x,y,0)] = 0;
|
||||
}
|
||||
if(boundsArr[IX(x,y,DIM-1)] > 0){
|
||||
target[IX(x,y,DIM-1)] = -target[IX(x,y,DIM-2)];
|
||||
// } else {
|
||||
// target[IX(x,y,DIM-1)] = -target[IX(x,y,DIM-2)];
|
||||
// }
|
||||
} else {
|
||||
target[IX(x,y,DIM-1)] = 0;
|
||||
}
|
||||
} else {
|
||||
target[IX(x,y,0)] = target[IX(x,y,1)];
|
||||
target[IX(x,y,DIM-1)] = target[IX(x,y,DIM-2)];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user