VectorsPY
1.0.0
Pythonモジュールは、PythonでVector2とVector3(Unityゲームエンジン-C#のように)を使用します。
dot() dot(スカラー)製品を計算します。cross()クロス(ベクトル)製品を計算します。.direction()属性vector2の誘引を取得します。 PIPの使用 -
pip install VectorsPY
Vectorspyには2つの主要なクラスがあります
新しい2Dベクトルを作成するには、 Vector2クラスを使用します。
new2DVector = Vector2 ( x_value , y_value )同様に、 Vector3を使用して3Dベクトルを作成します。
new3DVector = Vector3 ( x_value , y_value , z_value )リストからベクトルを作成するには、Tuple(iterables)はその他の関数ベクトルを使用します。これにより、引数として渡された反復可能に基づいて、新しいVector2またはVector3オブジェクトが返されます。
iterable1 = [ 1 , 2 ]
newVector1 = Vector ( iterable1 ) #new Vector2 object from list
iterable2 = ( 4 , 5 )
newVector2 = Vector ( iterable2 ) #new Vector2 object from tuple
iterable3 = ( 3 , 4 , 5 )
newVector3 = Vector ( iterable3 ) #new Vector3 object from tuple
iterable4 = [ 3 , 4 , 5 ]
newVector4 = Vector ( iterable4 ) #new Vector3 object from list