Vector3Extensions¶
Namespace:
SideXP.Core
Extension functions for Vector3 values.
Methods¶
Min(Vector3, float)¶
Returns a new Vector3 with its values superior or equal to the given minimum value.
Parameters
vector: The input vector to compute.min: The minimum value of the given vector.
Returns
Returns the computed vector.
Max(Vector3, float)¶
Returns a new Vector3 instance with its values inferior or equal to the given maximum value.
Parameters
max: The maximum value of the given vector.vector: The input vector to compute.
Returns
Returns the computed vector.
Translate(Vector3[], Vector3, bool)¶
Translates the given points.
Parameters
points: The points you want to translate.translation: The translation vector.inPlace: If enabled, the input array is modified in-place, instead of returning a new array.
Returns
Returns the translated points.
To2D(IList<Vector3>)¶
Converts this list into a Vector2 array.
Parameters
points: The points you want to convert.
Returns
Returns the processed array.
Barycentre(IList<Vector3>)¶
Computes the barycentre of the given points. Barycentre formula:
. -> ->
-> weightA * OA + weightN... * ON...
OG = ___________________________________
. weightA + weightN...
Parameters
points: The points from which you want to compute the barycentre.
Returns
Returns the computed barycentre.
Barycentre(IList<(Vector3, float)>)¶
Parameters
weightedPoints: The points from which you want to compute the barycentre, and their associated weight. The more the weight value, the closer the barycentre to this point.