public Plane(Vector3 center, Direction3 normal) { _cachedCenter = null; _cachedNormal = null; _cachedMatrix = null; _cachedPose = null; _cachedTransformMatrix = null; this.center = center; this.normal = normal; this.transform = null; }
private void rebuildCache() { _cachedMatrix = Matrix4x4.TRS( center, Quaternion.LookRotation(normal), Vector3.one); _cachedPose = new Pose(center, Quaternion.LookRotation(normal)); _cachedCenter = center; _cachedNormal = normal; if (transform == null) { _cachedTransformMatrix = null; } else { _cachedMatrix = transform.localToWorldMatrix * _cachedMatrix; _cachedPose = transform.localToWorldMatrix.GetPose().mul(_cachedPose.Value); _cachedTransformMatrix = transform.localToWorldMatrix; } }