Eye operations

This section documents classes to control the eye through which we see the 3D scene shown by the GermaniumWeb plugin.

Class list

Author

G Element Germanium team

Eye

Represents the eye through which we see the scene.  3 parameters define the Eye :

  • position: 3D coordinates of the Eye (unit is meters)
  • orientation: rotation angle about X, Y, & Z axes (unit is radians)
  • target distance: how far the target is from the Eye (unit is meters)

You should not instantiate the Eye class using the JavaScript keyword ‘new’.  Instead, use the function WebControl.GetEye to get a handle to the Eye.

Since

Version 0.0.10

See also

WebControl.GetEye

Related class

EyeParams

Summary
Position, orientation, target properties
GetPosition Gets 3D position of the Eye .
SetPosition Sets the position of the Eye .
GetOrientation Gets orientation of the Eye .
SetOrientation Sets the orientation of the Eye .
GetParams Saves Eye parameters to an EyeParams object.
SetParams Sets all parameters for the Eye .
GetTargetPosition Gets the position of the target point.
SetTargetPosition Sets the position of the target point.
GetTargetDistance Returns the distance between the Eye and the target.
SetTargetDistance Sets the distance between the Eye and the target.
Grid visibility property Deprecated; see Options.Grid settings instead.
GetGridVisibility Deprecated; use Options.GetGridVisibility instead.
SetGridVisibility Deprecated; use Options.SetGridVisibility instead.
ShowGrid Deprecated; use Options.SetGridVisibility instead.
HideGrid Deprecated; use Options.SetGridVisibility instead.
Orthographic projection property
GetOrthographicProjection Gets whether orthographic projection is currently enabled.
SetOrthographicProjection Sets orthographic projection state to true or false.
Field of View property
GetHorizontalFieldOfView Gets the angle of horizontal field of view of the Eye (in radians).
SetHorizontalFieldOfView Sets the angle of horizontal field of view of the Eye (in radians).
GetVerticalFieldOfView Gets the angle of the vertical field of view of the Eye (in radians).
SetVerticalFieldOfView Sets the angle of vertical field of view of the Eye (in radians).
Auto-rotation property
GetRotationState Gets whether auto-rotation of the Eye around the scene is enabled.
SetRotationState Enable or disable auto-rotation of the Eye around the scene.
EnableRotation Starts Eye auto-rotation around the scene.
DisableRotation Stops Eye auto-rotation around the scene.
IsRotating Returns true if Eye auto-rotation is currently enabled.
Specifying glide parameters This section explains how you can pass parameters for gliding to the functions GlideEyeTo , GlideTargetTo , and GlideEyeToFit .
Gliding Eye functions
GlideEyeTo Glides the Eye to the specified destination.
GlideEyeToPos Glides the Eye to the specified position.
GlideEyeToPosOrt Glides the Eye to the specified position and orientation.
GlideEyeToEyeParams Glides the Eye to an fully specified EyeParams destination.
GlideEyeToFit Glides the Eye such that it can see the specified object.
Gliding target functions
GlideTargetTo Glides target to the specified EyeParams , position, or orientation.
GlideTargetToPos Glides target to the specified position.
GlideTargetToPosOrt Glides target to the specified position and orientation.
GlideTargetToEyeParams Glides target to a fully specified EyeParams destination.
Gliding to a BBL object
GlideEyeToVisibleBBL Glides the Eye such that it can see all visible BBL objects currently in the scene.
GlideEyeToBuilding Glides the Eye to the specified Building .
GlideEyeToBuildingOrt Glides the Eye to the specified Building and orientation.
GlideEyeToBlock Glides the Eye to the specified Block .
GlideEyeToBlockOrt Glides the Eye to the specified Block and orientation.
GlideEyeToLevel Glides the Eye to the specified Level .
GlideEyeToLevelOrt Glides the Eye to the specified Level and orientation.
Gliding to a VisualObject
GlideEyeToVisualObject Glides the Eye to best fit the specified VisualObject .
GlideEyeToVisualObjectOrt Glides the Eye to best fit the specified VisualObject using the specified orientation.
GlideTargetToVisualObject Deprecated; use GlideEyeToVisualObject .
Gliding utility functions
IsGliding Returns true if the Eye is currently gliding.
CancelGlide Stops current Eye gliding, leaving the Eye at its current mid-glide position.
FinishGlide Stops current Eye gliding, putting the Eye at the destination position of the glide.
First Person Navigation Warning: Experimental feature.
EnableFirstPersonNavigation Deprecated; use WebControl.SetNavigationMode instead.
DisableFirstPersonNavigation Deprecated; use WebControl.SetNavigationMode instead.
IsFirstPersonNavigationEnabled Deprecated; use WebControl.IsInNavigationMode instead.
GetFirstPersonNavigationEnabled Deprecated; use WebControl.IsInNavigationMode instead.
SetFirstPersonNavigationEnabled Deprecated; use WebControl.SetNavigationMode instead.
GetFirstPersonEyeHeight Deprecated; use Options.GetFirstPersonEyeHeight instead.
SetFirstPersonEyeHeight Deprecated; use Options.SetFirstPersonEyeHeight instead.
GetFirstPersonFloorHeight Deprecated; use Options.GetFirstPersonFloorHeight instead.
SetFirstPersonFloorHeight Deprecated; use Options.SetFirstPersonFloorHeight instead.
3D utility functions
Compute3DIntersection Computes the 3D coordinates that the specified window pixel intersects the scene with.
Convert3DToWindow Converts a 3D position from 3D view coordinates to window coordinates.
ConvertWindowTo3D Converts a 3D position from window coordinates to 3D view coordinates.
CanSeeVisualObject Checks whether the specified VisualObject is in the current Eye view.

Position, orientation, target properties

GetPosition

GetPosition : function ()

Gets 3D position of the Eye .

Returns

Coordinates

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

SetPosition

SetPosition : function (X,
y,
z)

Sets the position of the Eye .

As side effects, this function :

  • maintains Eye orientation,
  • maintains target distance (the distance between the Eye & target point),
  • modifies target position.

Sometimes, it is more convenient to place the Eye by specifying target position (target is the point the Eye looks at).  You can do so by calling SetTargetPosition .

This function instantaneously moves the Eye to the specified position.  To animate Eye movement, you can call GlideEyeToPos or GlideTargetToPos .

Parameters

{mixed} XA Coordinates object / a float
{float} y(Optional)
{float} z(Optional)

Returns

void

Event

OnEyeMoved

Throws

Usage

SetPosition(X)Specify position as a Coordinates .
SetPosition(X, y, z)Specify position as a float triple.

Since

Version 0.0.10

See also

GetOrientation

GetOrientation : function ()

Gets orientation of the Eye .

Returns

EulerAngle

Throws

”uninitialized_plugin_object” Exception .

Since

Version 0.0.10

SetOrientation

SetOrientation : function (P,
q,
r)

Sets the orientation of the Eye .

As side effects, this function :

  • maintains Eye position,
  • maintains target distance (the distance between the Eye & target point),
  • modifies target position.

This function instantaneously adjusts the Eye to the specified orientation.  To animate Eye adjustment, you can call GlideEyeToPosOrt or GlideTargetToPosOrt .

Parameters

{mixed} PAn EulerAngle object / a float
{float} q(Optional)
{float} r(Optional)

Returns

void

Event

