Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
Ray2D Struct Reference

Represents a 2D ray defined by an origin point and a translation vector. More...

#include <PhysicsWorld2D.h>

Public Member Functions

Vec2 endPoint () const
 Returns the end point of the ray.

Static Public Member Functions

static Ray2D fromPoints (const Vec2 &start, const Vec2 &end)
 Construct a ray from two points.

Public Attributes

Vec2 origin
 The starting point of the ray.
Vec2 translation
 The displacement vector from origin to destination.

Detailed Description

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).

Member Function Documentation

◆ endPoint()

Vec2 endPoint ( ) const
inline

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
startThe origin of the ray
endA 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:
  • PhysicsWorld2D.h