Struct Sphere
A sphere is a shape consisting of all points in a plane that are at a given distance from a given point, the centre.
Inherited Members
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: ProjectDawn.Geometry.dll
Syntax
[Serializable]
public struct Sphere : IEquatable<Sphere>
Constructors
|
Improve this Doc
View Source
Sphere(float3, Single)
Declaration
public Sphere(float3 center, float radius)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
center |
|
System.Single |
radius |
|
Fields
|
Improve this Doc
View Source
Center
Declaration
Field Value
Type |
Description |
Unity.Mathematics.float3 |
|
|
Improve this Doc
View Source
Radius
Declaration
Field Value
Type |
Description |
System.Single |
|
Properties
|
Improve this Doc
View Source
Area
Returns the area of the sphere.
Declaration
public float Area { get; }
Property Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Diameter
Diameter of the sphere. Diameter = 2 * Radius.
Declaration
public float Diameter { get; set; }
Property Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Unit
Declaration
public static Sphere Unit { get; }
Property Value
|
Improve this Doc
View Source
Volume
Returns the volume of the sphere.
Declaration
public float Volume { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
|
Improve this Doc
View Source
BoundingBox()
Returns minimum rectangle that fully covers shape.
Declaration
Returns
|
Improve this Doc
View Source
ClosestPoint(float3)
Returns a point on the perimeter of this sphere that is closest to the specified point.
Declaration
public float3 ClosestPoint(float3 point)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
point |
|
Returns
Type |
Description |
Unity.Mathematics.float3 |
|
|
Improve this Doc
View Source
Equals(Sphere)
Declaration
public bool Equals(Sphere other)
Parameters
Type |
Name |
Description |
Sphere |
other |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
System.Object |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
Overlap(Box)
Declaration
public bool Overlap(Box rectangle)
Parameters
Type |
Name |
Description |
Box |
rectangle |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Overlap(Capsule)
Declaration
public bool Overlap(Capsule capsule)
Parameters
Type |
Name |
Description |
Capsule |
capsule |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Overlap(Sphere)
Declaration
public bool Overlap(Sphere sphere)
Parameters
Type |
Name |
Description |
Sphere |
sphere |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Overlap(float3)
Returns true if shapes surfaces overlap.
Declaration
public bool Overlap(float3 pointb)
Parameters
Type |
Name |
Description |
Unity.Mathematics.float3 |
pointb |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Union(Sphere, Sphere)
Returns minimum bounding sphere that contains both spheres.
Declaration
public static Sphere Union(Sphere a, Sphere b)
Parameters
Returns
Operators
|
Improve this Doc
View Source
Equality(Sphere, Sphere)
Declaration
public static bool operator ==(Sphere lhs, Sphere rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(Sphere, Sphere)
Declaration
public static bool operator !=(Sphere lhs, Sphere rhs)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IEquatable<T>