OnEyeMoved

Throws

Usage

SetOrientation(P)Specify orientation as an EulerAngle .
SetOrientation(P, q, r)Specify orientation as a float triple; where P, q, and r are respectively rotation angle about X, Y, and Z-axis, in radians.

Since

Version 0.0.10

See also

GetParams

GetParams : function ()

Saves Eye parameters to an EyeParams object.  To load Eye parameters from an EyeParams object, use the function SetParams .

Returns

EyeParams

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

SetParams

SetParams : function (X,
Y,
z,
p,
q,
r,
d)

Sets all parameters for the Eye .

This function instantaneously sets Eye parameters.  To animate Eye transition, you can call GlideEyeToEyeParams or GlideTargetToEyeParams .

Parameters

{mixed} XAn EyeParams object / a Coordinates object / a float.
{mixed} Y(Optional) An EulerAngle object / a float.
{float} z(Optional)
{float} p(Optional)
{float} q(Optional)
{float} r(Optional)
{float} d(Optional)

Returns

void

Event

OnEyeMoved

Throws

Usage

SetParams(X)Sets Eye parameters from the EyeParams object X.  To save Eye parameters to an EyeParams object, use the function GetParams() .
SetParams(X, Y, z)Sets Eye parameters as follows: position from the Coordinates object X, orientation from the EulerAngle object Y, and target distance from the float z.
SetParams(X, Y, z, p, q, r, d)Sets Eye parameters from float values as follows: position from the float triple (X, Y, z), orientation from the float triple (p, q, r), and target distance from the float d.

Since

Version 0.0.10

See also

GetTargetPosition

GetTargetPosition : function ()

Gets the position of the target point.  The target point is the point the Eye looks at.

Returns

Coordinates

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.1.0.10

SetTargetPosition

SetTargetPosition : function (X,
y,
z)

Sets the position of the target point.  The target point is the point the Eye looks at.

As a side effect, this function :

  • modifies Eye position,
  • maintains Eye orientation,
  • maintains target distance(the distance between the Eye & the target point).

To set the Eye position, use the function SetPosition .

This function instantaneously moves the target point to the specified position.  To animate Eye movement, you can call GlideEyeToPos or GlideTargetToPos .

Parameters

{mixed} XA Coordinates object / a float
{float} y(Optional)
{float} z(Optional)

Usage

SetTargetPosition(X)Sets target position as a Coordinates .
SetTargetPosition(X, y, z)Sets target position according to a float triple.

Returns

void

Throws

Since

Version 0.1.0.2

See also

SetPosition

GetTargetDistance

GetTargetDistance : function ()

Returns the distance between the Eye and the target.  The target is the point the Eye looks at.

Returns

float

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.1.0.7

SetTargetDistance

SetTargetDistance : function (dist,
bMoveEye)

Sets the distance between the Eye and the target.  The target is the point the Eye looks at.  By default, this function moves the target, keeping the Eye stationary.

Since API version 1.3.4.0, you can specify bMoveEye parameter as true to keep the target stationary and move the Eye instead.

As side effects, if bMoveEye is nor set or set false, this function :

  • maintains Eye position,
  • maintains Eye orientation,
  • modifies target position.

If bMoveEye is set true, this function :

  • modifies Eye position,
  • maintains Eye orientation,
  • maintains target position.

Parameters

{float} distthe new distance between the Eye and the target
{bool} bMoveEye(optional) whether or not the function moves the Eye.  If not specified, this function will not move the Eye.  (Since Version 1.3.4.0.)

Returns

void

Event

OnEyeMoved if bMoveEye is true

Throws

Since

Version 0.1.0.7

Grid visibility property

Deprecated; see Options.Grid settings instead.

Deprecated in

Version 1.4.13.0

GetGridVisibility

GetGridVisibility : function()

Deprecated; use Options.GetGridVisibility instead.  Gets the visibility of the horizontal grid in the scene.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

Deprecated in

Version 1.4.13.0

SetGridVisibility

SetGridVisibility : function(bVal)

Deprecated; use Options.SetGridVisibility instead.  Sets the visibility of the horizontal grid in the scene.

Parameter

{bool} bVal

Returns

void

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

Deprecated in

Version 1.4.13.0

ShowGrid

ShowGrid : function ()

Deprecated; use Options.SetGridVisibility instead.  Shows the horizontal grid in the scene.

Returns

void

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

Deprecated in

Version 1.4.13.0

HideGrid

HideGrid : function ()

Deprecated; use Options.SetGridVisibility instead.  Hides the horizontal grid in the scene.

Returns

void

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

Deprecated in

Version 1.4.13.0

Orthographic projection property

GetOrthographicProjection

GetOrthographicProjection : function ()

Gets whether orthographic projection is currently enabled.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.1.0.23

SetOrthographicProjection

SetOrthographicProjection : function (bVal)

Sets orthographic projection state to true or false.  Orthographic projection makes it easier to visualise actual distances in your Building s.  When orthographic projection is disabled, perspective projection is used instead.

Orthographic projection is disabled by default.

Note

Orthographic projection cannot be set to true while first person navigation is enabled.  The function returns false with the projection state unchanged in this case.

Parameter

{bool} bValBoolean value to be set as ortographic projection state.

Returns

booltrue if projection state successfully changes; false otherwise

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.1.0.23

Field of View property

GetHorizontalFieldOfView

GetHorizontalFieldOfView : function ()

Gets the angle of horizontal field of view of the Eye (in radians).

Returns

float

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.2.0.29

SetHorizontalFieldOfView

SetHorizontalFieldOfView : function (angle)

Sets the angle of horizontal field of view of the Eye (in radians).  The value is clipped to the range [0.017453, 3.12414] (the equivalent of [1, 179] in degrees).

GermaniumWeb maintains the aspect ratio according to window dimensions.  Thus, you only need to set either horizontal or vertical field of view.  For example, the following will result in the vertical field of view to be 60 degrees.

theEye.SetHorizontalFieldOfView(Germanium.DegreeToRadian(130)); // will be overridden by the next line
theEye.SetVerticalFieldOfView(Germanium.DegreeToRadian(60));

Parameter

{float} anglethe value, in radians, to be set as horizontal field of view

Returns

void

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.2.0.29

GetVerticalFieldOfView

GetVerticalFieldOfView : function ()

Gets the angle of the vertical field of view of the Eye (in radians).

Returns

float

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.2.0.29

SetVerticalFieldOfView

SetVerticalFieldOfView : function (angle)

Sets the angle of vertical field of view of the Eye (in radians).  The value is clipped to the range [0.017453, 3.12414] (the equivalent of [1, 179] in degrees).

GermaniumWeb maintains the aspect ratio according to window dimensions.  Thus, you only need to set either horizontal or vertical field of view.  For example, the following will result in the vertical field of view to be 60 degrees.

theEye.SetHorizontalFieldOfView(Germanium.DegreeToRadian(130)); // will be overridden by the next line
theEye.SetVerticalFieldOfView(Germanium.DegreeToRadian(60));

Parameter

{float} anglethe value, in radians, to be set as vertical field of view

Returns

void

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.2.0.29

Auto-rotation property

GetRotationState

GetRotationState : function ()

Gets whether auto-rotation of the Eye around the scene is enabled.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

SetRotationState

SetRotationState : function (bVal)

Enable or disable auto-rotation of the Eye around the scene.

