- 
        new Vector3Notifier(x, y, z)
- 
        
        
        三维向量,具有 onUpdate 回调 Name Type Default Description xNumber 0 optional X component yNumber 0 optional Y component zNumber 0 optional Z component 
Extends
Members Show Inherited
| Name | Type | Default | Description | 
|---|---|---|---|
| className | String | Vector3Notifier | 类名 notify | 
| isVector3Notifier | Boolean | true | |
| elements | Float32Array | 数据 | |
| x | Number | X component | |
| y | Number | Y component | |
| z | Number | Z component | |
| isVector3 | Boolean | true | inherited | 
Methods Show Inherited
- 
        onUpdate()
- 
        
        
        更新的回调 
- 
        copy(m){Vector3}
- 
        
        
        Copy the values from one vec3 to this Name Type Description mVector3 the source vector Returns:Type Description Vector3 this 
- 
        clone(){Vector3}
- 
        
        
        Creates a new vec3 initialized with values from this vec3 Returns:Type Description Vector3 a new Vector3 
- 
        toArray(array, offset){Array}
- 
        
        
        转换到数组 Name Type Default Description arrayArray.<number> | TypedArray [] optional 数组 offsetNumber 0 optional 数组偏移值 Returns:Type Description Array 
- 
        fromArray(array, offset){Vector3}
- 
        
        
        从数组赋值 Name Type Default Description arrayArray.<number> | TypedArray 数组 offsetNumber 0 optional 数组偏移值 Returns:Type Description Vector3 this 
- 
        set(x, y, z){Vector3Notifier}
- 
        
        
        Set the components of a vec3 to the given values Name Type Description xNumber X component yNumber Y component zNumber Z component Returns:Type Description Vector3Notifier this 
- 
        add(a, b){Vector3Notifier}
- 
        
        
        Adds two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的和 Returns:Type Description Vector3Notifier this 
- 
        subtract(a, b){Vector3Notifier}
- 
        
        
        Subtracts vector b from vector a Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的差 Returns:Type Description Vector3Notifier this 
- 
        multiply(a, b){Vector3Notifier}
- 
        
        
        Multiplies two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的积 Returns:Type Description Vector3Notifier this 
- 
        divide(a, b){Vector3Notifier}
- 
        
        
        Divides two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的商 Returns:Type Description Vector3Notifier this 
- 
        
        
        Math.ceil the components of this Returns:Type Description Vector3Notifier this 
- 
        floor(){Vector3Notifier}
- 
        
        
        Math.floor the components of this Returns:Type Description Vector3Notifier this 
- 
        min(a, b){Vector3Notifier}
- 
        
        
        Returns the minimum of two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Vector3Notifier this 
- 
        max(a, b){Vector3Notifier}
- 
        
        
        Returns the maximum of two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Vector3Notifier this 
- 
        round(){Vector3Notifier}
- 
        
        
        Math.round the components of this Returns:Type Description Vector3Notifier this 
- 
        scale(scale){Vector3Notifier}
- 
        
        
        Scales this by a scalar number Name Type Description scaleNumber amount to scale the vector by Returns:Type Description Vector3Notifier this 
- 
        scaleAndAdd(scale, a, b){Vector3Notifier}
- 
        
        
        Adds two vec3's after scaling the second vector by a scalar value Name Type Description scaleNumber the amount to scale the second vector by before adding aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Vector3Notifier this 
- 
        distance(a, b){Number}
- 
        
        
        Calculates the euclidian distance between two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Number distance between a and b 
- 
        squaredDistance(a, b){Number}
- 
        
        
        Calculates the squared euclidian distance between two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Number squared distance between a and b 
- 
        length(){Number}
- 
        
        
        Calculates the length of this Returns:Type Description Number length of this 
- 
        squaredLength(){Number}
- 
        
        
        Calculates the squared length of this Returns:Type Description Number squared length of this 
- 
        negate(){Vector3Notifier}
- 
        
        
        Negates the components of this Returns:Type Description Vector3Notifier this 
- 
        inverse(a){Vector3Notifier}
