org.critterai.nmgen
Class HeightSpan

java.lang.Object
  extended by org.critterai.nmgen.HeightSpan

public final class HeightSpan
extends Object

Represents a span within the cell column of a heightfield. Spans represent one or more contiguous voxels.

See Also:
Introduction to Heightfields

Constructor Summary
HeightSpan(int min, int max, int flags)
          Constructor
 
Method Summary
 int flags()
          The flags for the span.
 int max()
          The span maximum.
 int min()
          The span minimum.
 HeightSpan next()
          The next span in the column.
 void setFlags(int value)
          Set the flags for the span.
 void setMax(int value)
          Sets the span maximum.
 void setMin(int value)
          Sets the span minimum.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeightSpan

public HeightSpan(int min,
                  int max,
                  int flags)
           throws IllegalArgumentException
Constructor

Parameters:
min - The minimum increment of the span. (Usually the height increment.)
max - The maximum increment of the span. (Usually the height increment.)
flags - The span flags.
Throws:
IllegalArgumentException - If the minimum is greater than or equal to the maximum.
Method Detail

flags

public int flags()
The flags for the span.

Returns:
The flags for the span.

max

public int max()
The span maximum.

Returns:
The span maximum.

min

public int min()
The span minimum.

Returns:
The span minimum.

next

public HeightSpan next()
The next span in the column. (Usually above the current span.)

Returns:
The next span in the column. Or null if there is no next span.

setFlags

public void setFlags(int value)
Set the flags for the span.

Parameters:
value - The new flags for the span.

setMax

public void setMax(int value)
Sets the span maximum.

Auto-clamps the value to (min() + 1).

Parameters:
value - The new maximum.

setMin

public void setMin(int value)
Sets the span minimum.

Auto-clamps the value to (max() - 1).

Parameters:
value - The new minimum.

toString

public String toString()

Overrides:
toString in class Object


Project Home and Source Code

Copyright 2010 Stephen Pratt. All rights reserved. Use is subject to license terms.