Parameter

{bool} bVal

Returns

void

Event

  • OnAutoRotateStarted if bVal is true
  • OnAutoRotateCancelled if bVal is false

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

EnableRotation

EnableRotation : function ()

Starts Eye auto-rotation around the scene.

Returns

void

Event

OnAutoRotateStarted

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

DisableRotation

DisableRotation : function ()

Stops Eye auto-rotation around the scene.

Returns

void

Event

OnAutoRotateCancelled

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.0.10

IsRotating

IsRotating : function ()

Returns true if Eye auto-rotation is currently enabled.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.3.5.0

Specifying glide parameters

This section explains how you can pass parameters for gliding to the functions GlideEyeTo , GlideTargetTo , and GlideEyeToFit .

There are 3 groups of gliding parameters that you specify in an associative array :

  1. destination parameters specify gliding destination.  Only one non-optional destination parameter should be specified. 
  2. animation parameters specify how the gliding will be animated.  Optional. 
  3. callback parameter specifies a callback function to be run after gliding ends.  Optional. 

1.  Destination parameters

  • For GlideEyeTo & GlideTargetTo
    Either eyeParams or one of position, orientation, or targetDistance must be specified.
eyeParamsspecifies the destination parameters as an EyeParams object.
Optional.  If not specified, one of position, orientation, or targetDistance must be specified.
positionthe position of the Eye (in the case of GlideEyeTo ) or the target (in the case of GlideTargetTo ) when the glide finishes.
Optional.  If not specified, the current position is used.
orientationthe orientation of the Eye when the glide finishes.
Optional.  If not specified, the current orientation is used.
targetDistancethe distance (in meters) between the Eye and the target (the point the Eye looks at) when the glide ends.
Optional.  If not specified, the current target distance is used.
  • For GlideEyeToFit
    One of placemark, building, block, or level must be specified.
placemarkthe placemark to fit the Eye .  Can be a handle string or a Placemark object.
buildingthe building to fit the Eye .  Can be a handle string or a Building object.
blockthe block to fit the Eye .  Can be a handle string or a Block object.
levelthe level to fit the Eye .  Can be a handle string or a Level object.
orientationthe orientation of the Eye when the glide finishes.
Optional.  If not specified, the current orientation is used.

2.  Animation parameters

useEaseInif true, the glide animation accelerates from rest at the start.
Default: true.
useEaseOutif true, the glide animation decelerates to rest at the end.
Default: true.
useParabolaif true, the glide animation will move in a vertical parabola from start to end; if false, the glide animation will move in a straight line.
Default: true.
durationduration for the glide animation in seconds.  If 0 or less, will automatically calculate the duration based on how far the glide has to travel and how much it has to rotate.
Default: 0.
speedMultiplieradjusts the automatic duration calculation; higher numbers make the glide animation go faster.  Only applicable if duration is not set (0 or less).  Clamped to [0.001, 1000.0].
Default: 1.0.
userCancellableif true, the user can press Escape to cancel the glide, which will cause OnGlideCancelled Event to be raised.
Default: true.

3.  Callback parameter

endCallbackthe callback function to be called when the glide has just ended.  This function should expect a boolean value.  If the glide is completed (i.e.  Eye is at the glide destination), the value is true; otherwise (for example, if the end-user cancels the glide by pressing Esc key), the value is false.

Examples

We can specify position & orientation as [x, y, z] arrays as follows.

germ.GetEye().GlideEyeTo({
    position: [-50, 15, 25]
    ,orientation: [Germanium.DegreeToRadian(-20), Germanium.DegreeToRadian(-60), 0]
    ,targetDistance: 55
    });

Alternatively, we can specify position & orientation as a Coordinates and an EulerAngle .  Assuming we store the GermaniumWeb object in the variable germ, we write as follows.

germ.GetEye().GlideEyeTo({
    position: germ.CreateCoordinates(-50, 15, 25)
    ,orientation: germ.CreateEulerAngle(Germanium.DegreeToRadian(-20), Germanium.DegreeToRadian(-60), 0)
    ,targetDistance: 55
    });

Still another alternative is to specify all the parameters as an EyeParams .

germ.GetEye().GlideEyeTo({
    eyeParams: germ.CreateEyeParams(-50, 15, 25,
                    Germanium.DegreeToRadian(-20), Germanium.DegreeToRadian(-60), 0,
                    55)
    });

We specify a destination Building and the destination Eye orientation as follows.

// This function will be called when building is loaded successfully.
function loadOkCallback() {
    germ.GetEye().GlideEyeToFit({
        building: germ.GetBuildingByBBLId("GM")
        ,orientation: [Germanium.DegreeToRadian(-32.5), Germanium.DegreeToRadian(-30), 0]
    });
}
function loadFailedCallback() {
    alert("File loading failed.");
}
// Load a building.
var file = 'http://www.germanium3d.com/static/sample/generic_building/generic_building.xlcl';
germ.Load(file, null, loadOkCallback, loadFailedCallback);

Similarly, we specify a destination Placemark as follows.

// Create a placemark.
var goalPlacemark = germ.CreatePlacemark("This is our goal.");
germ.AddPlacemark(goalPlacemark);
// Glide to the placemark.
germ.GetEye().GlideEyeToFit({
        placemark: goalPlacemark
        ,orientation: [Germanium.DegreeToRadian(-32.5), Germanium.DegreeToRadian(-30), 0]
    });

We can specify the following animation parameters to glide the Eye move in a straight line with a constant speed.

var pos = germ.GetEye().GetPosition();
germ.GetEye().GlideEyeTo({
    position: [pos.x+100, pos.y, pos.z]
    ,useEaseIn: false
    ,useEaseOut: false
    ,useParabola: false
    ,duration: 1.2
    });

Finally, we specify a callback function as follows.

germ.GetEye().GlideEyeTo({
    position: germ.CreateCoordinates(-50, 15, 25)
    ,endCallback: function (bGlideCompleted) { alert("Was glide completed? "+bGlideCompleted); }
    });

You can try combining a number of examples above and experiment to understand how the glide parameters work.

Relevant functions

Gliding Eye functions

GlideEyeTo

GlideEyeTo : function (args)

Glides the Eye to the specified destination.  This function also accepts a callback function to be executed when the glide ends.

Parameter

{assocArray} argscontains parameters for gliding.  See Specifying glide parameters for further details.

args can contain the following keys :

positiondestination position of the Eye
orientationdestination orientation of the Eye
targetDistancedestination distance between the Eye and the target point
eyeParamsdestination EyeParams
useEaseInif true, the glide animation accelerates from rest at the start.  Default: true.
useEaseOutif true, the glide animation decelerates to rest at the end.  Default: true.
useParabolaif true, the glide animation will move in a vertical parabola from start to end; if false, the glide animation will move in a straight line.  Default: true.
durationduration for the glide animation in seconds.  If 0 or less, will automatically calculate the duration based on how far the glide has to travel and how much it has to rotate.  Default: 0.
speedMultiplieradjusts the automatic duration calculation; higher numbers make the glide animation go faster.  Only applicable if duration is not set (0 or less).  Clamped to [0.001, 1000.0].  Default: 1.0.
userCancellableif true, the user can press Escape to cancel the glide, which will cause GlideCancelledEvent to be raised.  Default: true.
endCallbackthe callback function to be called when the glide has just ended.  This function should expect a boolean value.  If the glide is completed (i.e.  Eye is at the glide destination), the value is true; otherwise, the value is false.

