super-three
Advanced tools
Comparing version 0.102.1 to 0.102.2
@@ -1363,2 +1363,4 @@ /** | ||
if ( primitive.indices === null ) delete primitive.indices; | ||
} | ||
@@ -1365,0 +1367,0 @@ |
{ | ||
"name": "super-three", | ||
"version": "0.102.1", | ||
"version": "0.102.2", | ||
"description": "JavaScript 3D library", | ||
@@ -5,0 +5,0 @@ "main": "build/three.js", |
@@ -129,2 +129,6 @@ import { Vector3 } from '../math/Vector3.js'; | ||
var morphA = new Vector3(); | ||
var morphB = new Vector3(); | ||
var morphC = new Vector3(); | ||
var uvA = new Vector2(); | ||
@@ -168,3 +172,3 @@ var uvB = new Vector2(); | ||
function checkBufferGeometryIntersection( object, material, raycaster, ray, position, uv, a, b, c ) { | ||
function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, uv, a, b, c ) { | ||
@@ -175,2 +179,33 @@ vA.fromBufferAttribute( position, a ); | ||
var morphInfluences = object.morphTargetInfluences; | ||
if ( material.morphTargets && morphPosition && morphInfluences ) { | ||
morphA.set( 0, 0, 0 ); | ||
morphB.set( 0, 0, 0 ); | ||
morphC.set( 0, 0, 0 ); | ||
for ( var i = 0, il = morphPosition.length; i < il; i ++ ) { | ||
var influence = morphInfluences[ i ]; | ||
var morphAttribute = morphPosition[ i ]; | ||
if ( influence === 0 ) continue; | ||
tempA.fromBufferAttribute( morphAttribute, a ); | ||
tempB.fromBufferAttribute( morphAttribute, b ); | ||
tempC.fromBufferAttribute( morphAttribute, c ); | ||
morphA.addScaledVector( tempA.sub( vA ), influence ); | ||
morphB.addScaledVector( tempB.sub( vB ), influence ); | ||
morphC.addScaledVector( tempC.sub( vC ), influence ); | ||
} | ||
vA.add( morphA ); | ||
vB.add( morphB ); | ||
vC.add( morphC ); | ||
} | ||
var intersection = checkIntersection( object, material, raycaster, ray, vA, vB, vC, intersectionPoint ); | ||
@@ -238,2 +273,3 @@ | ||
var position = geometry.attributes.position; | ||
var morphPosition = geometry.morphAttributes.position; | ||
var uv = geometry.attributes.uv; | ||
@@ -266,3 +302,3 @@ var groups = geometry.groups; | ||
intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, uv, a, b, c ); | ||
intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, a, b, c ); | ||
@@ -292,3 +328,3 @@ if ( intersection ) { | ||
intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, uv, a, b, c ); | ||
intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, a, b, c ); | ||
@@ -326,3 +362,3 @@ if ( intersection ) { | ||
intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, uv, a, b, c ); | ||
intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, ray, position, morphPosition, uv, a, b, c ); | ||
@@ -352,3 +388,3 @@ if ( intersection ) { | ||
intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, uv, a, b, c ); | ||
intersection = checkBufferGeometryIntersection( this, material, raycaster, ray, position, morphPosition, uv, a, b, c ); | ||
@@ -391,35 +427,2 @@ if ( intersection ) { | ||
if ( faceMaterial.morphTargets === true ) { | ||
var morphTargets = geometry.morphTargets; | ||
var morphInfluences = this.morphTargetInfluences; | ||
vA.set( 0, 0, 0 ); | ||
vB.set( 0, 0, 0 ); | ||
vC.set( 0, 0, 0 ); | ||
for ( var t = 0, tl = morphTargets.length; t < tl; t ++ ) { | ||
var influence = morphInfluences[ t ]; | ||
if ( influence === 0 ) continue; | ||
var targets = morphTargets[ t ].vertices; | ||
vA.addScaledVector( tempA.subVectors( targets[ face.a ], fvA ), influence ); | ||
vB.addScaledVector( tempB.subVectors( targets[ face.b ], fvB ), influence ); | ||
vC.addScaledVector( tempC.subVectors( targets[ face.c ], fvC ), influence ); | ||
} | ||
vA.add( fvA ); | ||
vB.add( fvB ); | ||
vC.add( fvC ); | ||
fvA = vA; | ||
fvB = vB; | ||
fvC = vC; | ||
} | ||
intersection = checkIntersection( this, faceMaterial, raycaster, ray, fvA, fvB, fvC, intersectionPoint ); | ||
@@ -426,0 +429,0 @@ |
@@ -68,13 +68,6 @@ /** | ||
updateDrawingBufferSize(); | ||
if ( isPresenting() ) { | ||
var eyeParameters = device.getEyeParameters( 'left' ); | ||
var renderWidth = eyeParameters.renderWidth * framebufferScaleFactor; | ||
var renderHeight = eyeParameters.renderHeight * framebufferScaleFactor; | ||
currentPixelRatio = renderer.getPixelRatio(); | ||
renderer.getSize( currentSize ); | ||
renderer.setDrawingBufferSize( renderWidth * 2, renderHeight, 1 ); | ||
animation.start(); | ||
@@ -84,8 +77,2 @@ | ||
if ( scope.enabled ) { | ||
renderer.setDrawingBufferSize( currentSize.width, currentSize.height, currentPixelRatio ); | ||
} | ||
animation.stop(); | ||
@@ -124,2 +111,27 @@ | ||
function updateDrawingBufferSize() { | ||
if ( isPresenting() ) { | ||
var eyeParameters = device.getEyeParameters( 'left' ); | ||
var renderWidth = eyeParameters.renderWidth * framebufferScaleFactor; | ||
var renderHeight = eyeParameters.renderHeight * framebufferScaleFactor; | ||
renderer.setDrawingBufferSize( renderWidth * 2, renderHeight, 1 ); | ||
} else { | ||
if ( scope.enabled ) { | ||
currentPixelRatio = renderer.getPixelRatio(); | ||
renderer.getSize( currentSize ); | ||
renderer.setDrawingBufferSize( currentSize.width, currentSize.height, currentPixelRatio ); | ||
} | ||
} | ||
} | ||
function updateControllers() { | ||
@@ -216,2 +228,6 @@ | ||
updateDrawingBufferSize(); | ||
if ( isPresenting() ) animation.start(); | ||
}; | ||
@@ -386,3 +402,3 @@ | ||
if ( isPresenting() ) { animation.start(); } | ||
if ( isPresenting() ) animation.start(); | ||
@@ -389,0 +405,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17050926
211566