IAttachment80

This interface controls the attachment behavior of objects.

 

 

Properties

 

AttachedToID

Gets the ID of the object attached to the leader object.

AutoDetach

Gets and sets a Boolean that determines the behavior of the camera once it reaches the object during a “fly to” operation.

DeltaAltitude

Gets and sets the distance between the heights of the attached objects.

DeltaPitch

Gets and sets the distance between the pitches of the attached objects.

DeltaRoll

Gets and sets the distance between the rolls of the attached objects.

DeltaX

Gets and sets the distance between the x-coordinates of the attached objects.

DeltaY

Gets and sets the distance between the y-coordinates of the attached objects.

DeltaYaw

Gets and sets the distance between the yaws of the attached objects.

IsAttached

Gets whether the object is currently attached to another object.

 

Methods

 

AttachTo

Attaches an object to another object by using the other object’s ID.

 

AttachedToID

Gets the ID of the object attached to the leader object. To determine whether the object is attached to another object, first call IAttachment80.IsAttached.

 

JavaScript

 

AttachedToID

 

C#

 

string AttachedToID { get; }

 

C++

 

HRESULT AttachedToID ([out, retval] BSTR* ObjectID)

 

AutoDetach

Gets and sets a Boolean that determines the behavior of the camera once it reaches the object during a “fly to” operation. For dynamic objects, AutoDetach is set to FALSE by default. In other words, once the camera reaches the dynamic object, it continues following the object. However, if AutoDetach is set to TRUE, once the camera reaches the object, it stops. If the client is constantly updating the position of the object at each frame (as a response to a GPS update, for example), it should set this flag (after creating the object) to false. This way, if the user flies to this object, the camera continues following it.

 

JavaScript

 

AutoDetach

 

C#

 

bool AutoDetach { get; set; }

 

C++

 

HRESULT AutoDetach([out, retval] VARIANT_BOOL* pVal)

HRESULT AutoDetach([in] VARIANT_BOOL pVal)

 

DeltaAltitude

Gets and sets the distance between the heights of the attached objects. This number stays consistent while the objects are attached. A positive DeltaAltitude places this object above the leading object.

 

JavaScript

 

DeltaAltitude

 

C#

 

double DeltaAltitude { get; set; }

 

C++

 

HRESULT DeltaAltitude ([out, retval] double* DeltaAltitude)

HRESULT DeltaAltitude ([in] double DeltaAltitude)

 

DeltaPitch

Gets and sets the distance between the pitches of the attached objects. This number stays consistent while the objects are attached. A positive DeltaPitch places this object above the leading object.

 

JavaScript

 

DeltaPitch

 

C#

 

double DeltaPitch { get; set; }

 

C++

 

HRESULT DeltaPitch([out, retval] double* DeltaPitch)

HRESULT DeltaPitch ([in] double DeltaPitch)

 

DeltaRoll

Gets and sets the distance between the rolls of the attached objects. This number stays consistent while the objects are attached. A positive DeltaRoll places this object above the leading object.

 

JavaScript

 

DeltaRoll

 

C#

 

double DeltaRoll { get; set; }

 

C++

 

HRESULT DeltaRoll([out, retval] double* DeltaRoll)

HRESULT DeltaRoll ([in] double DeltaRoll)

 

DeltaX

Gets and sets the distance between the x-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaX places this object to the left of the leading object.

 

JavaScript

 

DeltaX

 

C#

 

double DeltaX { get; set; }

 

C++

 

HRESULT DeltaX([out, retval] double* DeltaX)

HRESULT DeltaX([in] double DeltaX)

 

DeltaY

Gets and sets the distance between the y-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaY places this object behind the leading object.

 

JavaScript

 

DeltaY

 

C#

 

double DeltaY { get; set; }

 

C++

 

HRESULT DeltaY ([out, retval] double* DeltaY)

HRESULT DeltaY ([in] double DeltaY)

 

DeltaYaw

Gets and sets the distance between the yaws of the attached objects. This number stays consistent while the objects are attached. A positive DeltaYaw places this object above the leading object.

 

JavaScript

 

DeltaYaw

 

C#

 

double DeltaYaw { get; set; }

 

C++

 

HRESULT DeltaYaw ([out, retval] double* DeltaYaw)

HRESULT DeltaYaw ([in] double DeltaYaw)

 

IsAttached

Gets whether the object is currently attached to another object. The client can attach an object to another object using the AttachTo method.

 

JavaScript

 

IsAttached

 

C#

 

bool IsAttached { get; }

 

C++

 

HRESULT IsAttached([out, retval] VARIANT_BOOL* pVal)

AttachTo

The AttachTo method attaches an object to another object (the leader object) by using the other object’s ID which is given in the first argument. The attached object follows the leader object at the given offsets. This method can be used to create a formation of objects that move in a group using the path of the leading object as their path. Passing an empty string detaches the object from the object it is attached to.

 

JavaScript

 

AttachTo(

       ObjectID,

       DeltaX,

       DeltaY,

       DeltaAltitude

       DeltaYaw

       DeltaPitch

       DeltaRoll)

 

C#

 

void AttachTo(

       string ObjectID,

       double DeltaX,

       double DeltaY,

       double DeltaAltitude

       double DeltaYaw

       double DeltaPitch

       double DeltaRoll)

 

C++

 

HRESULT AttachTo(

       [in] BSTR ObjectID,

       [in] double DeltaX,

       [in] double DeltaY,

       [in] double DeltaAltitude)

       [in] double DeltaYaw,

       [in] double DeltaPitch,

       [in] double DeltaRoll);

Parameters

ObjectID

The ID of the object, on the terrain, that the current object attaches to. Passing an empty string detaches the object from the object it is attached to.

DeltaX

The distance between the x-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaX places this object to the left of the leading object.

DeltaY

The distance between the y-coordinates of the attached objects. This number stays consistent while the objects are attached. A positive DeltaY places this object behind the leading object.

DeltaAltitude

The distance between the heights of the attached objects. This number stays consistent while the objects are attached. A positive DeltaAltitude places this object above the leading object.

DeltaYaw

The distance between the yaws of the attached objects. This number stays consistent while the objects are attached. A positive DeltaYaw places this object above the leading object.

DeltaPitch

The distance between the pitches of the attached objects. This number stays consistent while the objects are attached. A positive DeltaPitch places this object above the leading object.

DeltaRoll

The distance between the rolls of the attached objects. This number stays consistent while the objects are attached. A positive DeltaRoll places this object above the leading object.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.