Post

LoadSensor

Overview

LoadSensor generates events as watchList child nodes are either loaded or fail to load. Changing watchlist child nodes restarts the LoadSensor.

The LoadSensor node belongs to the Networking component and requires at least level 3, its default container field is children. It is available from X3D version 3.0 or higher.

Hierarchy

1
2
3
4
5
+ X3DNode
  + X3DChildNode
    + X3DSensorNode
      + X3DNetworkSensorNode
        + LoadSensor

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFString [in, out] description “”

Author-provided prose that describes intended purpose of the node.

Hint

  • Many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for “ quotation-mark character).

SFBool [in, out] enabled TRUE

Enables/disables node operation.

SFTime [in, out] timeOut 0 (0,∞)

Time in seconds of maximum load duration prior to declaring failure. Default value zero means use browser defaults.

SFBool [out] isActive

isActive true/false events are sent when sensing starts/stops.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFBool [out] isLoaded

Notify when all watchList child nodes are loaded, or at least one has failed. Sends true on successfully loading all watchList child nodes. Sends false on timeOut of any watchList child nodes, failure of any watchList child nodes to load, or no local copies available and no network present.

Hint

  • Use multiple LoadSensor nodes to track multiple loading nodes individually.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFFloat [out] progress

Sends 0.0 on start and 1.0 on completion. Intermediate values are browser dependent and always increasing (may indicate fraction of bytes, fraction of expected time or another metric).

Hint

  • Only 0 and 1 events are guaranteed.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

SFTime [out] loadTime

Time of successful load complete, not sent on failure.

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

MFNode [in, out] children [ ] [X3DUrlObject]

The children field monitors one or more USE nodes that contain a valid url field.

Hints

  • If watchList contains multiple USE nodes, output events are only generated when all children have loaded successfully or at least one node has failed.
  • If individual load status information is desired for different nodes, multiple LoadSensor nodes may be used, each with a single watchList element.
  • Anchor nodes can be monitored for binding a target Viewpoint, loading a new scene, or loading a new scene in a new window.

Warning

Advice

Hints

Warnings

Example

See Also

This post is licensed under CC BY 4.0 by the author.