-
Notifications
You must be signed in to change notification settings - Fork 0
X3DCanvas.js
handles canvas, drawing
redefines canvasEle.setAttribute to transmit width/height changes to x3d viewarea and trigger redraw
in case of flash backend request, 'canvas' becomes flash object creates HTML webgl canvas as .canvas and inits webgl context as .gl
disable default right click ('contextmenu') to allow for navigation
adds mouse and key event listeners to canvas, which call x3dElement.doc.onevent handlers similar for mobile touch events, plus cool touch visualization
createHTMLCanvas: creates canvas element transfer onevent attributes from x3d element to created canvas element same for event listeners added by .addEventListener transfer id attribute to new canvas element as well
.tick function which is called for every frame requested: call .doc.advanceTime for Routes calls user enterframe renders document user exitframe function
.load: called from Main.js creates X3DDocument and attached to x3dcanvas as .doc launches RAF main loop which calls .tick loads X3DDocument .doc.load