User Tools

Site Tools


2d_geometric_shapes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
2d_geometric_shapes [2022/10/03 17:01]
max created
2d_geometric_shapes [2022/10/03 17:08] (current)
max [Oriented Rectangle]
Line 2: Line 2:
  
 Currently, there is support for: Currently, there is support for:
-  * Circle (2D) +  * Circle 
-  * Point (2D, a typedef of [[Vector2]] ) +  * Point (a typedef of [[2D Vector]]) 
-  * Line (2D) +  * Line 
-  * Rectangle (2D) +  * Rectangle 
-  * Oriented Rectangle (2D)+  * Oriented Rectangle 
  
 ===== Line ===== ===== Line =====
-A line consists of a start and end variable, each are Point2D instances.+A line consists of a ''start'' and ''end'' variable, each are Point2D instances.
 For convienence, the following functions are present: For convienence, the following functions are present:
-  * Length() +  * ''Length()'' 
-  * LengthFast(), which returns the distance without performing the final, expensive sqrtf function. +  * ''LengthFast()'', which returns the distance without performing the final, expensive sqrtf function. 
  
 ===== Circle ===== ===== Circle =====
  
-A 2D circle consists of a radius and a origin (Point2D). +A 2D circle consists of a ''radius'' and a ''origin'' (Point2D). 
 It has no other special features in it's own class.  It has no other special features in it's own class. 
 +
 +===== Rectangle =====
 +A 2D rectangle consists of an ''origin'', (Point2D) and a ''size'' (Vector2).
 +
 +A helper constructor is also given, named ''InitializeWithMinAndMax'' which takes 2 Point2D variables and will initialize the Rectangle for you. 
 +
 +Additionally, this class also has the following helper functions:
 +  * ''GetMin()''
 +  * ''GetMax()''
 +
 +
 +===== Oriented Rectangle =====
 +Unlike the regular 2D Rectangle, an oriented Rectangle can be, as the name suggests, rotated. 
 +
 +As such, it is constructed with it's ''position'' (Point2D) and ''halfExtents'' (Vector2).
 +
 +If you wish, you are also capable of immediately constructing it with rotation, by giving the same variables as above, but with an additional ''rotation'' variable (float).
  
2d_geometric_shapes.1664816497.txt.gz · Last modified: 2022/10/03 17:01 by max