当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Vector2.set方法代码示例

本文整理汇总了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 );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例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();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:28,代码来源:three.orbitcontrols.ts

示例3: handleTouchStartPan

	function handleTouchStartPan( event ) {

		//console.log( 'handleTouchStartPan' );

		panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例4: handleTouchStartRotate

	function handleTouchStartRotate( event ) {

		//console.log( 'handleTouchStartRotate' );

		rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例5: handleMouseDownDolly

	function handleMouseDownDolly( event ) {

		//console.log( 'handleMouseDownDolly' );

		dollyStart.set( event.clientX, event.clientY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例6: handleMouseDownRotate

	function handleMouseDownRotate( event ) {

		//console.log( 'handleMouseDownRotate' );

		rotateStart.set( event.clientX, event.clientY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例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 );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:12,代码来源:three.orbitcontrols.ts

示例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();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:15,代码来源:three.orbitcontrols.ts

示例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();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:15,代码来源:three.orbitcontrols.ts

示例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
    }
  })
}
开发者ID:arose,项目名称:ngl,代码行数:48,代码来源:viewer-utils.ts


注:本文中的THREE.Vector2.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。