Constructor
new core/PointOfInterestFeature(host, optionsopt, targetopt, lookOptionsopt, blinkOptionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
host |
core/HostObject | Host that owns the feature. |
|||||||||||||||||||||
options |
Object |
<optional> |
Options for the feature. |
||||||||||||||||||||
target |
Object |
<optional> |
3D transformation node that the host should try to |
||||||||||||||||||||
options.lookTracker |
Object | 3D transformation node that represents |
|||||||||||||||||||||
options.scene |
Object |
<optional> |
Engine-specific scene object that contains |
||||||||||||||||||||
lookOptions |
Object |
<optional> |
Options for the look animation layers. Properties
|
||||||||||||||||||||
blinkOptions |
Object |
<optional> |
Options for the blink animation layers. Properties
|
Extends
Members
(readonly) host
Gets the host that manages the feature.
- Overrides:
(readonly) owner
Gets the engine owner object of the host.
- Overrides:
target :Object|null
Gets and sets the target object the host should look at.
Type:
- Object | null
Methods
(static) _sphericalToBlendValue(theta, phi) → {Object}
Calculate horizontal and vertical look angles in degrees given spherical theta
and phi angles in radians.
Parameters:
Name | Type | Description |
---|---|---|
theta |
number | Vertical/polar angle in radians where 0 points directly |
phi |
number | Horizontal/azimuthal angle in radians. |
Returns:
- An object with the signature {h: number, v: number} where
h represents horizontal rotation in degrees and v represents vertical rotation
in degrees.
- Type
- Object
discard()
Clean up once the feature is no longer in use. Remove the feature namespace
from the host and remove reference to the host.
- Overrides:
- Implements:
emit(message, valueopt)
Emit feature messages from the host. Feature messages will be prefixed with
the class name of the feature.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message to emit. |
|
value |
any |
<optional> |
Optional parameter to pass to listener callbacks. |
- Overrides:
installApi()
Adds a namespace to the host with the name of the feature to contain properties
and methods from the feature that users of the host need access to.
- Overrides:
listenTo(message, callback)
Listen to a feature message from the host object.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | Message to listen for. |
callback |
function | The callback to execute when the message is received. |
- Overrides:
registerBlinkLayer(layerName, optionsopt)
Start keeping track of an animation layer that owns a blink animation. Blink
animations can be of any type, but if it is of type randomAnimation then a
it will be randomized each time a blink is called.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
layerName |
string | Name of the layer to keep track of. |
|||||||||||||||||||||
options |
Object |
<optional> |
Options for the layer. Properties
|
registerLookLayer(layerName, optionsopt)
Start keeping track of an animation layer that owns a blend2d animation with
blendWeights corresponding to horizontal and vertical look angles.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
layerName |
string | Name of the layer to keep track of. |
|||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Options for the layer. Properties
|
setTarget(target)
Sets a new target to look at.
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | null | The new target to look at. |
setTargetById(target)
Finds an object given its id and sets it as the new target to look at.
Should be overloaded for each rendering engine implementation.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | number | Id to search for. |
setTargetByName(target)
Finds an object given its name and sets it as the new target to look at.
Should be overloaded for each rendering engine implementation.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | Name to search for. |
stopListening(message, callbackopt)
Stop listening to a message from the host object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | Message to stop listening for. |
|
callback |
function |
<optional> |
Optional callback to remove. If none is defined, |
- Overrides:
stopListeningByRegexp(regexp, callbackopt)
Stop listening to a message matching the given regular expression from the
host object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
regexp |
Regexp | The regular expression to stop listening for. |
|
callback |
function |
<optional> |
Optional callback to remove. If none is defined, |
- Overrides:
stopListeningToAll()
Stop listening to all messages.
- Overrides:
update(deltaTime)
Executes each time the host is updated.
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | Amount of time since the last host update was |
- Overrides: