MSFCelestialObject

Objective-C


@interface MSFCelestialObject : NSObject {
  void *swigCPtr;
  BOOL swigCMemOwn;
}

Swift

class MSFCelestialObject : NSObject

A base class for objects that are placed in the sky rather than on the map.

An object is anchored in one of two ways:

  • by DIRECTION (azimuth and altitude), with an optional distance. A distance of 0 means infinitely far: the object keeps its direction whatever the camera does, which is what a body at an effectively infinite distance needs. A finite distance gives real parallax and is what an aircraft or a satellite overhead needs.
  • by geographic POSITION plus an altitude in meters, for an object that belongs to a place on the map but is above it.

Objects are hit-tested against the touch ray like any other layer’s elements, so a click on one is reported through the layer’s listener, and terrain in front of it wins the hit.

  • Checks if this object is equal to the specified object.

    Declaration

    Objective-C

    - (BOOL)isEqual:(id)object;

    Swift

    func isEqual(_ object: Any!) -> Bool

    Parameters

    object

    The reference object.

    Return Value

    True when objects are equal, false otherwise.

  • Returns the hash value of this object.

    Declaration

    Objective-C

    - (NSUInteger)hash;

    Swift

    func hash() -> UInt

    Return Value

    The hash value of this object.

  • Returns true if the object is anchored by direction, false if by geographic position.

    Declaration

    Objective-C

    - (BOOL)isDirectionAnchored;

    Swift

    func isDirectionAnchored() -> Bool

    Return Value

    True if the object is anchored by direction.

  • Returns the azimuth of a direction-anchored object.

    Declaration

    Objective-C

    - (float)getAzimuth;

    Swift

    func getAzimuth() -> Float

    Return Value

    The azimuth in degrees, clockwise from north.

  • Returns the altitude of a direction-anchored object.

    Declaration

    Objective-C

    - (float)getAltitude;

    Swift

    func getAltitude() -> Float

    Return Value

    The altitude in degrees above the horizon.

  • Returns the distance of a direction-anchored object.

    Declaration

    Objective-C

    - (double)getDistance;

    Swift

    func getDistance() -> Double

    Return Value

    The distance in meters, or 0 for infinitely far.

  • Anchors the object by direction. This is the anchor for anything that behaves like a celestial body.

    Declaration

    Objective-C

    - (void)setDirection:(float)azimuth
                altitude:(float)altitude
                distance:(double)distance;

    Swift

    func setDirection(_ azimuth: Float, altitude: Float, distance: Double)

    Parameters

    azimuth

    The azimuth in degrees, clockwise from north.

    altitude

    The altitude in degrees above the horizon.

    distance

    The distance in meters. 0 means infinitely far, so the object never parallaxes when the camera moves.

  • Returns the geographic position of a position-anchored object.

    Declaration

    Objective-C

    - (MSFMapPos *)getPosition;

    Swift

    func getPosition() -> MSFMapPos!

    Return Value

    The position, in the coordinate system of the layer’s data source projection.

  • Returns the altitude of a position-anchored object.

    Declaration

    Objective-C

    - (double)getPositionAltitude;

    Swift

    func getPositionAltitude() -> Double

    Return Value

    The altitude in meters above the ground.

  • Anchors the object above a place on the map. Use this for aircraft, satellites, or anything else that has a real location.

    Declaration

    Objective-C

    - (void)setPosition:(MSFMapPos *)pos altitude:(double)altitude;

    Swift

    func setPosition(_ pos: MSFMapPos!, altitude: Double)

    Parameters

    pos

    The position, in the coordinate system of the layer’s data source projection.

    altitude

    The altitude in meters above the ground.

  • Returns the color of the object.

    Declaration

    Objective-C

    - (MSFColor *)getColor;

    Swift

    func getColor() -> MSFColor!

    Return Value

    The color of the object.

  • Sets the color of the object. The color multiplies the bitmap, if there is one.

    Declaration

    Objective-C

    - (void)setColor:(MSFColor *)color;

    Swift

    func setColor(_ color: MSFColor!)

    Parameters

    color

    The new color.

  • Returns the visibility of the object.

    Declaration

    Objective-C

    - (BOOL)isVisible;

    Swift

    func isVisible() -> Bool

    Return Value

    True if the object is drawn.

  • Sets the visibility of the object. An invisible object is neither drawn nor clickable.

    Declaration

    Objective-C

    - (void)setVisible:(BOOL)visible;

    Swift

    func setVisible(_ visible: Bool)

    Parameters

    visible

    The new visibility.

  • Returns a meta data value.

    Declaration

    Objective-C

    - (MSFVariant *)getMetaDataElement:(NSString *)key;

    Swift

    func getMetaDataElement(_ key: String!) -> MSFVariant!

    Parameters

    key

    The key of the value.

    Return Value

    The value, or an empty variant if the key does not exist.

  • Sets a meta data value. Meta data is carried through to the click listener, which is how an application tells its objects apart.

    Declaration

    Objective-C

    - (void)setMetaDataElement:(NSString *)key element:(MSFVariant *)element;

    Swift

    func setMetaDataElement(_ key: String!, element: MSFVariant!)

    Parameters

    key

    The key of the value.

    element

    The value.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()