FVector3, FVector4 — Aspose.3D FOSS for Java
パッケージ: com.aspose.threed (aspose-3d-foss 26.1.0)
Example FVector ファミリーは単精度(float) の代替として、倍精度 Vector 型です。これらは法線、接線、UV座標のコンパクトな格納のために、頂点要素データ配列で内部的に使用されます。.
注: FVector2 存在し ない Java エディションで。のみ FVector3 と FVector4 利用可能です。.
FVector3
単精度 3 成分浮動小数点ベクトル。法線と接線の頂点要素データ配列に現れます。.
Example
| Example | Example |
|---|---|
FVector3() | Example (0, 0, 0) |
FVector3(float x, float y, float z) | 3つのコンポーネントから構成されます |
FVector3(Vector3 v) | 倍精度から構成されます Vector3 |
公開フィールド
FVector3 使用します 公開フィールド コンポーネントへのアクセス用:
| Example | Example | Example | Example |
|---|---|---|---|
x | float | v.x | X コンポーネント |
y | float | v.y | Y コンポーネント |
z | float | v.z | Z 成分 |
Example
| Example | 戻り値の型 | Example |
|---|---|---|
normalize() | FVector3 | 単位長さのコピーを返します |
cross(FVector3 rhs) | FVector3 | 外積 |
dot(FVector3 rhs) | float | 内積 |
FVector4
単精度 4 成分の float ベクトル。ストレージ型は VertexElementFVector データ。.
Example
| Example | Example |
|---|---|
FVector4() | Example (0, 0, 0, 0) |
FVector4(float x, float y, float z, float w) | 4 つの成分から構築 |
FVector4(Vector4 v) | double-precision から構築 Vector4 |
公開フィールド
FVector4 使用 public フィールド コンポーネントへのアクセス:
| Example | Example | Example | Example |
|---|---|---|---|
x | float | v.x | X コンポーネント |
y | float | v.y | Y コンポーネント |
z | float | v.z | Z コンポーネント |
w | float | v.w | W コンポーネント |
Example
import com.aspose.threed.*;
// Create from components
FVector3 normal = new FVector3(0.0f, 1.0f, 0.0f);
// Convert from double-precision
Vector3 dir = new Vector3(3.0, 4.0, 0.0);
FVector3 fDir = new FVector3(dir);
// Normalize
FVector3 unit = fDir.normalize();
System.out.println(unit.x); // 0.6f
System.out.println(unit.y); // 0.8f