Google.Maps.Feature.Shape.MapFeatureShape

This is an abstract class.

Describes the geometric information for a Feature (such as a building or road).

Summary

All geometry in this class is relative to the Origin.

Inheritance

Direct Known Subclasses:Google.Maps.Feature.Shape.Area, Google.Maps.Feature.Shape.ExtrudedArea, Google.Maps.Feature.Shape.LineGroup, Google.Maps.Feature.Shape.ModeledVolume

Properties

BoundingBox
Bounds
The bounding box of all of the geometries in this MapFeatureShape.
Origin
Vector2
The two-dimensional origin of the coordinate system for all contained vertices. I.e., all vertices in FootPrints of Extrusions are measured relative to this origin.

Protected functions

CalculateLocalBoundingBox()
virtual abstract Bounds
Calculates and returns a local bounding box for all of the geometry represented by this object.
InvalidateBoundingBox()
void
Marks the cached value of CachedBoundingBox as out of date.
MapFeatureShape()
Constructs a GeometricMapFeature with empty BoundingBox at (0,0,0).
Recenter()
void
Sets the Origin to be the center of its bounding box, and transforms all contained geometries to be relative to this origin.
TranslateGeometry(Vector2 offset)
virtual abstract void
Translates the geometry by the supplied offset. This does not change the position of the Origin.

Public functions

TranslateOrigin(Vector2 offset)
void
Moves the Origin by the supplied offset.

Public static functions

VerticesToBounds(IEnumerable< Vector3 > vertices)
Bounds
Return a Unity Bounds object that encapsulates the supplied vertices.
VerticesToBounds(IEnumerable< Vector2 > vertices)
Bounds
Return a Unity Bounds object that encapsulates the supplied vertices.

Properties

BoundingBox

Bounds BoundingBox

The bounding box of all of the geometries in this MapFeatureShape.

This is always relative to the parent GameObject.

Origin

Vector2 Origin

The two-dimensional origin of the coordinate system for all contained vertices. I.e., all vertices in FootPrints of Extrusions are measured relative to this origin.

This origin is relative to the parent of the MapFeatureShape, which is either the GameObject that contains a MapsService, or another MapFeatureShape.

Protected functions

CalculateLocalBoundingBox

virtual abstract Bounds CalculateLocalBoundingBox()

Calculates and returns a local bounding box for all of the geometry represented by this object.

The bounding box is located relative to the Shape's origin, which means that the center of it might not be at (0, 0) if the Origin is not at the center of all of the vertices.

InvalidateBoundingBox

void InvalidateBoundingBox()

Marks the cached value of CachedBoundingBox as out of date.

MapFeatureShape

 MapFeatureShape()

Constructs a GeometricMapFeature with empty BoundingBox at (0,0,0).

Recenter

void Recenter()

Sets the Origin to be the center of its bounding box, and transforms all contained geometries to be relative to this origin.

TranslateGeometry

virtual abstract void TranslateGeometry(
  Vector2 offset
)

Translates the geometry by the supplied offset. This does not change the position of the Origin.

Details
Parameters
offset
An offset vector used for translation.

Public functions

TranslateOrigin

void TranslateOrigin(
  Vector2 offset
)

Moves the Origin by the supplied offset.

Details
Parameters
offset
An offset vector used for translation.

Public static functions

VerticesToBounds

Bounds VerticesToBounds(
  IEnumerable< Vector3 > vertices
)

Return a Unity Bounds object that encapsulates the supplied vertices.

VerticesToBounds

Bounds VerticesToBounds(
  IEnumerable< Vector2 > vertices
)

Return a Unity Bounds object that encapsulates the supplied vertices.

Send feedback about...

Google Maps Platform gaming solution
Google Maps Platform gaming solution