Prism
A Prism
is a class that allows the creation of any type of prism.
It requires a 2D list of points that will be used to build that path. If
there are N
points, there will be N+1
Line segments as the last and the
first point will always be joined.
- Example:
let points = [
Vector2(0,1.2),
Vector2(1.0,-1.2),
Vector2(0,-0.8),
Vector2(-1.0,-1.2)
]
let prism = Prism(
position: Vector3(50, 25, 0),
heading: 0,
points: points,
height: 2,
color: UIColor(red: 1.0, green: 0.29, blue: 0.03, alpha: 1.0)
)
self.mapView.add(prism)
The results in:
-
The direction the
Prism
is pointing toward.0
being north andPi / 2
pointing east.Declaration
Swift
public fileprivate(set) var heading: Radians { get }
-
The height of the
Prism
in meters.Declaration
Swift
public fileprivate(set) var height: Float { get }
-
The color that the Prism is drawn with.
Declaration
Swift
public fileprivate(set) var color: UIColor { get }
-
Required by the
Focusable
Api.Declaration
Swift
public var focusPoints: FocusPoints { get }
-
The position vector of the Overlay
Declaration
Swift
public var vector: Vector3 { get }
-
Which Map this Overlay belongs to, this will only exist if the ImageOverlay’s position was set using a
Coordinate
Declaration
Swift
public var map: Map? { get }
-
Only exists if the Overlay position was set with a
Coordinate
Declaration
Swift
public var coordinate: Coordinate? { get }
-
Initialize a new
Prism
object.Declaration
Parameters
position
The location in a Map or Venue where this
Prism
is. This may be aVector3
or aCoordinate
heading
The direction the
Prism
rotated topoints
The point list that will be used as a path for the outer walls of the
Prism
. These will be extruded upwards.height
The height of the
Prism
in meterscolor
What color the
Prism
will be draw with -
Set the heading, height, or color of the
Prism
and animate over a period of time. This is the standard way to change one or more of the parameters.Declaration
Swift
public func set(heading: Radians? = nil, height: Float? = nil, color: UIColor? = nil, over animationInterval: TimeInterval)
Parameters
heading
The direction in Radians that the
Prism
should pointheight
The height of the
Prism
in meters.color
The color that the
Prism
should be drawn inover
The length of time that you wish to animate this update over.
-
Set the position of a of a
Prism
using and animate the change over a a period of time. This is the standard way to change one or more parametersDeclaration
Swift
public func set(position: Vector3, heading: Radians? = nil, height: Float? = nil, color: UIColor? = nil, over animationInterval: TimeInterval)
Parameters
position
The desired position of the
Prism
in map space. This will exist in every map use aCoordinate
for the position to make this show up on only one specific map.heading
The direction in Radians that the
Prism
should pointheight
The height of the
Prism
in meters.color
The color that the
Prism
should be drawn inover
The length of time that you wish to animate this update over.
-
Set the position of a of a
Prism
using and animate the change over a a period of time. This is the standard way to change one or more parametersDeclaration
Swift
public func set(position: Coordinate, heading: Radians? = nil, height: Float? = nil, color: UIColor? = nil, over animationInterval: TimeInterval)
Parameters
position
The desired position of the
Prism
. This makes it appear in this spot only on the map associated with the Coordinate.heading
The direction in Radians that the
Prism
should pointheight
The height of the
Prism
in meters.color
The color that the
Prism
should be drawn inover
The length of time that you wish to animate this update over.
-
Set the position to a locations
Deprecated:
Use
set
as it is functionally equivalent but also follows Apple’s named conventions.Declaration
Swift
@available(*, deprecated, message: "Functionally equivalent to the `Prism.set` function, and does not\nconform to the Apple's standard named conventions.") public func setPosition(to position: Vector3, over animationInterval: TimeInterval)
Parameters
to
The desired position of the
Prism
over
The time interval used to animate between the current look of the
Prism
to the one set here -
Set the position to a locations
Deprecated:
Use
set
as it is functionally equivalent but also follows Apple’s named conventions.Declaration
Swift
@available(*, deprecated, message: "Functionally equivalent to the `Prism.set` function, and does not\nconform to the Apple's standard named conventions.") public func setPosition(to position: Coordinate, over animationInterval: TimeInterval)
Parameters
to
The desired position of the
Prism
over
The time interval used to animate between the current look of the
Prism
to the one set here -
Set the position to a locations
Deprecated:
Use
set
as it is functionally equivalent but also follows Apple’s named conventions.Declaration
Swift
@available(*, deprecated, message: "Functionally equivalent to the `Prism.set` function, and does not\nconform to the Apple's standard named conventions.") public func setHeading(to heading: Radians, over animationInterval: TimeInterval)
Parameters
to
The desired position of the
Prism
over
The time interval used to animate between the current look of the
Prism
to the one set here -
Set the height of the
Prism
, animated over a time frame.Deprecated:
Use
set
as it is functionally equivalent but also follows Apple’s named conventions.Declaration
Swift
@available(*, deprecated, message: "Functionally equivalent to the `Prism.set` function, and does not\nconform to the Apple's standard named conventions.") public func setHeight(to height: Float, over animationInterval: TimeInterval)
Parameters
height
The height of the
Prism
in metersover
The time interval used to animate between the current look of the
Prism
to the one set here -
Set the color of the
Prism
, animated over a time frame.Deprecated:
Use
set
as it is functionally equivalent but also follows Apple’s named conventions.Declaration
Swift
@available(*, deprecated, message: "Functionally equivalent to the `Prism.set` function, and does not\nconform to the Apple's standard named conventions.") public func setColor(to color: UIColor, over animationInterval: TimeInterval)
Parameters
color
What color the
Prism
will be draw withover
The time interval used to animate between the current look of the
Prism
to the one set here