Class Index | File Index

Classes


Class ModelPreviewComponent


Defined in: ModelPreviewComponent.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ModelPreviewComponent(canvasId, pitchAndScaleChangeSupported)
Creates a model preview component.
Method Summary
Method Attributes Method Name and Description
 
Stops rotation animation and clears buffers used by its canvas.
 
Removes listeners bound to global objects and clears this component.
 
setModel(content, modelRotation, onerror, onprogression)
Loads and displays the given 3D model.
 
startRotationAnimation(roundsPerMinute)
Starts rotation animation.
 
Stops the running rotation animation.
Class Detail
ModelPreviewComponent(canvasId, pitchAndScaleChangeSupported)
Creates a model preview component.
Author: Emmanuel Puybaret.
Parameters:
{string} canvasId
the ID of the 3D canvas where a model will be viewed
{boolean} pitchAndScaleChangeSupported
if true the component will handles events to let the user rotate the displayed model
Method Detail
clear()
Stops rotation animation and clears buffers used by its canvas.

dispose()
Removes listeners bound to global objects and clears this component. This method should be called to free resources in the browser when this component is not needed anymore.

setModel(content, modelRotation, onerror, onprogression)
Loads and displays the given 3D model.
Parameters:
{URLContent} content
a content with a URL pointing to a 3D model to parse and view
{Array} modelRotation
a 3x3 array describing how to transform the 3D model
onerror
callback called in case of error while reading the model
onprogression
callback to follow the reading of the model

startRotationAnimation(roundsPerMinute)
Starts rotation animation.
Parameters:
{number} roundsPerMinute Optional
the rotation speed in rounds per minute, 5rpm if missing

stopRotationAnimation()
Stops the running rotation animation.

© Copyrights 2017 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 25 2017 16:36:09 GMT+0200 (CEST)