public GodotVector3 Intersect3(GodotPlane b, GodotPlane c) { float s = normal.Cross(b.normal).Dot(c.normal); if (GodotMathf.Abs(s) <= 9.99999997475243E-07) { return(new GodotVector3()); } return(((b.normal.Cross(c.normal) * d) + (c.normal.Cross(normal) * b.d) + (normal.Cross(b.normal) * c.d)) / s); }
public GodotQuat Slerpni(GodotQuat b, float t) { float s1 = Dot(b); if (GodotMathf.Abs(s1) > 0.999899983406067) { return(this); } float s2 = GodotMathf.Acos(s1); float num1 = 1f / GodotMathf.Sin(s2); float num2 = GodotMathf.Sin(t * s2) * num1; float num3 = GodotMathf.Sin((1f - t) * s2) * num1; return(new GodotQuat((num3 * x) + (num2 * b.x), (num3 * y) + (num2 * b.y), (num3 * z) + (num2 * b.z), (num3 * w) + (num2 * b.w))); }
public GodotVector3 IntersectRay(GodotVector3 from, GodotVector3 dir) { float s = normal.Dot(dir); if (GodotMathf.Abs(s) <= 9.99999997475243E-07) { return(new GodotVector3()); } float num = (normal.Dot(from) - d) / s; if (num > 9.99999997475243E-07) { return(new GodotVector3()); } return(from + (dir * -num)); }
public GodotVector3 IntersectSegment(GodotVector3 begin, GodotVector3 end) { GodotVector3 b = begin - end; float s = normal.Dot(b); if (GodotMathf.Abs(s) <= 9.99999997475243E-07) { return(new GodotVector3()); } float num = (normal.Dot(begin) - d) / s; if (num < -9.99999997475243E-07 || num > 1.00000095367432) { return(new GodotVector3()); } return(begin + (b * -num)); }
public GodotVector3 Abs() { return(new GodotVector3(GodotMathf.Abs(x), GodotMathf.Abs(y), GodotMathf.Abs(z))); }
public bool IsNormalized() { return(GodotMathf.Abs(LengthSquared() - 1f) < 9.99999997475243E-07); }
public GodotVector2 Abs() { return(new GodotVector2(GodotMathf.Abs(x), GodotMathf.Abs(y))); }
public bool HasPoint(GodotVector3 point, float epsilon = 1E-06f) { return(GodotMathf.Abs(normal.Dot(point) - d) <= (double)epsilon); }