Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add getter and setter functions for scene aspectratio values
  • Loading branch information
archmoj committed Oct 23, 2019
commit 83e9c9406976e5ee92bf1f1851e4366e516c06f7
16 changes: 15 additions & 1 deletion scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,21 @@ function createScene(options) {
cameraParams: cameraParams,
oncontextloss: null,
mouseListener: null,
_stopped: false
_stopped: false,

getAspectratio: function() {
return {
x: this.aspect[0],
y: this.aspect[1],
z: this.aspect[2]
}
},

setAspectratio: function(aspectratio) {
this.aspect[0] = aspectratio.x
this.aspect[1] = aspectratio.y
this.aspect[2] = aspectratio.z
}
}

var pickShape = [ (gl.drawingBufferWidth/scene.pixelRatio)|0, (gl.drawingBufferHeight/scene.pixelRatio)|0 ]
Expand Down