Sphereclass

Represents a sphere.

objectSphere
Namespace
Sandbox
Assembly
Sandbox.System
Declaration
public sealed struct Sandbox.Sphere

Constructors1

Showing 1 constructors

public Sphere(Vector3 center, float radius)PUBLICCONSTRUCTOR

ParameterTypeDescription
centerVector3
radiusfloat

Methods5

Showing 5 methods

public bool Contains(Vector3 value)PUBLIC

Returns true if sphere contains point. False if the point falls outside the sphere.

ParameterTypeDescription
valueVector3
Returns:bool

public float GetEdgeDistance(Vector3 localPos)PUBLIC

Calculates the shortest distance from the specified local position to the nearest edge of the object.

ParameterTypeDescription
localPosVector3
Returns:float

public float GetVolume()PUBLICOBSOLETE

Get the volume of this sphere

Obsolete: Use Sphere.Volume instead.

Returns:float

Properties4

Showing 4 properties

public Vector3 Sandbox.Sphere.RandomPointInside { get; set; }PUBLICGETSET

Returns a random point within this sphere.

Returns:Vector3

public Vector3 Sandbox.Sphere.RandomPointOnEdge { get; set; }PUBLICGETSET

Returns a random point on the edge of this sphere.

Returns:Vector3

public static Sandbox.Sphere Sandbox.Sphere.Unit { get; set; }PUBLICSTATICGETSET

A sphere centered at the origin, with radius 1.

Returns:Sphere

public float Sandbox.Sphere.Volume { get; set; }PUBLICGETSET

Volume of this sphere

Returns:float

On this page