public Plane normalized() { float len = normal.length(); if (len == 0) { return(new Plane(0, 0, 0, 0)); } return(new Plane(normal / len, d / len)); }
public Quat(Vector3 axis, float angle) { float d = axis.length(); if (d == 0f) { x = 0f; y = 0f; z = 0f; w = 0f; } else { float s = Mathf.sin(-angle * 0.5f) / d; x = axis.x * s; y = axis.y * s; z = axis.z * s; w = Mathf.cos(-angle * 0.5f); } }