Returns

void

Examples

The following code glides the Eye to the coordinates (3, 4, 5) and specifies an anonymous function as a callback.

germ.GetEye().GlideEyeTo(
    {   position: [3, 4, 5],
        endCallback: function(bGlideCompleted) { alert("Was glide completed? " + bGlideCompleted); }
    });

The following code specifies glide destination as an EyeParams .

germ.GetEye().GlideEyeTo(
    {   eyeParams: germ.CreateEyeParams(),
        endCallback: function(bGlideCompleted) { alert("Was glide completed? " + bGlideCompleted); }
    });

Throws

See also

Since

Version 1.4.0.0

GlideEyeToPos

GlideEyeToPos : function (X,
y,
z)

Glides the Eye to the specified position.

Parameters

{mixed} XA Coordinates object / a float
{float} y(Optional)
{float} z(Optional)

Returns

void

Event

OnGlideStarted

Throws

Usage

GlideEyeToPos(X)Destination position is specified as a Coordinates .
GlideEyeToPos(X, y, z)Destination position is specified as a float triple.

See also

WebControl.CreateCoordinates

Since

Version 0.1.0.7

GlideEyeToPosOrt

GlideEyeToPosOrt : function (X,
Y,
z,
p,
q,
r)

Glides the Eye to the specified position and orientation.

Parameters

{mixed} XA Coordinates object / a float
{mixed} YAn EulerAngle object / a float
{float} z(Optional)
{float} p(Optional)
{float} q(Optional)
{float} r(Optional)

Returns

void

Event

  • OnGlideStarted

Throws

Usage

GlideEyeToPosOrt(X, Y)Destination position is specified as the Coordinates object X & orientation is specified as the EulerAngle object Y
GlideEyeToPosOrt(X, Y, z, p, q, r)Destination position is specified as the float triple (X, Y, z) & orientation is specified as the float triple (p, q, r)

See also

Since

Version 0.1.0.7

GlideEyeToEyeParams

GlideEyeToEyeParams : function (X,
Y,
z,
p,
q,
r,
d)

Glides the Eye to an fully specified EyeParams destination.

The position parameter is interpreted as the Eye’s position.  If it is more convenient to specify target position, you can call GlideTargetToEyeParams .

Parameters

{mixed} XAn EyeParams object / a Coordinates object / a float
{mixed} Y(Optional) An EulerAngle object / a float
{float} z(Optional)
{float} p(Optional)
{float} q(Optional)
{float} r(Optional)
{float} d(Optional)

Returns

void

Event

OnGlideStarted

Throws

Usage

GlideEyeToEyeParams(X)Destination is specified as the EyeParams object X.
GlideEyeToEyeParams(X, Y, z)Destination is specified as the triple (position, orientation, target distance), where position is the Coordinates object X, orientation is the EulerAngle object Y, and target distance is the float z.
GlideEyeToEyeParams(X, Y, z, p, q, r, d)Destination is specified as 7 floats (X, Y, z, p, q, r, d), where (X, Y, z) specifies position, (p, q, r) specifies orientation, and d specifies target distance.

See also

Since

Version 0.1.0.7

GlideEyeToFit

GlideEyeToFit : function (args)

Glides the Eye such that it can see the specified object.  You can specify a Placemark , a Building , a Block , or a Level using a JavaScript associative array.

You can specify only one object to fit.  If you specify more than one objects, the object is picked by the following precendence (highest precedence first):

  • placemark
  • building
  • block
  • level

If you specify an object as both a handle string and an Object, handle string has the higher precedence.

If you want to glide to a position that fits multiple objects, you call the following functions:

Parameter

{assocArray} argscontains parameters for gliding.  See Specifying glide parameters for further details.

args can contain the following parameters :

placemarkspecifies a placemark as a handle string or a Placemark object.
buildingspecifies a building as a handle string or a Building object.
blockspecifies a block as a handle string or a Block object.
levelspecifies a level as a handle string or a Level object.
orientationspecifies orientation as an EulerAngle object or as the array [x, y, z].
useEaseInif true, the glide animation accelerates from rest at the start.
Default: true.
useEaseOutif true, the glide animation decelerates to rest at the end.
Default: true.
useParabolaif true, the glide animation will move in a vertical parabola from start to end; if false, the glide animation will move in a straight line.
Default: true.
durationduration for the glide animation in seconds.  If 0 or less, will automatically calculate the duration based on how far the glide has to travel and how much it has to rotate.
Default: 0.
speedMultiplieradjusts the automatic duration calculation; higher numbers make the glide animation go faster.  Only applicable if duration is not set (0 or less).  Clamped to [0.001, 1000.0].
Default: 1.0.
userCancellableif true, the user can press Escape to cancel the glide, which will cause GlideCancelledEvent to be raised.
Default: true.
endCallbackspecifies a callback function to be called when the glide has just ended.  This function should expect a boolean value.  If the glide is completed (i.e.  Eye is at the glide destination), the value is true; otherwise, the value is false.

Returns

bool

Examples

The following code glides the Eye to a Placemark and specifies an anonymous function as a callback.

var destinationPlacemark = germ.CreatePlacemark("The destination");
germ.AddPlacemark(destinationPlacemark);
germ.GetEye().GlideEyeToFit(
    {   placemark: destinationPlacemark,
        endCallback: function(bGlideCompleted) { alert("Was glide completed? " + bGlideCompleted); }
    });

The following code loads a building file and then glides the Eye to a Block with a specified destination orientation.  It also specifies an anonymous function as a callback.

// This function will be called when building has been successfully loaded.
function loadOkCallback() {
    germ.GetEye().GlideEyeToFit(
        {   block: germ.GetBlockByBBLId("GM", "OFFICE"),
            orientation: [Germanium.DegreeToRadian(2.5), Germanium.DegreeToRadian(-60), 0],
            endCallback: function(bGlideCompleted) { alert("Was glide completed? " + bGlideCompleted); }
        });
}
function loadFailedCallback() {
    alert("File loading failed.");
}
// Load a building.
var file = 'http://www.germanium3d.com/static/sample/generic_building/generic_building.xlcl';
germ.Load(file, null, loadOkCallback, loadFailedCallback);

Throws

See also

Since

Version 1.4.0.0

Gliding target functions

GlideTargetTo

GlideTargetTo : function (args)

Glides target to the specified EyeParams , position, or orientation.  This function also accepts a callback function to be executed when the glide ends.

The target is the point the Eye looks at.

Parameter

{assocArray} argscontains parameters for gliding.  See Specifying glide parameters for further details.

args can contain the following keys :

positiondestination position of the target point
orientationdestination orientation of the Eye
targetDistancedestination distance between the Eye and the target point
eyeParamsdestination EyeParams
useEaseInif true, the glide animation accelerates from rest at the start.  Default: true.
useEaseOutif true, the glide animation decelerates to rest at the end.  Default: true.
useParabolaif true, the glide animation will move in a vertical parabola from start to end; if false, the glide animation will move in a straight line.  Default: true.
durationduration for the glide animation in seconds.  If 0 or less, will automatically calculate the duration based on how far the glide has to travel and how much it has to rotate.  Default: 0.
speedMultiplieradjusts the automatic duration calculation; higher numbers make the glide animation go faster.  Only applicable if duration is not set (0 or less).  Clamped to [0.001, 1000.0].  Default: 1.0.
userCancellableif true, the user can press Escape to cancel the glide, which will cause GlideCancelledEvent to be raised.  Default: true.
endCallbackthe callback function to be called when the glide has just ended.  This function should expect a boolean value.  If the glide is completed (i.e.  Eye is at the glide destination), the value is true; otherwise, the value is false.

