A reference to the current renderer
A reference to the current scenevis
A reference to the current camera
snippet time
Actively tracked InteractionData
Registers all the DOM events
Should default browser actions automatically be prevented. Does not apply to pointer events for backwards compatibility preventDefault on pointer events stops mouse events from firing Thus, for every pointer event, there will always be either a mouse of touch event alongside it.
The renderer this interaction manager works for.
Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData
The mode of the cursor that is being used. The value of this is a key from the cursorStyles dictionary.
Internal cached let.
Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor values, objects are handled as dictionaries of CSS values for interactionDOMElement, and functions are called instead of changing the CSS. Default CSS cursor values are provided for 'default' and 'pointer' modes.
An event data object to handle all the event tracking/dispatching
Have events been attached to the dom element?
Get InteractionData for a given pointerId. Store that data as well
The DOM element to bind to.
Pool of unused InteractionData
Frequency in milliseconds that the mousemove, moveover & mouseout interaction events will be checked.
The mouse data
Is the mouse hovering over the renderer?
This property determines if mousemove and touchmove events are fired only when the cursor is over the object. Setting to true will make things work more in line with how the DOM verison works. Setting to false can make things easier for things like dragging It is currently set to false as this is how three.js used to work.
Ensures that the original event object contains all data that a regular pointer event would have
Is called when the click is pressed down on the renderer element
Is called when the pointer button is cancelled
Is called when the pointer button is released on the renderer element
Is called when the pointer button is pressed down on the renderer element
Is called when the pointer moves across the renderer element
Is called when the pointer is moved out of the renderer element
Is called when the pointer is moved into the renderer element
Is called when the pointer button is released on the renderer element
Processes the result of the click check and dispatches the event if need be
This function is provides a neat way of crawling through the scenevis graph and running a specified function on all interactive objects it finds. It will also take care of hit testing the interactive objects and passes the hit across in the function.
Processes the result of the pointer cancel check and dispatches the event if need be
Processes the result of the pointer down check and dispatches the event if need be
Processes the result of the pointer move check and dispatches the event if need be
Processes the result of the pointer over/out check and dispatches the event if need be
Processes the result of the pointer up check and dispatches the event if need be
ray caster, for survey intersects from 3d-scenevis
Return unused InteractionData to the pool, for a given pointerId
Removes all the DOM events that were previously registered
The renderer this interaction manager works for.
The renderer this interaction manager works for.
Does the device support pointer events https://www.w3.org/Submission/pointer-events/
Does the device support touch events https://www.w3.org/TR/touch-events/
Dispatches an event on the display object that was interacted with
Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Destroys the interaction manager
Fire an event type.
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Hit tests a point against the display tree, returning the first interactive object that is hit.
A point to hit test with, in global space.
The hit display object, if any.
Maps x and y coords from a DOM object and maps them correctly to the three.js view. The resulting value is stored in the point. This takes into account the fact that the DOM element could be scaled and positioned anywhere on the screen.
the point that the result will be stored in
the x coord of the position to map
the y coord of the position to map
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
Sets the current cursor mode, handling any callbacks or CSS style changes.
cursor mode, a key from the cursorStyles dictionary
set objects to raycast
Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM elements on top of the renderers Canvas element. With this you'll be bale to deletegate another DOM element to receive those events.
the DOM element which will receive mouse and touch events.
Updates the state of interactive objects. Invoked by a throttled ticker.
Generated using TypeDoc
The interaction manager deals with mouse, touch and pointer events. Any DisplayObject can be interactive if its interactive parameter is set to true This manager also supports multitouch.
reference to pixi.js impl