CUGL 2.3
Cornell University Game Library
Loading...
Searching...
No Matches
Enumerations
cugl::poly2 Namespace Reference

Enumerations

enum class  Joint : int { MITRE = 0 , SQUARE = 1 , ROUND = 2 }
 
enum class  EndCap : int { BUTT = 0 , SQUARE = 1 , ROUND = 2 }
 
enum class  Traversal : int { NONE = 0 , OPEN = 1 , CLOSED = 2 , INTERIOR = 3 }
 
enum class  Capsule { DEGENERATE = 0 , FULL = 1 , HALF = 2 , HALF_REVERSE = 3 }
 

Detailed Description

Enumerations for the polygon factories.

This namespace is a collection of enumerations for the various polygon tools like EarclipTriangulator. We gather them together in one place so that they may be used in multiple classes. For example, we have multiple triangulator and extruder classes. Therefore, the enumerations should not be tied to any one class.

Enumeration Type Documentation

◆ Capsule

enum class cugl::poly2::Capsule
strong

This enum specifies a capsule shape

A capsule is a box with semicircular ends along the major axis. They are a popular physics object, particularly for character avatars. The rounded ends means they are less likely to snag, and they naturally fall off platforms when they go too far.

Sometimes we only want half a capsule (so a semicircle at one end, but not both). This enumeration allows us to specify the exact capsule we want. This enumeration is used by both PolyFactory and the physics class physics2::CapsuleObstacle.

Enumerator
DEGENERATE 

A degenerate capsule (e.g. an ellipse)

Any capsule with width and height the same is degenerate.

FULL 

A full capsule with round ends on the major axis.

This type assumes that there is a major axis (e.g. that width and height are not the same).

HALF 

A half capsule with a rounded end on the default side.

The default side is the left if the major axis is x, and the bottom if the major axis is y. This type assumes that there is a major axis (e.g. that width and height are not the same).

HALF_REVERSE 

A half capsule with a rounded end on the side opposite the default.

The opposite side is the right if the major axis is x, and the top if the major axis is y. This type assumes that there is a major axis (e.g. that width and height are not the same).

◆ EndCap

enum class cugl::poly2::EndCap : int
strong

The types of caps supported in an extrusion.

A cap is the rule for how to end an extruded line segment that has no neighbor on that end. If there is no cap, the path terminates at the end vertices.

This enumeration is used by SimpleExtruder, ComplexExtruder, and scene2::PathNode.

Enumerator
BUTT 

No end cap; the path terminates at the end vertices (DEFAULT)

SQUARE 

Square cap; like no cap, except the ends are padded by stroke width

ROUND 

Round cap; the ends are half circles whose radius is the stroke width

◆ Joint

enum class cugl::poly2::Joint : int
strong

The types of joints supported in an extrusion.

A joint is the rule for how to connect two extruded line segments. If there is not joint, the path will look like a sequence of overlapping rectangles.

This enumeration is used by SimpleExtruder, ComplexExtruder, and scene2::PathNode.

Enumerator
MITRE 

Mitre joint; ideal for paths with sharp corners

SQUARE 

Bevel joint; ideal for smoother paths (DEFAULT)

ROUND 

Round joint; used to smooth out paths with sharp corners

◆ Traversal

enum class cugl::poly2::Traversal : int
strong

This enum lists the types of path traversal that are supported.

This enumeration is used by both PolyFactory and scene2::WireNode.

Enumerator
NONE 

No traversal; the index list will be empty.

OPEN 

Traverse the border, but do not close the ends.

CLOSED 

Traverse the border, and close the ends.

INTERIOR 

Traverse the individual triangles in the standard tesselation.