  Platform eXtended Library (PXL)Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
record TQuad
Unit
PXL.Types
Declaration
type TQuad = record
Description
Special floating-point quadrilateral defined by four vertices starting from top/left in clockwise order. This is typically used for rendering color filled and textured quads.
Overview
Fields
Methods
function Contains(const Point: TPoint2f): Boolean; |
function Flip: TQuad; |
function Mirror: TQuad; |
function Offset(const DeltaX, DeltaY: VectorFloat): TQuad; overload; inline; |
function Offset(const Delta: TPoint2f): TQuad; overload; |
class function Rotated(const RotationOrigin, Size: TPoint2f; const Angle: VectorFloat; const Scale: VectorFloat = 1.0): TQuad; overload; static; inline; |
class function Rotated(const RotationOrigin, Size, RotationCenter: TPoint2f; const Angle: VectorFloat; const Scale: VectorFloat = 1.0): TQuad; overload; static; |
class function RotatedTL(const TopLeft, Size, RotationCenter: TPoint2f; const Angle: VectorFloat; const Scale: VectorFloat = 1.0): TQuad; static; inline; |
function Scale(const Scale: VectorFloat; const Centered: Boolean = True): TQuad; |
class function Scaled(const Left, Top, Width, Height, Scale: VectorFloat; const Centered: Boolean = True): TQuad; static; |
function Transform(const Matrix: TMatrix3f): TQuad; |
Description
Fields
TopLeft: TPoint2f; |
|
Top/left vertex position.
|
TopRight: TPoint2f; |
|
Top/right vertex position.
|
BottomRight: TPoint2f; |
|
Bottom/right vertex position.
|
BottomLeft: TPoint2f; |
|
Bottom/left vertex position.
|
Values: array[0..3] of TPoint2f |
|
Quadrilateral vertices represented as an array. }
|
Methods
function Contains(const Point: TPoint2f): Boolean; |
|
Tests whether the point is inside current quadrilateral.
|
function Flip: TQuad; |
|
Creates quadrilateral from another quadrilateral but having top vertices exchanged with the bottom ones, effectively flipping it vertically.
|
function Mirror: TQuad; |
|
Creates quadrilateral from another quadrilateral but having left vertices exchanged with the right ones, effectively mirroring it horizontally.
|
function Offset(const DeltaX, DeltaY: VectorFloat): TQuad; overload; inline; |
|
Displaces vertices of given quadrilateral by the specified displacement values.
|
function Offset(const Delta: TPoint2f): TQuad; overload; |
|
Displaces vertices of given quadrilateral by the specified offset.
|
class function Rotated(const RotationOrigin, Size: TPoint2f; const Angle: VectorFloat; const Scale: VectorFloat = 1.0): TQuad; overload; static; inline; |
|
Creates quadrilateral specified by its dimensions. The rectangle is then rotated and scaled around its center and placed at the specified origin.
|
class function Rotated(const RotationOrigin, Size, RotationCenter: TPoint2f; const Angle: VectorFloat; const Scale: VectorFloat = 1.0): TQuad; overload; static; |
|
Creates quadrilateral specified by its dimensions. The rectangle is then rotated and scaled around the given middle point (assumed to be inside rectangle's dimensions) and placed in center of the specified origin.
|
class function RotatedTL(const TopLeft, Size, RotationCenter: TPoint2f; const Angle: VectorFloat; const Scale: VectorFloat = 1.0): TQuad; static; inline; |
|
Creates quadrilateral specified by top-left corner and size. The rectangle is then rotated and scaled around the specified middle point (assumed to be inside rectangle's dimensions) and placed in the center of the specified origin. The difference between this method and Rotated is that the rotation does not preserve centering of the rectangle in case where middle point is not actually located in the middle.
|
function Scale(const Scale: VectorFloat; const Centered: Boolean = True): TQuad; |
|
Rescales vertices of the given quadrilateral by provided coefficient, optionally centering them around zero origin.
|
class function Scaled(const Left, Top, Width, Height, Scale: VectorFloat; const Centered: Boolean = True): TQuad; static; |
|
Creates quadrilateral with the specified top left corner and the given dimensions, which are scaled by the provided coefficient.
|
function Transform(const Matrix: TMatrix3f): TQuad; |
|
Transforms (multiplies) vertices of given quadrilateral by the specified matrix.
|
Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.
|