API Documentation | All Packages | All Classes | Index | Frames No Frames |
Utils

Package | org.b2ox.pv3d
Class | public class Utils
Inheritance | Utils Object

Public Methods

| Method | Defined By
--- | --- | ---
|  | applyQuaternionLeft(v:Number3D, q:Quaternion):void [static] v := Q v P where P := Q.conj, |Q|=1 | Utils
|  | applyQuaternionRight(v:Number3D, q:Quaternion):void [static] v := P v Q where P := Q.conj, |Q|=1 | Utils
|  | calcRotation(outQ:Quaternion, v0:Number3D, v1:Number3D):void [static] v0からv1への回転クォータニオンを計算する | Utils
|  | copyNumber3DfromVertex3D(n3:Number3D, v3:Vertex3D):void [static] Vertex3DからNumber3Dへ値をコピーする | Utils
|  | copyQuaternion(outQ:Quaternion, q:Quaternion):void [static] クォータニオンの値をコピーする | Utils
|  | copyVertex3DfromNumber3D(v3:Vertex3D, n3:Number3D):void [static] Number3DからVertex3Dへ値をコピーする | Utils
|  | eulerOfQuaternion(outV:Number3D, q:Quaternion):void [static] クォータニオンからオイラー角を求める | Utils
|  | getVectorTransformer(v0:Number3D, v0_:Number3D, q:Quaternion):Function [static] v := kP(v-v0)Q + v0') where P := Q.conj, |Q|=1 の計算用. | Utils
|  | lerpNumber3D(v0:Number3D, v1:Number3D, x:Number, y:Number, z:Number):Number3D [static] 各座標ごとに線形補間 | Utils
|  | resetQuaternion(outQ:Quaternion, x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 0):void [static] クォータニオンの成分値を代入する | Utils
|  | solveEquation2D(a:Number, b:Number, c:Number, ans:Vector.<Number>):int [static] a x^2 + b x + c = 0の実根をansに格納し、相異なる実根の個数を返す。 | Utils
|  | solveEquation3D(a:Number, b:Number, c:Number, d:Number, ans:Vector.<Number>):int [static] a x^3 + b x^2 + c x + d = 0の実根をansに格納し、相異なる実根の個数を返す。 | Utils
|  | transformVector(v:Number3D, v0:Number3D, v0_:Number3D, q:Quaternion, k:Number = 1.0):void [static] v := kP(v-v0)Q + v0') where P := Q.conj, |Q|=1 | Utils

Method Detail

applyQuaternionLeft | () | method

`public static function applyQuaternionLeft(v:Number3D, q:Quaternion):void`

v := Q v P where P := Q.conj, |Q|=1

Parameters

| `v:Number3D`
| `q:Quaternion`

applyQuaternionRight | () | method |

`public static function applyQuaternionRight(v:Number3D, q:Quaternion):void`

v := P v Q where P := Q.conj, |Q|=1

Parameters

| `v:Number3D`
| `q:Quaternion`

calcRotation | () | method |

`public static function calcRotation(outQ:Quaternion, v0:Number3D, v1:Number3D):void`

v0からv1への回転クォータニオンを計算する

Parameters

| `outQ:Quaternion`
| `v0:Number3D` — 単位ベクトル
| `v1:Number3D` — 単位ベクトル

copyNumber3DfromVertex3D | () | method |

`public static function copyNumber3DfromVertex3D(n3:Number3D, v3:Vertex3D):void`

Vertex3DからNumber3Dへ値をコピーする

Parameters

| `n3:Number3D`
| `v3:Vertex3D`

copyQuaternion | () | method |

`public static function copyQuaternion(outQ:Quaternion, q:Quaternion):void`

クォータニオンの値をコピーする

Parameters

| `outQ:Quaternion`
| `q:Quaternion`

copyVertex3DfromNumber3D | () | method |

`public static function copyVertex3DfromNumber3D(v3:Vertex3D, n3:Number3D):void`

Number3DからVertex3Dへ値をコピーする

Parameters

| `v3:Vertex3D`
| `n3:Number3D`

eulerOfQuaternion | () | method |

`public static function eulerOfQuaternion(outV:Number3D, q:Quaternion):void`

クォータニオンからオイラー角を求める

Parameters

| `outV:Number3D`
| `q:Quaternion`

getVectorTransformer | () | method |

`public static function getVectorTransformer(v0:Number3D, v0_:Number3D, q:Quaternion):Function`

v := kP(v-v0)Q + v0') where P := Q.conj, |Q|=1 の計算用. f = getVectorTransformer(v0, v0', Q); f(v,k); で上記の計算ができる

Parameters

| `v0:Number3D`
| `v0_:Number3D`
| `q:Quaternion`

Returns

| `Function`

lerpNumber3D | () | method |

`public static function lerpNumber3D(v0:Number3D, v1:Number3D, x:Number, y:Number, z:Number):Number3D`

各座標ごとに線形補間

Parameters

| `v0:Number3D`
| `v1:Number3D`
| `x:Number`
| `y:Number`
| `z:Number`

Returns

| `Number3D` —

resetQuaternion | () | method |

`public static function resetQuaternion(outQ:Quaternion, x:Number = 0, y:Number = 0, z:Number = 0, w:Number = 0):void`

クォータニオンの成分値を代入する

Parameters

| `outQ:Quaternion`
| `x:Number` (default = `0`)``
| `y:Number` (default = `0`)``
| `z:Number` (default = `0`)``
| `w:Number` (default = `0`)``

solveEquation2D | () | method |

`public static function solveEquation2D(a:Number, b:Number, c:Number, ans:Vector.<Number>):int`

a x^2 + b x + c = 0の実根をansに格納し、相異なる実根の個数を返す。

Parameters

| `a:Number`
| `b:Number`
| `c:Number`
| `ans:Vector.<Number>` — 事前に2個分の容量を確保しておくこと

Returns

| `int` —

solveEquation3D | () | method |

`public static function solveEquation3D(a:Number, b:Number, c:Number, d:Number, ans:Vector.<Number>):int`

a x^3 + b x^2 + c x + d = 0の実根をansに格納し、相異なる実根の個数を返す。

Parameters

| `a:Number`
| `b:Number`
| `c:Number`
| `d:Number`
| `ans:Vector.<Number>` — 事前に3個分の容量を確保しておくこと

Returns

| `int` —

transformVector | () | method |

`public static function transformVector(v:Number3D, v0:Number3D, v0_:Number3D, q:Quaternion, k:Number = 1.0):void`

v := kP(v-v0)Q + v0') where P := Q.conj, |Q|=1

Parameters

| `v:Number3D`
| `v0:Number3D`
| `v0_:Number3D`
| `q:Quaternion`
| `k:Number` (default = `1.0`)``

Mon Aug 16 2010, 08:52 PM +09:00