ScummVM API documentation
Sword25::Vertex Class Reference

#include <vertex.h>

Inheritance diagram for Sword25::Vertex:
Common::Point

Public Member Functions

 Vertex (int x_, int y_)
 
 Vertex (Point p)
 
int distance (const Vertex &vertex) const
 
- Public Member Functions inherited from Common::Point
constexpr Point (int16 x1, int16 y1)
 
bool operator== (const Point &p) const
 
bool operator!= (const Point &p) const
 
Point operator+ (const Point &delta) const
 
Point operator- (const Point &delta) const
 
Point operator/ (int divisor) const
 
Point operator* (int multiplier) const
 
Point operator/ (double divisor) const
 
Point operator* (double multiplier) const
 
void operator+= (const Point &delta)
 
void operator-= (const Point &delta)
 
uint sqrDist (const Point &p) const
 

Static Public Member Functions

static VertexluaVertexToVertex (lua_State *L, int StackIndex, Vertex &vertex)
 
static void vertexToLuaVertex (lua_State *L, const Vertex &vertex)
 

Additional Inherited Members

- Public Attributes inherited from Common::Point
int16 x
 
int16 y
 

Detailed Description

Defines a 2-D Vertex

Member Function Documentation

◆ distance()

int Sword25::Vertex::distance ( const Vertex vertex) const
inline

Calculates the square of the distance between two Vertecies.

Parameters
VertexThe vertex for which the distance is to be calculated
Returns
Returns the square of the distance between itself and the passed vertex
Remarks
If only distances should be compared, sqrDist() should be used, since it is faster.

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