TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

struct Sphere in Tinman.Core.Math

Represents a sphere in 3D space.

struct Sphere  

Public / Attributes

Center

The sphere center or Undefined if undefined.

public readonly field Center
type Vec3D

IsUndefined

Checks if this sphere has an undefined value.

public property IsUndefined { get }
type bool
value true if this sphere has an undefined value, false if not.

See also:

Undefined

Radius

The sphere radius or NanD if undefined.

public readonly field Radius
type float64

Volume

Returns the volume of this sphere.

public property Volume { get }
type float64
value [>=0] The sphere volume.

Public / Constants

Undefined

An undefined sphere.

public static readonly field Undefined
type Sphere

See also:

IsUndefined

Zero

A sphere with radius zero, centered at the coordinate origin.

public static readonly field Zero
type Sphere

Public / Constructors

Sphere

Creates a new instance of Sphere.

public constructor Sphere (float64 radius)
params radius The sphere radius. If less than zero, the sphere will be undefined.

Creates a new instance of Sphere.

public constructor Sphere (Vec3D center, float64 radius)
params center The sphere center.
  radius [>=0] The sphere radius.

Public / Methods

Contains

Checks if this sphere contains the given one.

[Pure]
public method Contains (Sphere sphere)
type bool
params sphere The sphere to test.
returns true if the given sphere is contained in this one,
false if not.

Checks if this sphere contains the given one.

[Pure]
public method Contains (Vec3D center, float64 radius = 0)
type bool
params center Center of the sphere to test.
  radius Radius of the sphere to test. Defaults to 0.
returns true if the given sphere is contained in this one,
false if not.

Grow

Grows this sphere so that it contains the given one.

[Pure]
public method Grow (Sphere sphere)
type Sphere
params sphere The sphere to contain.
returns The resulting sphere.

Grows this sphere so that it contains the given one.

[Pure]
public method Grow (Vec3D center, float64 radius = 0)
type Sphere
params center Center of the sphere to contain.
  radius Radius of the sphere to contain. Defaults to 0.
returns The resulting sphere.

Intersects

Checks if this sphere intersects with the given one.

[Pure]
public method Intersects (Sphere sphere)
type bool
params sphere The sphere to test.
returns true if the given sphere intersects with this one,
false if not.

Checks if this sphere intersects with the given one.

[Pure]
public method Intersects (Vec3D center, float64 radius = 0)
type bool
params center Center of the sphere to test.
  radius Radius of the sphere to test. Defaults to 0.
returns true if the given sphere intersects with this one,
false if not.

Scale

Scales this sphere.

[Pure]
public method Scale (float64 factor)
type Sphere
params factor The scale factor.
returns The scaled sphere.

Translate

Translates this sphere.

[Pure]
public method Translate (Vec3D offset)
type Sphere
params offset The translation offset.
returns The translated sphere.

Serialization

Serializer

The serialization helper object for values of Sphere.

public static readonly field Serializer
type ITypeSerializer<Sphere>