Vector2D Struct Reference
#include <Vector2D.h>
![](../class_vector2_d.png)
# Public Attributes | |
int16 | x |
int16 | y |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
const void * | getVTable () |
bool | mutateTo (const void *targetClass) |
![]() | |
static Object | getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod) |
![]() | |
void * | vTable |
Pointer to the class's virtual table. |
# Detailed Description
Class Vector2D
Inherits from Object
Implements methods to operate on Vector2D structs.
Definition at line 32 of file Vector2D.h.
# Member Function Documentation
# areEqual()
Test if two vectors are equal.
- Parameters
-
a First vector b Second vector
- Returns
- True if all the components of both vectors are equal; false otherwise
Definition at line 548 of file Vector2D.h.
# dotProduct()
|
inlinestatic |
Compute the dot product of the provided vectors.
- Parameters
-
vectorA First vector vectorB Second vector
- Returns
- Dot product of the provided vectors
Definition at line 485 of file Vector2D.h.
# dotProductHighPrecision()
|
inlinestatic |
Compute with higher decimal precision the dot product of the provided vectors.
- Parameters
-
vectorA First vector vectorB Second vector
- Returns
- Dot product of the provided vectors
Definition at line 492 of file Vector2D.h.
# get()
Compute the difference vector between two provided vectors.
- Parameters
-
from Start vector to End vector
- Returns
- Difference vector between the provided vectors
Definition at line 250 of file Vector2D.h.
# getFromPixelVector()
|
inlinestatic |
Transform the provided vector in pixel coordinates into a normal 2D vector.
- Parameters
-
screenVector Vector to transform
- Returns
- 2D vector
Definition at line 435 of file Vector2D.h.
# getFromScreenPixelVector()
|
inlinestatic |
Transform the provided vector in screen coordinates into a normal 2D vector.
- Parameters
-
screenPixelVector Vector to transform
- Returns
- 2D vector
Definition at line 446 of file Vector2D.h.
# getFromVector3D()
Reduce the provided 3D vector to 2D by discarding the Z coordinate
- Parameters
-
vector3D 3D vector to reduce
- Returns
- Reduced vector
Definition at line 428 of file Vector2D.h.
# getRelativeToCamera()
Compute the vector relative to the camera's position.
- Parameters
-
vector Vector to compute the relative vector of
- Returns
- Vector relative to the camera's position
Definition at line 328 of file Vector2D.h.
# getScale()
Compute the scale factor for the provided z coordinate.
- Parameters
-
z Z coordinate applyScalingMultiplier Flag to determine if the optics' scaling multiplier is applied to the result
- Returns
- Computed scale
Definition at line 500 of file Vector2D.h.
# intermediate()
Compute the intermediate vector between two provided vectors.
- Parameters
-
a First vector b Second vector
- Returns
- Intermediate vector between the provided vectors
Definition at line 271 of file Vector2D.h.
# isLeft()
Test if the vector point b is to the left of the vector ab.
- Parameters
-
a First vector b Second vector p Vector point to test
- Returns
- True if p is to the left of ab; false otherwise
Definition at line 534 of file Vector2D.h.
# isRight()
Test if the vector point b is to the right of the vector ab.
- Parameters
-
a First vector b Second vector p Vector point to test
- Returns
- True if p is to the right of ab; false otherwise
Definition at line 541 of file Vector2D.h.
# isValueInRange()
|
inlinestatic |
Test if a number is within a range.
- Parameters
-
number Number to test limitA First limit of the range limitB Second limit of the range
- Returns
- True if all the provided number is within the provided limits
Definition at line 555 of file Vector2D.h.
# isVectorInsideLine()
Test if vector point p is within the vector ab
- Parameters
-
p Vector point to test a First vector point of the vector onto which to test p b Second vector point of the vector onto which to test p
- Returns
- True if p lies in ab; false otherwise
Definition at line 567 of file Vector2D.h.
# length()
Compute the length of the provided vector.
- Parameters
-
vector Vector to compute the length of
- Returns
- Length of the provided vector
Definition at line 457 of file Vector2D.h.
# lengthProduct()
Compute the product of the lengths of the provided vectors.
- Parameters
-
vectorA First vector vectorB Second vector
- Returns
- Product of the lengths of the provided vectors
Definition at line 473 of file Vector2D.h.
# normalize()
Normalize the provided vector.
- Parameters
-
vector Vector to normalize
- Returns
- Normalized vector
Definition at line 243 of file Vector2D.h.
# perpendicular()
Compute the perpendicular vector towards the provided direction.
- Parameters
-
a Vector to compute the perpendicular of left Direction of the perpendicular vector
- Returns
- Perpendicular vector
Definition at line 282 of file Vector2D.h.
# print()
Print the vector's components.
- Parameters
-
vector Vector to print x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 25 of file Vector2D.c.
# printRaw()
Print the vector's components without converting the underlying data type.
- Parameters
-
vector Vector to print x Screen x coordinate where to print y Screen y coordinate where to print
Definition at line 38 of file Vector2D.c.
# projectOnto()
Project the point p onto the vector ab.
- Parameters
-
p Vector point to project a First vector point of the vector onto which to project p b Second vector point of the vector onto which to project p
- Returns
- Projected vector point
Definition at line 338 of file Vector2D.h.
# projectOntoHighPrecision()
|
inlinestatic |
Project the point p onto the vector ab with higher decima precision.
- Parameters
-
p Vector point to project a First vector point of the vector onto which to project p b Second vector point of the vector onto which to project p
- Returns
- Projected vector point
Definition at line 371 of file Vector2D.h.
# rotate()
Rotate the vector according to the provided degrees.
- Parameters
-
vector Vector to rotate degrees Amount of degrees to rotate the vector
- Returns
- Rotated vector
Definition at line 404 of file Vector2D.h.
# scalarDivision()
Apply a scalar division over the vector's components
- Parameters
-
vector Vector to scale scalar Scalar divisor
- Returns
- Scaled vector
Definition at line 316 of file Vector2D.h.
# scalarProduct()
Apply a scalar product over the vector's components
- Parameters
-
vector Vector to scale scalar Scalar to multiply
- Returns
- Scaled vector
Definition at line 309 of file Vector2D.h.
# scale()
- Parameters
-
vector Vector to scale scale Scale to apply to the vector's components
- Returns
- Scaled vector
Definition at line 302 of file Vector2D.h.
# squareLength()
|
inlinestatic |
Compute the squared length of the provided vector.
- Parameters
-
vector Vector to compute the square length of
- Returns
- Square length of the provided vector
Definition at line 466 of file Vector2D.h.
# sub()
Compute the difference vector between two provided vectors.
- Parameters
-
a End vector b Start vector
- Returns
- Difference vector between the provided vectors
Definition at line 264 of file Vector2D.h.
# sum()
Compute the addition vector between other two provided vectors.
- Parameters
-
a First vector b Second vector
- Returns
- Addition vector between the provided vectors
Definition at line 257 of file Vector2D.h.
# unit()
Get a unit vector on the provided axis.
- Parameters
-
axis Axis on which the vector should be (__X_AXIS, __Y_AXIS)
- Returns
- Unit vector on the provided axis
Definition at line 232 of file Vector2D.h.
# zero()
|
inlinestatic |
Get a vector with all its members initialized to zero.
- Returns
- Pixel vector with all its members initialized to zero
# Member Data Documentation
# x
# y
The documentation for this struct was generated from the following files:
- VUEngine-Core/source/Misc/Math/Vector2D.h
- VUEngine-Core/source/Misc/Types.h
- VUEngine-Core/source/Misc/Math/Vector2D.c