本文整理汇总了TypeScript中THREE.Vector2.set方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Vector2.set方法的具体用法?TypeScript Vector2.set怎么用?TypeScript Vector2.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THREE.Vector2
的用法示例。
在下文中一共展示了Vector2.set方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: handleMouseDownPan
function handleMouseDownPan( event ) {
//console.log( 'handleMouseDownPan' );
panStart.set( event.clientX, event.clientY );
}
示例2: handleTouchMoveDolly
function handleTouchMoveDolly( event ) {
//console.log( 'handleTouchMoveDolly' );
var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
var distance = Math.sqrt( dx * dx + dy * dy );
dollyEnd.set( 0, distance );
dollyDelta.subVectors( dollyEnd, dollyStart );
if ( dollyDelta.y > 0 ) {
dollyOut( getZoomScale() );
} else if ( dollyDelta.y < 0 ) {
dollyIn( getZoomScale() );
}
dollyStart.copy( dollyEnd );
scope.update();
}
示例3: handleTouchStartPan
function handleTouchStartPan( event ) {
//console.log( 'handleTouchStartPan' );
panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
}
示例4: handleTouchStartRotate
function handleTouchStartRotate( event ) {
//console.log( 'handleTouchStartRotate' );
rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
}
示例5: handleMouseDownDolly
function handleMouseDownDolly( event ) {
//console.log( 'handleMouseDownDolly' );
dollyStart.set( event.clientX, event.clientY );
}
示例6: handleMouseDownRotate
function handleMouseDownRotate( event ) {
//console.log( 'handleMouseDownRotate' );
rotateStart.set( event.clientX, event.clientY );
}
示例7: handleTouchStartDolly
function handleTouchStartDolly( event ) {
//console.log( 'handleTouchStartDolly' );
var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
var distance = Math.sqrt( dx * dx + dy * dy );
dollyStart.set( 0, distance );
}
示例8: handleTouchMovePan
function handleTouchMovePan( event ) {
//console.log( 'handleTouchMovePan' );
panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
panDelta.subVectors( panEnd, panStart );
pan( panDelta.x, panDelta.y );
panStart.copy( panEnd );
scope.update();
}
示例9: handleMouseMovePan
function handleMouseMovePan( event ) {
//console.log( 'handleMouseMovePan' );
panEnd.set( event.clientX, event.clientY );
panDelta.subVectors( panEnd, panStart );
pan( panDelta.x, panDelta.y );
panStart.copy( panEnd );
scope.update();
}
示例10: updateMaterialUniforms
export function updateMaterialUniforms (group: Object3D, camera: Camera, renderer: WebGLRenderer, cDist: number, bRadius: number) {
const {width, height} = renderer.getSize()
const canvasHeight = height
const pixelRatio = renderer.getPixelRatio()
const ortho = camera.type === 'OrthographicCamera'
resolution.set(width, height)
projectionMatrixInverse.getInverse(camera.projectionMatrix)
projectionMatrixTranspose.copy(camera.projectionMatrix).transpose()
group.traverse(function (o: any) {
const m = o.material
if (!m) return
const u = m.uniforms
if (!u) return
if (m.clipNear) {
const nearFactor = (50 - m.clipNear) / 50
const nearClip = cDist - (bRadius * nearFactor)
u.clipNear.value = nearClip
}
if (u.canvasHeight) {
u.canvasHeight.value = canvasHeight
}
if (u.resolution) {
u.resolution.value.copy(resolution)
}
if (u.pixelRatio) {
u.pixelRatio.value = pixelRatio
}
if (u.projectionMatrixInverse) {
u.projectionMatrixInverse.value.copy(projectionMatrixInverse)
}
if (u.projectionMatrixTranspose) {
u.projectionMatrixTranspose.value.copy(projectionMatrixTranspose)
}
if (u.ortho) {
u.ortho.value = ortho
}
})
}