- 
        
        
        Returns the inverse of the components of a vec3 Name Type Default Description aVector3 this optional Returns:Type Description Vector3Notifier this 
- 
        normalize(){Vector3Notifier}
- 
        
        
        Normalize this Returns:Type Description Vector3Notifier this 
- 
        dot(a, b){Number}
- 
        
        
        Calculates the dot product of two vec3's Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Number product of a and b 
- 
        cross(a, b){Number}
- 
        
        
        Computes the cross product of two vec3's Name Type Description aVector2 bVector2 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Number cross product of a and b 
- 
        lerp(v, t){Vector3Notifier}
- 
        
        
        Performs a linear interpolation between two vec3's Name Type Description vVector3 tNumber interpolation amount between the two vectors Returns:Type Description Vector3Notifier this 
- 
        hermite(a, b, c, d, t){Vector3}
- 
        
        
        Performs a hermite interpolation with two control points Name Type Description aVector3 bVector3 cVector3 dVector3 tNumber interpolation amount between the two inputs Returns:Type Description Vector3 this 
- 
        bezier(a, b, c, d, t){Vector3}
- 
        
        
        Performs a bezier interpolation with two control points Name Type Description aVector3 bVector3 cVector3 dVector3 tNumber interpolation amount between the two inputs Returns:Type Description Vector3 this 
- 
        random(scale){Vector3Notifier}
- 
        
        
        Generates a random vector with the given scale Name Type Default Description scaleNumber 1 optional Length of the resulting vector. If ommitted, a unit vector will be returned Returns:Type Description Vector3Notifier this 
- 
        transformMat3(m){Vector3Notifier}
- 
        
        
        Transforms the vec3 with a mat3 Name Type Description mMatrix3 matrix to transform with Returns:Type Description Vector3Notifier this 
- 
        transformMat4(m){Vector3Notifier}
- 
        
        
        Transforms the vec3 with a mat4 Name Type Description mMatrix4 matrix to transform with Returns:Type Description Vector3Notifier this 
- 
        transformDirection(m){Vector3Notifier}
- 
        
        
        Transforms the vec3 direction with a mat4 Name Type Description mMatrix4 matrix to transform with Returns:Type Description Vector3Notifier this 
- 
        transformQuat(q){Vector3Notifier}
- 
        
        
        Transforms the vec3 with a quat Name Type Description qQuaternion quaternion to transform with Returns:Type Description Vector3Notifier this 
- 
        rotateX(origin, rotation){Vector3}
- 
        
        
        Rotate this 3D vector around the x-axis Name Type Description originVector3 The origin of the rotation rotationNumber The angle of rotation Returns:Type Description Vector3 this 
- 
        rotateY(origin, rotation){Vector3}
- 
        
        
        Rotate this 3D vector around the y-axis Name Type Description originVector3 The origin of the rotation rotationNumber The angle of rotation Returns:Type Description Vector3 this 
- 
        rotateZ(origin, rotation){Vector3}
- 
        
        
        Rotate this 3D vector around the z-axis Name Type Description originVector3 The origin of the rotation rotationNumber The angle of rotation Returns:Type Description Vector3 this 
- 
        exactEquals(a, b){Boolean}
- 
        
        
        Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Boolean True if the vectors are equal, false otherwise. 
- 
        equals(a, b){Boolean}
- 
        
        
        Returns whether or not the vectors have approximately the same elements in the same position. Name Type Description aVector3 bVector3 optional 如果不传,计算 this 和 a 的结果 Returns:Type Description Boolean True if the vectors are equal, false otherwise. 
- 
        inherited sub()
- 
        
        
        Alias for Vector3#subtract
- 
        inherited mul()
- 
        
        
        Alias for Vector3#multiply
- 
        inherited div()
- 
        
        
        Alias for Vector3#divide
- 
        inherited dist()
- 
        
        
        Alias for Vector3#distance
- 
        inherited sqrDist()
- 
        
        
        Alias for Vector3#squaredDistance
- 
        inherited len()
- 
        
        
        Alias for Vector3#length
- 
        inherited sqrLen()
- 
        
        
        Alias for Vector3#squaredLength