MochiEngine
Loading...
Searching...
No Matches
Mochi::Physics::Line Struct Reference

Class representing a line between two points in space. The inherited position variable is the start of the line, and the end point is where it ends. This is meant to be used for checking for collisions between different types of shapes. More...

#include <Shapes.h>

Inheritance diagram for Mochi::Physics::Line:
Mochi::Physics::Shape

Public Member Functions

 Line (const Vector2f &position, const Vector2f &end)
virtual std::unique_ptr< Shape > Clone () const
virtual bool IsColliding (const Shape &other) const override
virtual bool Collides (const Point &p) const override
virtual bool Collides (const Line &l) const override
virtual bool Collides (const Circle &c) const override
virtual bool Collides (const Rectangle &r) const override
Public Member Functions inherited from Mochi::Physics::Shape
 Shape (const Vector2f &position)

Public Attributes

Vector2f End
Public Attributes inherited from Mochi::Physics::Shape
Vector2f Position

Detailed Description

Class representing a line between two points in space. The inherited position variable is the start of the line, and the end point is where it ends. This is meant to be used for checking for collisions between different types of shapes.

Member Function Documentation

◆ Clone()

std::unique_ptr< Shape > Mochi::Physics::Line::Clone ( ) const
virtual

Implements Mochi::Physics::Shape.

◆ Collides() [1/4]

bool Mochi::Physics::Line::Collides ( const Circle & c) const
overridevirtual

Implements Mochi::Physics::Shape.

◆ Collides() [2/4]

bool Mochi::Physics::Line::Collides ( const Line & l) const
overridevirtual

Implements Mochi::Physics::Shape.

◆ Collides() [3/4]

bool Mochi::Physics::Line::Collides ( const Point & p) const
overridevirtual

Implements Mochi::Physics::Shape.

◆ Collides() [4/4]

bool Mochi::Physics::Line::Collides ( const Rectangle & r) const
overridevirtual

Implements Mochi::Physics::Shape.

◆ IsColliding()

bool Mochi::Physics::Line::IsColliding ( const Shape & other) const
overridevirtual

Implements Mochi::Physics::Shape.


The documentation for this struct was generated from the following files:
  • Engine/src/Physics/Shapes.h
  • Engine/src/Physics/Shapes.cpp