Vector4.html 2.0 KB
Newer Older
M
Mr.doob 已提交
1 2
<h1>[name]</h1>

M
Mr.doob 已提交
3
<div class="desc">4D vector.</div>
M
Mr.doob 已提交
4 5 6 7


<h2>Constructor</h2>

M
Mr.doob 已提交
8
<h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:Float w] )</h3>
M
Mr.doob 已提交
9 10 11 12


<h2>Properties</h2>

M
Mr.doob 已提交
13 14 15 16 17 18 19
<h3>.[page:Float x]</h3>

<h3>.[page:Float y]</h3>

<h3>.[page:Float z]</h3>

<h3>.[page:Float w]</h3>
M
Mr.doob 已提交
20 21 22 23


<h2>Methods</h2>

M
Mr.doob 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
<h3>.set( [page:Float x], [page:Float y], [page:Float z], [page:Float w] ) [page:Vector4]</h3>
<div>
Sets value of this vector.
</div>

<h3>.copy( [page:Vector4 v] ) [page:Vector4]</h3>
<div>
Copies value of *v* to this vector.
</div>

<h3>.add( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
<div>
Sets this vector to *a + b*.
</div>

<h3>.addSelf( [page:Vector4 v] ) [page:Vector4s]</h3>
<div>
Adds *v* to this vector.
</div>

<h3>.sub( [page:Vector4 a], [page:Vector4 b] ) [page:Vector4]</h3>
<div>
Sets this vector to *a - b*.
</div>

<h3>.subSelf( [page:Vector4 v] ) [page:Vector4]</h3>
<div>
Subtracts *v* from this vector.
</div>

<h3>.multiplyScalar( [page:Float s] ) [page:Vector4]</h3>
<div>
Multiplies this vector by scalar *s*.
</div>

<h3>.divideScalar( [page:Float s] ) [page:Vector4]</h3>
<div>
Divides this vector by scalar *s*.<br />
Set vector to *( 0, 0, 0 )* if *s == 0*.
</div>

<h3>.negate() [page:Vector4]</h3>
<div>
Inverts this vector.
</div>

<h3>.dot( [page:Vector4 v] ) [page:Float]</h3>
<div>
Computes dot product of this vector and *v*.
</div>

<h3>.lengthSq() [page:Float]</h3>
<div>
Computes squared length of this vector.
</div>

<h3>.length() [page:Float]</h3>
<div>
Computes length of this vector.
</div>

<h3>.normalize() [page:Vector4]</h3>
<div>
Normalizes this vector.
</div>

<h3>.setLength( [page:Float l] ) [page:Vector3]</h3>
<div>
Normalizes this vector and multiplies it by *l*.
</div>

<h3>.lerpSelf( [page:Vector4 v], [page:Float alpha] ) [page:Vector4]</h3>
<div>
Linearly interpolate between this vector and *v* with *alpha* factor.
</div>

<h3>.clone() [page:Vector3]</h3>
M
Mr.doob 已提交
101
<div>
M
Mr.doob 已提交
102
Clones this vector.
M
Mr.doob 已提交
103 104 105 106 107
</div>


<h2>Source</h2>

M
Mr.doob 已提交
108
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]