Represents a 2D ray defined by an origin point and a translation vector.
More...
#include <PhysicsWorld2D.h>
|
| static Ray2D | fromPoints (const Vec2 &start, const Vec2 &end) |
| | Construct a ray from two points.
|
|
|
Vec2 | origin |
| | The starting point of the ray.
|
|
Vec2 | translation |
| | The displacement vector from origin to destination.
|
Represents a 2D ray defined by an origin point and a translation vector.
- Note
- Use fromPoints() to conveniently construct a ray from two points. The translation is computed as (end - start).
◆ endPoint()
Returns the end point of the ray.
- Returns
- The computed point (origin + translation)
◆ fromPoints()
| Ray2D fromPoints |
( |
const Vec2 & | start, |
|
|
const Vec2 & | end ) |
|
inlinestatic |
Construct a ray from two points.
- Parameters
-
| start | The origin of the ray |
| end | A point used to compute the translation (end - start) |
- Returns
- A Ray2D instance with origin and translation
The documentation for this struct was generated from the following file: