1
0
Fork 0

Fix bug about body width

This commit is contained in:
Delta Echo 2020-02-29 11:39:26 +01:00 committed by James Turner
parent f707840b10
commit 73d7e5e1c2

View file

@ -64,13 +64,14 @@ void rotationMatrixH(in float sinRz, in float cosRz, out mat4 rotmat)
vec2 calc_deflection(float y){ vec2 calc_deflection(float y){
float distance; float distance;
if(y < body_width && y > -body_width){ float bwh = body_width/2;
if(y < bwh && y > -bwh){
//this part does not move //this part does not move
distance = 0; distance = 0;
}else if(y > body_width){ }else if(y > bwh){
distance = y - (body_width/2); distance = y - bwh;
}else if(y < -body_width){ }else if(y < -bwh){
distance = y - ((-1*body_width)/2); distance = y + bwh;
} }
float max_dist = (wing_span-body_width)/2; float max_dist = (wing_span-body_width)/2;
float deflection = wingflex_z * (distance*distance)/(max_dist*max_dist); float deflection = wingflex_z * (distance*distance)/(max_dist*max_dist);