![]() |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
Public Member Functions | |
| Vector2 () | |
| Vector2 (const ::Vector2 &vec) | |
| Vector2 (float x) | |
| Vector2 (float x, float y) | |
| Vector2 | Add (const Vector2 &vector2) const |
| float | Angle (const Vector2 &vector2) const |
| Calculate angle from two vectors in X-axis. More... | |
| bool | CheckCollision (::Rectangle rec) const |
| Check if point is inside rectangle. More... | |
| bool | CheckCollision (::Vector2 center, float radius) const |
| Check if point is inside circle. More... | |
| bool | CheckCollision (::Vector2 p1, ::Vector2 p2, ::Vector2 p3) const |
| Check if point is inside a triangle. More... | |
| bool | CheckCollisionCircle (float radius, ::Rectangle rec) const |
| Check collision between circle and rectangle. More... | |
| bool | CheckCollisionCircle (float radius1, ::Vector2 center2, float radius2) const |
| Check collision between two circles. More... | |
| bool | CheckCollisionLines (::Vector2 endPos1, ::Vector2 startPos2, ::Vector2 endPos2, ::Vector2 *collisionPoint) const |
| Check the collision between two lines defined by two points each, returns collision point by reference. More... | |
| float | Distance (const Vector2 &vector2) const |
| Calculate distance between two vectors. More... | |
| Vector2 & | Divide (const float div) |
| Vector2 | Divide (const Vector2 &vector2) const |
| float | DotProduct (const Vector2 &vector2) const |
| Calculate two vectors dot product. More... | |
| Vector2 & | DrawCircle (float radius, ::Color color) |
| Draw line using quadratic bezier curves with a control point. More... | |
| Vector2 & | DrawLine (::Vector2 endPos, ::Color color) |
| Vector2 & | DrawLine (::Vector2 endPos, float thick, ::Color color) |
| Vector2 & | DrawLineBezier (::Vector2 endPos, float thick, ::Color color) |
| Vector2 & | DrawPixel (::Color color) |
| Vector2 & | DrawPoly (int sides, float radius, float rotation, ::Color color) |
| Vector2 & | DrawRectangle (::Vector2 size, ::Color color) |
| float | GetX () const |
| float | GetY () const |
| float | Length () const |
| Calculate vector length. More... | |
| float | LengthSqr () const |
| Calculate vector square length. More... | |
| Vector2 | Lerp (const Vector2 &vector2, const float amount) const |
| Calculate linear interpolation between two vectors. More... | |
| Vector2 | MoveTowards (Vector2 target, float maxDistance) const |
| Move Vector towards target. More... | |
| Vector2 | Multiply (const Vector2 &vector2) const |
| Vector2 | Negate () const |
| Vector2 | Normalize () const |
| Normalize provided vector. More... | |
| Vector2 | operator* (const float scale) |
| Vector2 | operator* (const Vector2 &vector2) |
| Vector2 & | operator*= (const float scale) |
| Vector2 & | operator*= (const Vector2 &vector2) |
| Vector2 | operator+ (const Vector2 &vector2) |
| Vector2 & | operator+= (const Vector2 &vector2) |
| Vector2 | operator- () |
| Vector2 | operator- (const Vector2 &vector2) |
| Vector2 & | operator-= (const Vector2 &vector2) |
| Vector2 & | operator/ (const float div) |
| Vector2 | operator/ (const Vector2 &vector2) |
| Vector2 & | operator/= (const float div) |
| Vector2 & | operator/= (const Vector2 &vector2) |
| Vector2 & | operator= (const ::Vector2 &vector2) |
| Vector2 & | operator= (const Vector2 &vector2) |
| bool | operator== (const Vector2 &other) |
| Vector2 | Reflect (const Vector2 &normal) const |
| Calculate reflected vector to normal. More... | |
| Vector2 | Rotate (float degrees) const |
| Rotate Vector by float in Degrees. More... | |
| Vector2 | Scale (const float scale) const |
| void | SetX (float value) |
| void | SetY (float value) |
| Vector2 | Subtract (const Vector2 &vector2) const |
Static Public Member Functions | |
| static Vector2 | One () |
| Vector with components value 1.0f. More... | |
| static Vector2 | Zero () |
| Vector with components value 0.0f. More... | |
Protected Member Functions | |
| void | set (const ::Vector2 &vec) |
Definition at line 37 of file Vector2.hpp.
|
inline |
Definition at line 39 of file Vector2.hpp.
References set().
|
inline |
Definition at line 43 of file Vector2.hpp.
|
inline |
Definition at line 44 of file Vector2.hpp.
|
inline |
Definition at line 45 of file Vector2.hpp.
Definition at line 66 of file Vector2.hpp.
|
inline |
Calculate angle from two vectors in X-axis.
Definition at line 197 of file Vector2.hpp.
|
inline |
Check if point is inside rectangle.
Definition at line 316 of file Vector2.hpp.
|
inline |
Check if point is inside circle.
Definition at line 323 of file Vector2.hpp.
Check if point is inside a triangle.
Definition at line 330 of file Vector2.hpp.
|
inline |
Check collision between circle and rectangle.
Definition at line 309 of file Vector2.hpp.
|
inline |
Check collision between two circles.
Definition at line 302 of file Vector2.hpp.
|
inline |
Check the collision between two lines defined by two points each, returns collision point by reference.
Definition at line 337 of file Vector2.hpp.
|
inline |
Calculate distance between two vectors.
Definition at line 204 of file Vector2.hpp.
|
inline |
Definition at line 114 of file Vector2.hpp.
Definition at line 106 of file Vector2.hpp.
|
inline |
Calculate two vectors dot product.
Definition at line 190 of file Vector2.hpp.
Draw line using quadratic bezier curves with a control point.
TODO(RobLoach): Add this one this commit makes it in: https://github.com/raysan5/raylib/commit/521ed1cef0c0dbc752cb79f70c21bb4fc3bf70d4 Draw a color-filled circle (Vector version)
Definition at line 284 of file Vector2.hpp.
Definition at line 256 of file Vector2.hpp.
Definition at line 261 of file Vector2.hpp.
Definition at line 266 of file Vector2.hpp.
Definition at line 251 of file Vector2.hpp.
|
inline |
Definition at line 294 of file Vector2.hpp.
Definition at line 289 of file Vector2.hpp.
|
inline |
Definition at line 47 of file Vector2.hpp.
|
inline |
Definition at line 48 of file Vector2.hpp.
|
inline |
Calculate vector length.
Definition at line 169 of file Vector2.hpp.
|
inline |
Calculate vector square length.
Definition at line 176 of file Vector2.hpp.
Calculate linear interpolation between two vectors.
Definition at line 211 of file Vector2.hpp.
Move Vector towards target.
Definition at line 232 of file Vector2.hpp.
Definition at line 90 of file Vector2.hpp.
|
inline |
Definition at line 82 of file Vector2.hpp.
|
inline |
Normalize provided vector.
Definition at line 183 of file Vector2.hpp.
|
inlinestatic |
Vector with components value 1.0f.
Definition at line 246 of file Vector2.hpp.
|
inline |
Definition at line 102 of file Vector2.hpp.
Definition at line 94 of file Vector2.hpp.
|
inline |
Definition at line 147 of file Vector2.hpp.
References set().
Definition at line 141 of file Vector2.hpp.
References set().
Definition at line 70 of file Vector2.hpp.
Definition at line 128 of file Vector2.hpp.
References set().
|
inline |
Definition at line 86 of file Vector2.hpp.
Definition at line 78 of file Vector2.hpp.
Definition at line 134 of file Vector2.hpp.
References set().
|
inline |
Definition at line 121 of file Vector2.hpp.
Definition at line 110 of file Vector2.hpp.
|
inline |
Definition at line 159 of file Vector2.hpp.
Definition at line 153 of file Vector2.hpp.
References set().
Definition at line 50 of file Vector2.hpp.
References set().
Definition at line 55 of file Vector2.hpp.
References set().
|
inline |
Definition at line 60 of file Vector2.hpp.
Calculate reflected vector to normal.
Definition at line 218 of file Vector2.hpp.
|
inline |
Rotate Vector by float in Degrees.
Definition at line 225 of file Vector2.hpp.
|
inline |
Definition at line 98 of file Vector2.hpp.
|
inlineprotected |
Definition at line 345 of file Vector2.hpp.
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and Vector2().
|
inline |
Definition at line 47 of file Vector2.hpp.
|
inline |
Definition at line 48 of file Vector2.hpp.
Definition at line 74 of file Vector2.hpp.
|
inlinestatic |
Vector with components value 0.0f.
Definition at line 239 of file Vector2.hpp.
1.8.17