Advanced parameters shows 0 velocity if sender is 0 radius and has any angular rotation at all
tracked
SenkyDragon
If a sender is 0 radius, it shows 0 for the velocity components in advanced parameters of any receiver. Oddly, this works properly if the sender is not currently rotating AT ALL. However, if there is any angular momentum (even due to floating point error), the math fails and the velocity is calculated as NaN (getting exposed to the parameters as 0).
Log In
This post was marked as
tracked
SenkyDragon
This seems to work properly in the editor with a small patch to CalcVelocityAtPoint,
before
float3 tangent = math.cross(math.normalize(x), this.angularNormal);
velocity += tangent * math.length(x) * (this.angularSpeed * ((float) Math.PI / 180f));
after
velocity += math.cross(x, this.angularNormal) * (this.angularSpeed * ((float) Math.PI / 180f))
math.normalize(0) returns Nan. Rather than pulling out the offset vector and length separately, using it as is non-normalized makes the math work out properly.