A vector shape for generating heightmap data.
sealed class
|
HeightmapShape
|
implements
|
IMapShapeGeneric<HeightmapShape>
|
||
extends
|
SerializableBase
|
Heightmap shapes are always specified for heightmaps of size MaxSize. Scaling is performed automatically, if necessary (see ComputeScaleToMaxSize).
See also:
HeightmapBuilder.ShapesThe configurator object for this type.
public
static
property
|
Config
{
get
}
|
||
type
|
IConfigurator<HeightmapShape>
|
||
value
|
|
The configurator object. |
Returns the configuration value that describes this object.
public
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
implements
|
IConfigurable.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
Serialization information about this type.
public
static
readonly
field
|
SerialId
|
||
type
|
ISerialTypeInfo
|
Shape distance falloff value.
public
property
|
Falloff
{
get
}
|
||
type
|
float64
|
||
value
|
|
The falloff value. |
The layer of the shape.
public
property
|
Layer
{
get
}
|
||
type
|
int32
|
||
value
|
The shape layer. | ||
implements
|
IMapShape.Layer
|
Remarks:
Map shapes with higher layer values are rendered on top.
The vector shape to render.
public
property
|
MapShape
{
get
}
|
||
type
|
IShape
|
||
value
|
|
The vector shape. | |
implements
|
IMapShape.MapShape
|
The shape rasterizer.
public
property
|
Rasterizer
{
get
}
|
||
type
|
IShapeRasterizer<HeightmapRegion>
|
||
value
|
|
The rasterizer object. |
Returns the serial type of this object.
public
property
|
SerialType
{
get
}
|
||
type
|
ISerialTypeInfo
|
||
value
|
|
The serial type. | |
inherited
|
SerializableBase.SerialType
|
Returns the serial data version.
public
virtual
property
|
SerialVersion
{
get
}
|
||
type
|
int32
|
||
value
|
|
The serial data version tag. | |
inherited
|
SerializableBase.SerialVersion
|
Remarks:
An ISerializable implementation is required to support all versions up to the one returned by SerialVersion.
See also:
ISerializable.SerializeBuilds a heightmap shape.
public
static
method
|
For
(IShape shape,
HeightmapSamples data,
float64 falloff,
int32 layer = 0)
|
||
type
|
HeightmapShape
|
||
params
|
shape
|
[not-null]
|
The input shape. |
data
|
[not-null]
|
Heightmap sample data for each vertex of the input shape (see VertexAt). | |
falloff
|
[>=0]
|
Shape distance falloff value. | |
layer
|
The
layer
of
the
shape
(higher
values
are
on
top
of
others).
Defaults
to
0 .
|
||
returns
|
|
The heightmap shape. |
Builds a heightmap shape.
public
static
method
|
For
(IShape shape,
HeightmapSample data,
float64 falloff,
int32 layer = 0)
|
||
type
|
HeightmapShape
|
||
params
|
shape
|
[not-null]
|
The input shape. |
data
|
The uniform heightmap sample data to use for the interior of shape. | ||
falloff
|
[>=0]
|
Shape distance falloff value. | |
layer
|
The
layer
of
the
shape
(higher
values
are
on
top
of
others).
Defaults
to
0 .
|
||
returns
|
|
The heightmap shape. |
Initializes the state of this object from the given data stream.
public
override
method
|
Deserialize
(int32 serialVersion,
ISerializer data)
|
||
type
|
ISerializable
|
||
params
|
serialVersion
|
[>=1]
|
The serial data version. |
data
|
[not-null]
|
The serial data stream. | |
returns
|
|
The
deserialized
object.
This
will
typically
be
this ,
but
in
some
circumstances,
another
instance
may
be
returned
(e.g.
singletons).
|
|
overrides
|
SerializableBase.Deserialize
|
Remarks:
The Deserialize method will be called immediately after the object has been instantiated via its default constructor.
The provided serialVersion number is guaranteed to be equal to or less than the SerialVersion returned by this object (i.e. ISerializable object must provide backwards compatibility).
See also:
ISerializable.SerializeSets the distance falloff value.
public
method
|
FalloffSet
(float64 falloff)
|
||
type
|
HeightmapShape
|
||
params
|
falloff
|
[>=0]
|
The falloff value. |
returns
|
|
The resulting heightmap shape. |
Sets the map shape layer (see Layer).
public
method
|
LayerSet
(int32 layer)
|
||
type
|
HeightmapShape
|
||
params
|
layer
|
The shape layer. | |
returns
|
|
The resulting map shape. | |
implements
|
IMapShapeGeneric.LayerSet
|
Converts the map shape to a cubemap, if necessary.
public
method
|
MapShapeCubemap
(float64 accuracy = 0)
|
||
type
|
HeightmapShape
|
||
params
|
accuracy
|
[>=0]
|
Optional
accuracy
to
use
for
subdivision
of
edges.
Given
as
a
maximum
error
in
the
target
coordinate
system.
Set
to
0
to
disable
edge
subdivision.
Defaults
to
0 .
|
returns
|
|
The resulting map shape. | |
implements
|
IMapShapeGeneric.MapShapeCubemap
|
See also:
IShape.TransformCubemapSets the map shape (see MapShape).
public
method
|
MapShapeSet
(IShape shape)
|
||
type
|
HeightmapShape
|
||
params
|
shape
|
The new shape. | |
returns
|
The
resulting
map
shape
or
null
if
shape
is
null .
|
||
implements
|
IMapShapeGeneric.MapShapeSet
|
Converts the map shape to the given coordinate system.
public
method
|
MapShapeTransform
(CoordinateSystem coordSys,
float64 accuracy = 0)
|
||
type
|
HeightmapShape
|
||
params
|
coordSys
|
[not-null]
|
The target coordinate system. |
accuracy
|
[>=0]
|
Optional
accuracy
to
use
for
subdivision
of
edges.
Given
as
a
maximum
error
in
the
target
coordinate
system.
Set
to
0
to
disable
edge
subdivision.
Defaults
to
0 .
|
|
returns
|
The
resulting
map
shape
or
null
if
empty. |
||
implements
|
IMapShapeGeneric.MapShapeTransform
|
Sets the uniform heightmap sample data.
public
method
|
Sample
(HeightmapSample sample)
|
||
type
|
HeightmapShape
|
||
params
|
sample
|
The uniform heightmap sample data. | |
returns
|
|
The resulting heightmap shape. |
Sets the per-vertex heightmap sample data.
public
method
|
Samples
(HeightmapSamples samples)
|
||
type
|
HeightmapShape
|
||
params
|
samples
|
[not-null]
|
The per-vertex heightmap sample data. |
returns
|
|
The resulting heightmap shape. |
Serializes the current state of this object to the given data stream.
public
override
method
|
Serialize
(ISerializer data)
|
||
params
|
data
|
[not-null]
|
The serial data stream. |
overrides
|
SerializableBase.Serialize
|
See also:
ISerializable.Deserialize