Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Public Attributes | List of all members
jau::math::geom::Rect2f Class Reference

#include <geom2f.hpp>

Inheritance diagram for jau::math::geom::Rect2f:
Collaboration diagram for jau::math::geom::Rect2f:

Public Member Functions

 Rect2f (const Point2f &tl_, const float width, const float height) noexcept
 
 Rect2f (const Point2f &tl_, const float width, const float height, const float radians) noexcept
 
 Rect2f (const Point2f &tl_, const Point2f &tr_, const Point2f &bl_, const Point2f &br_) noexcept
 
AABBox2f box () const noexcept override
 
bool contains (const Point2f &o) const noexcept override
 
bool intersection (Vec2f &reflect_out, Vec2f &cross_normal, Point2f &cross_point, const LineSeg2f &in) const noexcept override
 Return whether this object intersects with the given line segment and if intersecting, the crossing point (intersection), the normalized normal of the crossing surface and the reflection out vector. More...
 
bool intersection (Vec2f &reflect_out, Vec2f &cross_normal, Point2f &cross_point, const LineSeg2f &in, const float in_radius) const noexcept
 
bool intersects (const AABBox2f &o) const noexcept override
 
bool intersects (const Geom2f &o) const noexcept override
 
bool intersects (const LineSeg2f &o) const noexcept override
 
void move (const float dx, const float dy) noexcept override
 
void move (const Point2f &d) noexcept override
 
void move_dir (const float d) noexcept override
 
void rotate (const float radians) noexcept override
 
void rotate (const float radians, const Point2f &p) noexcept
 
void set_top_left (const Point2f &p)
 
std::string toString () const noexcept override
 
- Public Member Functions inherited from jau::math::geom::AGeom2f
virtual void move (const float dx, const float dy) noexcept=0
 
virtual void move (const Point2f &d) noexcept=0
 
virtual void move_dir (const float d) noexcept=0
 
virtual void rotate (const float rad) noexcept=0
 
virtual bool tick (const float dt) noexcept
 
- Public Member Functions inherited from jau::math::geom::Geom2f
virtual ~Geom2f ()=default
 
virtual AABBox2f box () const noexcept=0
 
virtual bool contains (const Point2f &o) const noexcept=0
 
virtual bool intersection (Vec2f &reflect_out, Vec2f &cross_normal, Point2f &cross_point, const LineSeg2f &in) const noexcept=0
 Return whether this object intersects with the given line segment and if intersecting, the crossing point (intersection), the normalized normal of the crossing surface and the reflection out vector. More...
 
virtual bool intersects (const AABBox2f &box) const noexcept=0
 
virtual bool intersects (const Geom2f &o) const noexcept=0
 
virtual bool intersects (const LineSeg2f &o) const noexcept=0
 
virtual std::string toString () const noexcept=0
 

Public Attributes

float dir_angle
 direction angle in radians More...
 
Point2f p_a
 Unrotated, clockwise (CW): More...
 
Point2f p_b
 Unrotated top-right. More...
 
Point2f p_c
 Unrotated bottom-left. More...
 
Point2f p_center
 
Point2f p_d
 Unrotated bottom_right. More...
 

Detailed Description

Definition at line 555 of file geom2f.hpp.

Constructor & Destructor Documentation

◆ Rect2f() [1/3]

jau::math::geom::Rect2f::Rect2f ( const Point2f tl_,
const float  width,
const float  height,
const float  radians 
)
inlinenoexcept

Definition at line 579 of file geom2f.hpp.

◆ Rect2f() [2/3]

jau::math::geom::Rect2f::Rect2f ( const Point2f tl_,
const float  width,
const float  height 
)
inlinenoexcept

Definition at line 590 of file geom2f.hpp.

◆ Rect2f() [3/3]

jau::math::geom::Rect2f::Rect2f ( const Point2f tl_,
const Point2f tr_,
const Point2f bl_,
const Point2f br_ 
)
inlinenoexcept

Definition at line 600 of file geom2f.hpp.

Member Function Documentation

◆ box()

AABBox2f jau::math::geom::Rect2f::box ( ) const
inlineoverridevirtualnoexcept

Implements jau::math::geom::Geom2f.

Definition at line 607 of file geom2f.hpp.

◆ move_dir()