Returns

void

Examples

The following code glides the target to the coordinates (5, 4, 3) and specifies an anonymous function as a callback.

germ.GetEye().GlideTargetTo(
    {   position: [5, 4, 3],
        endCallback: function(bGlideCompleted) { alert("Was glide completed? " + bGlideCompleted); }
    });

The following code specifies glide destination as an EyeParams .

germ.GetEye().GlideTargetTo(
    {   eyeParams: germ.CreateEyeParams(),
        endCallback: function(bGlideCompleted) { alert("Was glide completed? " + bGlideCompleted); }
    });

Throws

See also

Since

Version 1.4.0.0

GlideTargetToPos

GlideTargetToPos : function (X,
y,
z)

Glides target to the specified position.  The target is the point the Eye looks at.

Parameters

{mixed} XA Coordinates object / a float
{float} y(Optional)
{float} z(Optional)

Returns

void

Event

OnGlideStarted

Throws

Usage

GlideTargetToPos(X)Destination position is specified as the Coordinates object X.
GlideTargetToPos(X, y, z)Destination position is specified as the float triple (X, y, z).

See also

WebControl.CreateCoordinates

Since

Version 0.1.0.7

GlideTargetToPosOrt

GlideTargetToPosOrt : function (X,
Y,
z,
p,
q,
r)

Glides target to the specified position and orientation.  The target is the point the Eye looks at.

Parameters

{mixed} XA Coordinates object / a float
{mixed} YAn EulerAngle object / a float
{float} z(Optional)
{float} p(Optional)
{float} q(Optional)
{float} r(Optional)

Returns

void

Event

OnGlideStarted

Throws

Usage

GlideTargetToPosOrt(X, Y)Destination position is specified as the Coordinates object X & orientation is specified as the EulerAngle object Y.
GlideTargetToPosOrt(X, Y, z, p, q, r)Destination position is specified as the float triple (X, Y, z) & orientation is specified as the float triple (p, q, r).

See also

Since

Version 0.1.0.7

GlideTargetToEyeParams

GlideTargetToEyeParams : function (X,
Y,
z,
p,
q,
r,
d)

Glides target to a fully specified EyeParams destination.  The target is the point the Eye looks at.  The specified position is interpreted as the target position.

Parameters

{mixed} XAn EyeParams object / a Coordinates object / a float
{mixed} Y(Optional) An EulerAngle object / a float
{float} z(Optional)
{float} p(Optional)
{float} q(Optional)
{float} r(Optional)
{float} d(Optional)

Returns

void

Event

OnGlideStarted

Throws

Usage

GlideTargetToEyeParams(X)Destination is specified as the EyeParams object X.
GlideTargetToEyeParams(X, Y, z)Destination is specified as the triple (position, orientation, target distance), where position is the Coordinates object X, orientation is the EulerAngle object Y, and target distance is the float z.
GlideTargetToEyeParams(X, Y, z, p, q, r, d)Destination is specified as 7 floats (X, Y, z, p, q, r, d), where (x, y, z) specifies position, (p, q, r) specifies orientation, and d specifies target distance.

See also

Since

Version 0.1.0.7

Gliding to a BBL object

GlideEyeToVisibleBBL

GlideEyeToVisibleBBL : function ()

Glides the Eye such that it can see all visible BBL objects currently in the scene.

Returns

void

Event

OnGlideStarted

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.2.0.31

GlideEyeToBuilding

GlideEyeToBuilding : function (bldg)

Glides the Eye to the specified Building .

Parameter

{mixed} bldgA handle string or a Building

Returns

bool

Event

OnGlideStarted

Throws

Usage

GlideEyeToBuilding(string)Specify destination Building using its handle.
GlideEyeToBuilding(Building)Specify destination Building directly.

See also

Since

Version 0.1.0.10

GlideEyeToBuildingOrt

GlideEyeToBuildingOrt : function (bldg,
P,
q,
r)

Glides the Eye to the specified Building and orientation.

Parameters

{mixed} bldgA handle string or a Building
{mixed} PA float or a EulerAngle
{float} qOptional
{float} rOptional

Returns

bool

Event

OnGlideStarted

Throws

Usage

GlideEyeToBuildingOrt(string, EulerAngle)Specify destination Building using its handle; specify target orientation as a EulerAngle .
GlideEyeToBuildingOrt(string, float, float, float)Specify destination Building using its handle; specify target orientation as a float triple.
GlideEyeToBuildingOrt(Building, EulerAngle)Specify destination Building directly; specify target orientation as a EulerAngle .
GlideEyeToBuildingOrt(Building, float, float, float)Specify destination Building directly; specify target orientation as a float triple.

See also

Since

Version 0.1.0.10

GlideEyeToBlock

GlideEyeToBlock : function (block)

Glides the Eye to the specified Block .

Parameter

{mixed} blockA handle string or a Block

Returns

bool

Event

OnGlideStarted

Throws

Usage

GlideEyeToBlock(string)Specify destination Block using its handle.
GlideEyeToBlock(Block)Specify destination Block directly.

See also

Since

Version 0.1.0.10

GlideEyeToBlockOrt

GlideEyeToBlockOrt : function (block,
P,
q,
r)

Glides the Eye to the specified Block and orientation.

Parameters

{mixed} blockA handle string or a Block
{mixed} PA float or a EulerAngle
{float} qOptional
{float} rOptional

Returns

bool

Event

OnGlideStarted

Throws

Usage

GlideEyeToBlockOrt(string, EulerAngle)Specify destination Block using its handle; specify target orientation as a EulerAngle .
GlideEyeToBlockOrt(string, float, float, float)Specify destination Block using its handle; specify target orientation as a float triple.
GlideEyeToBlockOrt(Block, EulerAngle)Specify destination Block directly; specify target orientation as a EulerAngle .
GlideEyeToBlockOrt(Block, float, float, float)Specify destination Block directly; specify target orientation as a float triple.

See also

Since

Version 0.1.0.10

GlideEyeToLevel

GlideEyeToLevel : function (level)

Glides the Eye to the specified Level .

Parameter

{mixed} levelA handle string or a Level

Returns

bool

Event

OnGlideStarted

Throws

Usage

GlideEyeToLevel(string)Specify destination Level using its handle.
GlideEyeToLevel(Level)Specify destination Level directly.

See also

Since

Version 0.1.0.10

GlideEyeToLevelOrt

GlideEyeToLevelOrt : function (level,
P,
q,
r)

Glides the Eye to the specified Level and orientation.

Parameters

{mixed} levelA handle string or a Level
{mixed} PA float or a EulerAngle
{float} qOptional
{float} rOptional

Returns

bool

Event

OnGlideStarted

Throws

Usage

GlideEyeToLevelOrt(string, EulerAngle)Specify destination Level using its handle; specify target orientation as a EulerAngle .
GlideEyeToLevelOrt(string, float, float, float)Specify destination Level using its handle; specify target orientation as a float triple.
GlideEyeToLevelOrt(Level, EulerAngle)Specify destination Level directly; specify target orientation as a EulerAngle .
GlideEyeToLevelOrt(Level, float, float, float)Specify destination Level directly; specify target orientation as a float triple.

See also

Since

Version 0.1.0.10

Gliding to a VisualObject

GlideEyeToVisualObject

GlideEyeToVisualObject : function (visObj)

Glides the Eye to best fit the specified VisualObject .  The destination position is computed such that the Eye has the best fit of the input VisualObject .

Parameter

{mixed} visObjA handle string, a Placemark , or a VisualObject

Returns

void

Event

OnGlideStarted

Throws

Usage

GlideEyeToVisualObject(string)Specify destination VisualObject using its handle.
GlideEyeToVisualObject(VisualObject)Specify destination VisualObject directly.

See also

Since

Version 0.3.5.0

GlideEyeToVisualObjectOrt

GlideEyeToVisualObjectOrt : function (visObj,
P,
q,
r)

Glides the Eye to best fit the specified VisualObject using the specified orientation.  The destination position is computed such that the Eye has the best fit of the input VisualObject .

Parameters

{mixed} visObja string, a Placemark , or a VisualObject
{mixed} Pa float or an EulerAngle
{float} qoptional
{float} roptional

Returns

bool

Event

OnGlideStarted

Throws

See also

Since

Version 1.4.5.4

GlideTargetToVisualObject

GlideTargetToVisualObject : function(visObj)

Deprecated; use GlideEyeToVisualObject .  Glides target to the position of the specified VisualObject .  The target is the point the Eye looks at.

Parameter

{VisualObject} visObjthe VisualObject to which the target will glide

Returns

void

Event

OnGlideStarted

Throws

Since

Version 1.1.2.0

Deprecated in

Version 1.4.1.0

Gliding utility functions

IsGliding

IsGliding : function ()

Returns true if the Eye is currently gliding.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.3.5.0

CancelGlide

CancelGlide : function ()

Stops current Eye gliding, leaving the Eye at its current mid-glide position.  This function does not do anything if the Eye is not currently gliding.

Returns

void

Event

  • OnGlideCancelled
  • OnGlideEnded

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.1.0.23

FinishGlide

FinishGlide : function ()

Stops current Eye gliding, putting the Eye at the destination position of the glide.  This function does not do anything if the Eye is not currently gliding.

Returns

void

Event

  • OnGlideCompleted
  • OnGlideEnded

Throws

”uninitialized_plugin_object” Exception

Since

Version 0.1.0.23

First Person Navigation

Warning: Experimental feature.  These functions are likely to have breaking changes in future API releases.  If you use these functions, expect to have to modify your application at the next API release.

Puts the Eye at a fixed height and lets the user ‘walk around’ using the mouse and keyboard.  The W, A, S, D keys control motion while pressing the left mouse button and dragging looks around.  Hold down Shift to run.  Currently there is no collision detection, so the user can walk through walls.

Note that the end-user currently has no way of telling that he is in first-person navigation mode, and no way to exit it.  It is up to you to explain the mode to him, and to provide him with an exit method if you wish.

EnableFirstPersonNavigation

EnableFirstPersonNavigation : function ()

Deprecated; use WebControl.SetNavigationMode instead.  Puts the Eye into first-person navigation mode.  Note that

  • gliding, enabling rotation, or enabling orthographic projection will disable this mode.
  • this mode cannot be enabled when orthographic projection is enabled.
  • enabling this mode will cancel existing glides or rotations.

Returns true if successfully enabled.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.0

Deprecated in

Version 1.4.5.8

DisableFirstPersonNavigation

DisableFirstPersonNavigation : function ()

Deprecated; use WebControl.SetNavigationMode instead.  Disables first-person navigation mode.  The Eye ’s position is left unchanged.  Has no effect if not in first-person navigation mode.

Returns

void

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.0

Deprecated in

Version 1.4.5.8

IsFirstPersonNavigationEnabled

IsFirstPersonNavigationEnabled : function ()

Deprecated; use WebControl.IsInNavigationMode instead.  Returns true if navigation mode is FirstPerson.  See WebControl.Navigation Mode .

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.0

Deprecated in

Version 1.4.6.2

GetFirstPersonNavigationEnabled

GetFirstPersonNavigationEnabled : function ()

Deprecated; use WebControl.IsInNavigationMode instead.  Gets whether first-person navigation mode is enabled.

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.0

Deprecated in

Version 1.4.5.8

SetFirstPersonNavigationEnabled

SetFirstPersonNavigationEnabled : function (bVal)

Deprecated; use WebControl.SetNavigationMode instead.  Returns true if first-person navigation mode was successfully enabled or disabled.  For details, see EnableFirstPersonNavigation , DisableFirstPersonNavigation

Parameter

{bool} bValwhether or not to enable First Person Navigation

Returns

bool

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.0

Deprecated in

Version 1.4.5.8

GetFirstPersonEyeHeight

GetFirstPersonEyeHeight : function ()

Deprecated; use Options.GetFirstPersonEyeHeight instead.  Gets the distance from the user’s eye to the floor, in meters.

Returns

float

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.1

Deprecated in

Version 1.4.6.2

SetFirstPersonEyeHeight

SetFirstPersonEyeHeight : function (height)

Deprecated; use Options.SetFirstPersonEyeHeight instead.  Sets the distance from the user’s eye to the floor, in meters.

The default value is 1.5 meters.

Parameter

{float} heightvalue to set as eye height

Returns

void

Throws

Since

Version 1.3.15.1

Deprecated in

Version 1.4.6.2

GetFirstPersonFloorHeight

GetFirstPersonFloorHeight : function ()

Deprecated; use Options.GetFirstPersonFloorHeight instead.  Gets the distance from the user’s floor height (that is, his ‘feet’), to the ground.

Returns

float

Throws

”uninitialized_plugin_object” Exception

Since

Version 1.3.15.1

Deprecated in

Version 1.4.6.2

SetFirstPersonFloorHeight

SetFirstPersonFloorHeight : function (height)

Deprecated; use Options.SetFirstPersonFloorHeight instead.  Sets the distance from the user’s floor height (that is, his ‘feet’) to the ground.  Typically, this value is set to a Level ’s floor height.

The default value is 0 meter, which is on the ground.

Parameter

{float} heightvalue to set as floor height

Returns

void

Throws

Since

Version 1.3.15.1

Deprecated in

Version 1.4.6.2

3D utility functions

Concepts

  • Window refers to the plugin window.  The X- and Y-components of window coordinates specifies the location of the point on the plugin window.  The upper-left corner is (0, 0); units are pixels.  The Z-component of window coordinates is the distance of the point from the Eye in meters.
  • 3D or native space refers to the coordinates system used in the 3D scene; units are meters.

Compute3DIntersection

Compute3DIntersection : function (x,
y)

Computes the 3D coordinates that the specified window pixel intersects the scene with.  Returns null if the specified pixel does not intersect any scene object.

Parameters

{float} xhorizontal coordinate of the pixel
{float} yvertical coordinate of the pixel

Returns

Coordinates

Throws

Since

Version 0.2.0.30

Convert3DToWindow

Convert3DToWindow : function (in3DPos,
outWindowPos)

Converts a 3D position from 3D view coordinates to window coordinates.  Returns true if input position lies within the window.

Note

See explanation on 3D concepts in 3D utility functions .

Parameters

{Coordinates} in3DPos3D view Coordinates to be converted: x, y, z in meters.
{Coordinates} outWindowPosOutput window Coordinates : x, y in pixels; z in meters.  (x, y) is the 2D pixel coordinates on plugin rectangle. z is the distance between the Eye and the input point.

Returns

bool

Throws

Since

Version 0.2.0.29

ConvertWindowTo3D

ConvertWindowTo3D : function (inWindowPos,
out3DPos)

Converts a 3D position from window coordinates to 3D view coordinates.  Returns true if input position lies within the 3D view.

Note

See explanation on 3D concepts in 3D utility functions .

Parameters

{Coordinates} inWindowPosWindow Coordinates to be converted: x, y in pixels; z in meters.  (x, y) is the 2D pixel coordinates on plugin rectangle. z is the distance of input point from the Eye.
{Coordinates} out3DPosOutput 3D view Coordinates : x, y, z in meters.

Returns

bool

Throws

Since

Version 0.2.0.30

CanSeeVisualObject

CanSeeVisualObject : function (visualObj,
useBV)

Checks whether the specified VisualObject is in the current Eye view.  This function ignores :

Parameters

{mixed} visualObja Placemark or a VisualObject
{bool} useBVif true, the VisualObject ’ bounding volume is used to test.  If false, the VisualObject ’s exact geometry is used to test.  Using exact geometry is usually far slower than using bounding volume; but will give more accurate result.

Returns

booltrue if the VisualObject is in the current view

Throws

Since

Version 1.4.9.2

EyeParams

A container to store parameters of the Eye object.  This is useful if you want to save a view and load it later.

You should not instantiate the EyeParams class using the JavaScript keyword ‘new’.  Instead, use the function WebControl.CreateEyeParams .

Since

Version 0.0.10

See also

WebControl.CreateEyeParams

Related class

Eye

Summary
Position property
GetPosition Gets position parameter.
SetPosition Sets position parameter.
Orientation property
GetOrientation Gets orientation parameter.
SetOrientation Sets orientation parameter.
Target property
GetTargetDistance Gets target distance parameter.
SetTargetDistance Sets target distance parameter.
Utility functions
Set Sets position, orientation, and target distance parameters.
ToString Returns the string representation of this EyeParams .

Position property

GetPosition

GetPosition : function ()

Gets position parameter.

Returns

Coordinates

Since

Version 0.0.10

SetPosition

SetPosition : function (X,
y,
z)

Sets position parameter.

Parameters

{mixed} XA Coordinates or a float
{float} y(Optional)
{float} z(Optional)

Usage

SetPosition(X)Specify position as the Coordinates object X.
SetPosition(X, y, z)Specify position as the float triple (X, y, z).

Returns

void

Throws

”length_error” Exception

Since

Version 0.0.10

Orientation property

GetOrientation

GetOrientation : function ()

Gets orientation parameter.

Returns

EulerAngle

Since

Version 0.0.10

SetOrientation

SetOrientation : function (P,
q,
r)

Sets orientation parameter.

Parameters

{mixed} PAn EulerAngle object / a float
{float} q(Optional)
{float} r(Optional)

Usage

SetOrientation(P)Specify orientation as the EulerAngle object P.
SetOrientation(P, q, r)Specify orientation as the float triple (P, q, r).

Returns

void

Throws

”length_error” Exception

Since

Version 0.0.10

Target property

GetTargetDistance

GetTargetDistance : function ()

Gets target distance parameter.

Returns

float

Since

Version 0.0.10

SetTargetDistance

SetTargetDistance : function (tgtDist)

Sets target distance parameter.  Unit is meters.

Parameter

{float} tgtDist

Returns

void

Throws

”invalid_argument” Exception

Since

Version 0.0.10

Utility functions

Set

Set : function (X,
Y,
z,
p,
q,
r,
d)

Sets position, orientation, and target distance parameters.  To save the current view, use Eye.GetParams instead.

Parameters

{mixed} XAn EyeParams , a Coordinates , or a float
{mixed} YAn EulerAngle or a float
{float} zMandatory
{float} pOptional
{float} qOptional
{float} rOptional
{float} dOptional

Returns

void

Usage

Set(X)Specify position, orientation, and target distance as the EyeParams object X.
Set(X, Y, z)Specify position as the Coordinates object X, orientation as the EulerAngle object Y, and target distance as the float z.
Set(X, Y, z, p, q, r, d)Specify position as the float triple (X, Y, z), orientation as the float triple (p, q, r), and target distance as the float d.

Throws

Since

Version 0.0.10

See also

Eye.GetParams

ToString

ToString : function ()

Returns the string representation of this EyeParams .

Returns

string

Since

Version 0.1.0.2

