marble3 / LookAtCursor
Class: LookAtCursor
Defined in: src/cursor/look-at-cursor.ts:32
The interaction cursor: a ring in the middle of the screen that focuses the Interactable the camera looks at and selects it on a left click. Add it to the FPS.
Focus goes to the nearest body on the ray, so a wall or the terrain in front of an entity blocks it. The ring also aims at the choices of a SpeechBubble and a click picks the one under it. A click on the canvas with nothing focused locks the pointer.
Extends
Constructors
Constructor
new LookAtCursor(
player):LookAtCursor
Defined in: src/cursor/look-at-cursor.ts:42
Parameters
player
Returns
LookAtCursor
Overrides
Properties
disposed
protecteddisposed:boolean=false
Defined in: src/entity/graphic.ts:19
Inherited from
id
id:
string
Defined in: src/entity/graphic.ts:16
Unique per entity. Keys FPS.entities, and is stamped on collision shapes so a ray or contact hit resolves back to its entity.
Inherited from
three
three:
Group
Defined in: src/entity/graphic.ts:18
The entity's node in the scene; FPS.add() puts it there. Add your meshes under it.
Inherited from
Methods
dispose()
dispose():
void
Defined in: src/cursor/look-at-cursor.ts:49
Frees the geometry and instance buffers under three and takes it out of the scene. Idempotent. Materials and textures are not freed, since they are often shared: dispose your own. A subclass frees what else it owns, then calls super.dispose().
Returns
void
Overrides
setActive()
setActive(
on):void
Defined in: src/cursor/look-at-cursor.ts:56
Turns the cursor on or off. Off hides the ring, leaves the focused entity and ignores clicks.
Parameters
on
boolean
Returns
void
triggerInteract()
triggerInteract():
void
Defined in: src/cursor/look-at-cursor.ts:116
Selects the focused entity, as a click on it would.
Returns
void
update()
update(
_delta,engine?):void
Defined in: src/cursor/look-at-cursor.ts:70
Called every frame the world is not paused, with the seconds since the last frame and the FPS the entity lives in (for its world and entities).
Parameters
_delta
number
engine?
Returns
void