* Returns the local-space position of the vertex at the given index, taking into * account the current animation state of both morph targets and skinning. * * @param {number} index - The vertex index. * @param {Vector3} target - The target object that is used to store the method's result.
( index, target )
| 174 | * @return {Vector3} The vertex position in local space. |
| 175 | */ |
| 176 | getVertexPosition( index, target ) { |
| 177 | |
| 178 | const geometry = this.geometry; |
| 179 | const position = geometry.attributes.position; |
| 180 | const morphPosition = geometry.morphAttributes.position; |
| 181 | const morphTargetsRelative = geometry.morphTargetsRelative; |
| 182 | |
| 183 | target.fromBufferAttribute( position, index ); |
| 184 | |
| 185 | const morphInfluences = this.morphTargetInfluences; |
| 186 | |
| 187 | if ( morphPosition && morphInfluences ) { |
| 188 | |
| 189 | _morphA.set( 0, 0, 0 ); |
| 190 | |
| 191 | for ( let i = 0, il = morphPosition.length; i < il; i ++ ) { |
| 192 | |
| 193 | const influence = morphInfluences[ i ]; |
| 194 | const morphAttribute = morphPosition[ i ]; |
| 195 | |
| 196 | if ( influence === 0 ) continue; |
| 197 | |
| 198 | _tempA.fromBufferAttribute( morphAttribute, index ); |
| 199 | |
| 200 | if ( morphTargetsRelative ) { |
| 201 | |
| 202 | _morphA.addScaledVector( _tempA, influence ); |
| 203 | |
| 204 | } else { |
| 205 | |
| 206 | _morphA.addScaledVector( _tempA.sub( target ), influence ); |
| 207 | |
| 208 | } |
| 209 | |
| 210 | } |
| 211 | |
| 212 | target.add( _morphA ); |
| 213 | |
| 214 | } |
| 215 | |
| 216 | return target; |
| 217 | |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * Computes intersection points between a casted ray and this line. |
no test coverage detected