public Circle(Vector3 center = default(Vector3), Direction3 direction = default(Direction3), float radius = 0.5f, Matrix4x4?overrideMatrix = null) : this(center, direction, radius, (Component)null) { this._overrideMatrix = overrideMatrix; }
/// <summary> /// Returns whether two Direction3s point in the same direction without /// normalizing either of the underlying vectors. /// /// This method is intended to cheaply match bit-idential Direction3s; it's /// subject to precision error if the magnitudes of the underlying vectors /// are very different. /// </summary> public static bool PointsInSameDirection(Direction3 A, Direction3 B) { Vector3 aV = new Vector3(A.x, A.y, A.z); Vector3 bV = new Vector3(B.x, B.y, B.z); return(Vector3.Cross(aV, bV).sqrMagnitude == 0f); }
public Circle(Vector3 center = default(Vector3), Direction3 direction = default(Direction3), float radius = 0.5f, Component transformSource = null) { this.transform = (transformSource == null ? null : transformSource.transform); this.center = center; this.direction = direction; this.radius = radius; this._overrideMatrix = null; }
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 bool checkIsCacheValid() { return(_cachedPose.HasValue && _cachedCenter.HasValue && _cachedNormal.HasValue && center == _cachedCenter.Value && Direction3.PointsInSameDirection(normal, _cachedNormal.Value) && ((transform == null && !_cachedTransformMatrix.HasValue) || (_cachedTransformMatrix.HasValue && _cachedTransformMatrix.Value == transform.localToWorldMatrix))); }
public Circle(Vector3 center = default(Vector3), Direction3 direction = default(Direction3), float radius = 0.5f, Transform transform = null) : this(center, direction, radius, (Component)transform) { }