Skip to content

Commit

Permalink
Pasted touch event handling from old viewlet.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdyk committed Jun 11, 2014
1 parent d5a390f commit 6bab9a1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions js/shared/DSRV.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,40 @@ DSRV.prototype = {
this.m_manipulator.setStateNone( x, y );
//this.pushMatrices();
},

touchStartEvent: function (event)
{
if( event.touches.length == 1 ) {
event.button = this.ROTATE;
this.mousePressEvent(event);
}
else if( event.touches.length == 2 ) {
event.button = this.ZOOM;
this.mousePressEvent(event);
}
},
touchEndEvent: function (event)
{
if( event.touches.length == 1 ) {
event.button = this.ROTATE;
this.mouseReleaseEvent(event);
}
else if( event.touches.length == 2 ) {
event.button = this.ZOOM;
this.mouseReleaseEvent(event);
}
},
touchMoveEvent: function (event)
{
if( event.touches.length == 1 ) {
event.button = this.ROTATE;
this.mouseMoveEvent(event);
}
else if(event.touches.length == 2) {
event.button = this.ZOOM;
this.mouseMoveEvent(event);
}
},
pushMatrices: function() {
var viewer = this.m_model.getElementValue( this.m_key );
viewer.updateElement( "modelview", this.m_manipulator.modelviewMatrix() );
Expand Down

0 comments on commit 6bab9a1

Please sign in to comment.