void jau::math::geom::Rect2f::move_dir ( const float  d)
inlineoverridevirtualnoexcept

Implements jau::math::geom::AGeom2f.

Definition at line 611 of file geom2f.hpp.

◆ move() [1/2]

void jau::math::geom::Rect2f::move ( const Point2f d)
inlineoverridevirtualnoexcept

Implements jau::math::geom::AGeom2f.

Definition at line 621 of file geom2f.hpp.

◆ move() [2/2]

void jau::math::geom::Rect2f::move ( const float  dx,
const float  dy 
)
inlineoverridevirtualnoexcept

Implements jau::math::geom::AGeom2f.

Definition at line 628 of file geom2f.hpp.

◆ rotate() [1/2]

void jau::math::geom::Rect2f::rotate ( const float  radians)
inlineoverridevirtualnoexcept

Implements jau::math::geom::AGeom2f.

Definition at line 636 of file geom2f.hpp.

◆ rotate() [2/2]

void jau::math::geom::Rect2f::rotate ( const float  radians,
const Point2f p 
)
inlinenoexcept

Definition at line 639 of file geom2f.hpp.

◆ set_top_left()

void jau::math::geom::Rect2f::set_top_left ( const Point2f p)
inline

Definition at line 649 of file geom2f.hpp.

◆ contains()

bool jau::math::geom::Rect2f::contains ( const Point2f o) const
inlineoverridevirtualnoexcept

Implements jau::math::geom::Geom2f.

Definition at line 656 of file geom2f.hpp.

◆ intersects() [1/3]

bool jau::math::geom::Rect2f::intersects ( const LineSeg2f o) const
inlineoverridevirtualnoexcept

Implements jau::math::geom::Geom2f.

Definition at line 660 of file geom2f.hpp.

◆ intersects() [2/3]

bool jau::math::geom::Rect2f::intersects ( const AABBox2f o) const
inlineoverridevirtualnoexcept

Implements jau::math::geom::Geom2f.

Definition at line 664 of file geom2f.hpp.

◆ intersects() [3/3]

bool jau::math::geom::Rect2f::intersects ( const Geom2f o) const
inlineoverridevirtualnoexcept

Implements jau::math::geom::Geom2f.

Definition at line 668 of file geom2f.hpp.

◆ intersection() [1/2]

bool jau::math::geom::Rect2f::intersection ( Vec2f reflect_out,
Vec2f cross_normal,
Point2f cross_point,
const LineSeg2f in 
) const
inlineoverridevirtualnoexcept

Return whether this object intersects with the given line segment and if intersecting, the crossing point (intersection), the normalized normal of the crossing surface and the reflection out vector.

Implements jau::math::geom::Geom2f.

Definition at line 672 of file geom2f.hpp.

◆ intersection() [2/2]

bool jau::math::geom::Rect2f::intersection ( Vec2f reflect_out,
Vec2f cross_normal,
Point2f cross_point,
const LineSeg2f in,
const float  in_radius 
) const
inlinenoexcept

Definition at line 704 of file geom2f.hpp.

◆ toString()

std::string jau::math::geom::Rect2f::toString ( ) const
inlineoverridevirtualnoexcept

Implements jau::math::geom::Geom2f.

Definition at line 748 of file geom2f.hpp.

Member Data Documentation

◆ p_a

Point2f jau::math::geom::Rect2f::p_a

Unrotated, clockwise (CW):

(a)--—(b)

(c)--—(d) Unrotated top-left

Definition at line 567 of file geom2f.hpp.

◆ p_b

Point2f jau::math::geom::Rect2f::p_b

Unrotated top-right.

Definition at line 569 of file geom2f.hpp.

◆ p_c

Point2f jau::math::geom::Rect2f::p_c

Unrotated bottom-left.

Definition at line 571 of file geom2f.hpp.

◆ p_d

Point2f jau::math::geom::Rect2f::p_d

Unrotated bottom_right.

Definition at line 573 of file geom2f.hpp.

◆ p_center

Point2f jau::math::geom::Rect2f::p_center

Definition at line 574 of file geom2f.hpp.

◆ dir_angle

float jau::math::geom::Rect2f::dir_angle

direction angle in radians

Definition at line 576 of file geom2f.hpp.


The documentation for this class was generated from the following file: