LavishNav:Sphere (Region Type)

From Lavish Software Wiki
Revision as of 16:54, 22 February 2007 by Bootyjuice (talk | contribs) (→‎Examples)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to navigation Jump to search

Introduction

What is a Sphere?

A sphere is a point with a given size in 3 dimensions.

Sphere Behaviors

Containment

A sphere contains a given point if the distance from the sphere's point to the given point in 3 dimensions is less than or equal to the size of the sphere.

Nearest Point

Nearest point behavior is not presently implemented for spheres. The nearest point to any given point is the center point for the time being.

Center Point

The center point within this region is the defined location of the sphere.

Sphere Characteristics

Spheres are descendants of the base region type. Any characteristics of the base region type may be applied in addition to the sphere-specific characteristics described below.

Sphere-Specific Properties

  • X
X-coordinate. Defaults to 0.
  • Y
Y-coordinate. Defaults to 0.
  • Z
Z-coordinate. Defaults to 0.
  • Size
The size in 3 dimensions (i.e. the radius of the sphere)

Programming with spheres

LavishScript
LavishNav:lnavsphere_(Object_Type)
.NET
Sphere class

Examples

Example AddChild

; This code creates a sphere of radius 5 at point 1,1,1.  It also uses automatic name generation.
LavishNav.Tree:AddChild[sphere,"auto",5,1,1,1]

Example XML code

<Sphere Name="Banker">
   <X>1.234</X>
   <Y>2.34567</Y>
   <Z>3.14159</Z>
   <Size>10</Size>
</Sphere>

See Also