Namespace: streamer

syngen.streamer

Provides a helper for conserving resources by only streaming eligible props. Systems can register and deregister props for streaming. Props are dynamically instantiated and destroyed based on their eligibility. Eligibility is determined by a configurable maximum distance from the observer, sorting, and limits.

Source:

Methods

(static) deregisterProp(token)

Deregisters the streamed prop with token. Beware that it isn't destroyed.

Parameters:
Name Type Description
token String
Source:

(static) destroyStreamedProp(token)

Destroys the streamed prop with token. Beware that it isn't deregistered.

Parameters:
Name Type Description
token String
Source:

(static) getLimit() → {Number|Infinity}

Returns the streaming prop limit, if any.

Source:
Returns:
Type
Number | Infinity

(static) getRadius() → {Number|Infinity}

Returns the streaming radius, if any.

Source:
Returns:
Type
Number | Infinity

(static) getRegisteredProp(token) → {Object|undefined}

Returns the definition for the prop registered with token, if one exists.

Parameters:
Name Type Description
token String
Source:
Returns:
Type
Object | undefined

(static) getRegisteredProps() → {Array.<Object>}

Returns the definitions for all registered props.

Source:
Returns:
Type
Array.<Object>

(static) getStreamedProp(token) → {syngen.prop.base|undefined}

Returns the prop with token, if one is streaming.

Parameters:
Name Type Description
token String
Source:
Returns:
Type
syngen.prop.base | undefined

(static) getStreamedProps() → {Array.<engine.prop.base>}

Returns all streaming props.

Source:
Returns:
Type
Array.<engine.prop.base>

(static) hasRegisteredProp(token) → {Boolean}

Returns whether a prop is registered for token.

Parameters:
Name Type Description
token String
Source:
Returns:
Type
Boolean

(static) hasStreamedProp(token) → {Boolean}

Returns whether a prop is streaming with token.

Parameters:
Name Type Description
token String
Source:
Returns:
Type
Boolean

(static) registerProp(prototype, optionsopt) → {String}

Registers a prop with prototype and options and returns its token.

Parameters:
Name Type Attributes Description
prototype engine.prop.base
options Object <optional>
Source:
Returns:
Type
String

(static) reset()

Clears and destroys all registered and streaming props.

Source:
Listens to Events:

(static) setLimit(value)

Sets the streaming prop limit.

Parameters:
Name Type Description
value Number
Source:

(static) setRadius(value)

Sets the streaming radius.

Parameters:
Name Type Description
value Number
Source:

(static) setSort(value)

Sets the sorting method.

Parameters:
Name Type Description
value function
Source:

(static) update(forceopt)

Updates the streamed props with respect to the observer's coordinates.

Parameters:
Name Type Attributes Default Description
force Boolean <optional>
false
Source:
Listens to Events:

(static) updateRegisteredProp(token, optionsopt)

Updates the options for the prop registered with token. To change its prototype, its token must be deregistered.

Parameters:
Name Type Attributes Description
token String
options Object <optional>
Source: