CUGL 2.0
Cornell University Game Library
Enumerations
cugl::poly2 Namespace Reference

Enumerations

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

Detailed Description

Enumerations for the polygon factories.

This namespace is a collection of enumerations for the various polygon tools like SimpleTriangulator. 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 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 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
NONE 

No end cap; the path terminates at the end vertices

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 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
NONE 

No joint; the path will look like a sequence of links

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 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.