GetPosition : function ()
Gets 3D position of the Eye.
Represents the eye through which we see the scene.
SetPosition : function (X,
y,
z)
Sets the position of the Eye.
GetOrientation : function ()
Gets orientation of the Eye.
SetOrientation : function (P,
q,
r)
Sets the orientation of the Eye.
GetParams : function ()
Saves Eye parameters to an EyeParams object.
A container to store parameters of the Eye object.
SetParams : function (X,
Y,
z,
p,
q,
r,
d)
Sets all parameters for the Eye.
GetTargetPosition : function ()
Gets the position of the target point.
SetTargetPosition : function (X,
y,
z)
Sets the position of the target point.
GetTargetDistance : function ()
Returns the distance between the Eye and the target.
SetTargetDistance : function (dist,
bMoveEye)
Sets the distance between the Eye and the target.
GetGridVisibility : function()
Deprecated; use Options.GetGridVisibility instead.
GetGridVisibility : function()
Gets the visibility of the grid.
SetGridVisibility : function(bVal)
Deprecated; use Options.SetGridVisibility instead.
SetGridVisibility : function(bVal)
Sets the visibility of the grid.
ShowGrid : function ()
Deprecated; use Options.SetGridVisibility instead.
HideGrid : function ()
Deprecated; use Options.SetGridVisibility instead.
GetOrthographicProjection : function ()
Gets whether orthographic projection is currently enabled.
SetOrthographicProjection : function (bVal)
Sets orthographic projection state to true or false.
GetHorizontalFieldOfView : function ()
Gets the angle of horizontal field of view of the Eye (in radians).
SetHorizontalFieldOfView : function (angle)
Sets the angle of horizontal field of view of the Eye (in radians).
GetVerticalFieldOfView : function ()
Gets the angle of the vertical field of view of the Eye (in radians).
SetVerticalFieldOfView : function (angle)
Sets the angle of vertical field of view of the Eye (in radians).
GetRotationState : function ()
Gets whether auto-rotation of the Eye around the scene is enabled.
SetRotationState : function (bVal)
Enable or disable auto-rotation of the Eye around the scene.
EnableRotation : function ()
Starts Eye auto-rotation around the scene.
DisableRotation : function ()
Stops Eye auto-rotation around the scene.
IsRotating : function ()
Returns true if Eye auto-rotation is currently enabled.
GlideEyeTo : function (args)
Glides the Eye to the specified destination.
GlideTargetTo : function (args)
Glides target to the specified EyeParams, position, or orientation.
GlideEyeToFit : function (args)
Glides the Eye such that it can see the specified object.
GlideEyeToPos : function (X,
y,
z)
Glides the Eye to the specified position.
GlideEyeToPosOrt : function (X,
Y,
z,
p,
q,
r)
Glides the Eye to the specified position and orientation.
GlideEyeToEyeParams : function (X,
Y,
z,
p,
q,
r,
d)
Glides the Eye to an fully specified EyeParams destination.
GlideTargetToPos : function (X,
y,
z)
Glides target to the specified position.
GlideTargetToPosOrt : function (X,
Y,
z,
p,
q,
r)
Glides target to the specified position and orientation.
GlideTargetToEyeParams : function (X,
Y,
z,
p,
q,
r,
d)
Glides target to a fully specified EyeParams destination.
GlideEyeToVisibleBBL : function ()
Glides the Eye such that it can see all visible BBL objects currently in the scene.
GlideEyeToBuilding : function (bldg)
Glides the Eye to the specified Building.
Represents a building (for example “Suntec City”).
GlideEyeToBuildingOrt : function (bldg,
P,
q,
r)
Glides the Eye to the specified Building and orientation.
GlideEyeToBlock : function (block)
Glides the Eye to the specified Block.
Represents a block or a wing (for example “Tower 1” in Suntec City).
GlideEyeToBlockOrt : function (block,
P,
q,
r)
Glides the Eye to the specified Block and orientation.
GlideEyeToLevel : function (level)
Glides the Eye to the specified Level.
Represents a level (for example “basement level” of Tower 1 in Suntec City).
GlideEyeToLevelOrt : function (level,
P,
q,
r)
Glides the Eye to the specified Level and orientation.
GlideEyeToVisualObject : function (visObj)
Glides the Eye to best fit the specified VisualObject.
An abstract class; base class for Placemark class.
GlideEyeToVisualObjectOrt : function (visObj,
P,
q,
r)
Glides the Eye to best fit the specified VisualObject using the specified orientation.
GlideTargetToVisualObject : function(visObj)
Deprecated; use GlideEyeToVisualObject.
IsGliding : function ()
Returns true if the Eye is currently gliding.
CancelGlide : function ()
Stops current Eye gliding, leaving the Eye at its current mid-glide position.
FinishGlide : function ()
Stops current Eye gliding, putting the Eye at the destination position of the glide.
EnableFirstPersonNavigation : function ()
Deprecated; use WebControl.SetNavigationMode instead.
this.SetNavigationMode = function (mode)
Sets the navigation mode.
DisableFirstPersonNavigation : function ()
Deprecated; use WebControl.SetNavigationMode instead.
IsFirstPersonNavigationEnabled : function ()
Deprecated; use WebControl.IsInNavigationMode instead.
this.IsInNavigationMode = function (inMode)
Queries if the specified navigation mode is currently enabled.
GetFirstPersonNavigationEnabled : function ()
Deprecated; use WebControl.IsInNavigationMode instead.
SetFirstPersonNavigationEnabled : function (bVal)
Deprecated; use WebControl.SetNavigationMode instead.
GetFirstPersonEyeHeight : function ()
Deprecated; use Options.GetFirstPersonEyeHeight instead.
GetFirstPersonEyeHeight : function ()
Gets the distance from the user’s eye to the floor.
SetFirstPersonEyeHeight : function (height)
Deprecated; use Options.SetFirstPersonEyeHeight instead.
SetFirstPersonEyeHeight : function (height)
Sets the distance from the user’s eye to the floor.
GetFirstPersonFloorHeight : function ()
Deprecated; use Options.GetFirstPersonFloorHeight instead.
GetFirstPersonFloorHeight : function ()
Gets the distance from the user’s floor height (that is, his ‘feet’) to the ground.
SetFirstPersonFloorHeight : function (height)
Deprecated; use Options.SetFirstPersonFloorHeight instead.
SetFirstPersonFloorHeight : function (height)
Sets the distance from the user’s floor height (that is, his ‘feet’) to the ground.
Compute3DIntersection : function (x,
y)
Computes the 3D coordinates that the specified window pixel intersects the scene with.
Convert3DToWindow : function (in3DPos,
outWindowPos)
Converts a 3D position from 3D view coordinates to window coordinates.
ConvertWindowTo3D : function (inWindowPos,
out3DPos)
Converts a 3D position from window coordinates to 3D view coordinates.
CanSeeVisualObject : function (visualObj,
useBV)
Checks whether the specified VisualObject is in the current Eye view.
GetPosition : function ()
Gets position parameter.
SetPosition : function (X,
y,
z)
Sets position parameter.
GetOrientation : function ()
Gets orientation parameter.
SetOrientation : function (P,
q,
r)
Sets orientation parameter.
GetTargetDistance : function ()
Gets target distance parameter.
SetTargetDistance : function (tgtDist)
Sets target distance parameter.
Set : function (X,
Y,
z,
p,
q,
r,
d)
Sets position, orientation, and target distance parameters.
ToString : function ()
Returns the string representation of this EyeParams.
this.GetEye = function ()
Gets the Eye through which we view the 3D scene.
Represents a point in 3D Cartesian space.
Contains information describing the cause of an error.
Contains the name and properties of an event that has occurred.
Represents an orientation in 3D space in the form of Euler angles.
Represents a position marker.
This section explains how you can pass parameters for gliding to the functions GlideEyeTo, GlideTargetTo, and GlideEyeToFit.
this.CreateCoordinates = function (x,
y,
z)
Creates a Coordinates (unit is meters).
this.CreateEulerAngle = function (tilt,
heading,
z)
Creates an EulerAngle (unit is radians).
this.CreateEyeParams = function (x,
y,
z,
p,
q,
r,
t)
Creates an EyeParams.
this.CreateEyeParamsToFitObjects = function (args)
Returns the EyeParams that best fits the input Coordinates, VisualObjects, and BBLObjects.
this.GetBuildingByHandle = function (strHandle)
Gets the Building in the scene with the specified handle.
this.GetBuildingByBBLId = function (strBBLId)
Gets the Building in the scene with the specified BBL ID.
this.GetBuildingByIndex = function (index)
Gets the Building in the scene with the specified index.
this.GetBlockByHandle = function (strHandle)
Gets the Block in the scene with the specified handle.
this.GetBlockByBBLId = function (strBldgBBLId,
strBlkBBLId)
Gets the respective Block with the matching building and block BBL IDs.
GetBlockByIndex : function (idx)
Returns the Block in this Building with the specified index.
this.GetLevelByHandle = function (strHandle)
Gets the Level in the scene with the specified handle.
this.GetLevelByBBLId = function (strBldgBBLId,
strBlkBBLId,
strLvlBBLId)
Gets the respective Level with the matching building, block and level BBL IDs.
GetLevelByIndex : function (idx)
Returns the Level in this Block with the specified index.
this.GetPlacemarkByHandle = function (handle)
Gets the Placemark in the scene with the specified handle.
this.GetPlacemarkByIndex = function (index)
Gets the Placemark in the scene with the specified index.
GetHandle : function ()
Gets the Handle of this Building.
GetHandle : function ()
Gets the Handle of this Block.
GetHandle : function ()
Gets the Handle of this Level.
GetHandle : function ()
Gets the Handle of this Placemark.
Represents a special plane that allows us to temporarily cut through the scene and see the cross section of the scene.