Class Polygon

    Definition

    Namespace:
    Tizen.NUI.Physics2D.Chipmunk
    Assembly:
    Tizen.NUI.Physics2D.dll

    A polygon shape composed of connected vertices.

    public class Polygon : Shape
    Inheritance
    object
    Shape
    Polygon

    Constructors

    View Source

    Polygon(Body, IReadOnlyList<Vect>, Transform, double)

    A convex polygon shape. It's the slowest, but most flexible collision shape.

    Declaration
    public Polygon(Body body, IReadOnlyList<Vect> verts, Transform transform, double radius)
    Parameters
    Type Name Description
    Body body
    IReadOnlyList<><Vect> verts
    Transform transform
    double radius
    View Source

    Polygon(Body, Vect[], double)

    Allocate and initialize a polygon shape with rounded corners. The vertexes must be convex with a counter-clockwise winding.

    Declaration
    public Polygon(Body body, Vect[] verts, double radius)
    Parameters
    Type Name Description
    Body body
    Vect[] verts
    double radius

    Properties

    View Source

    Area

    Get and calculate the signed area of this polygon. Vertices specified such that they connect in a clockwise fashion (called winding) give a positive area measurement. This is probably backwards to what you might expect.

    Declaration
    public double Area { get; }
    Property Value
    Type Description
    double
    View Source

    Centroid

    Get and calculate the centroid of the polygon.

    Declaration
    public Vect Centroid { get; }
    Property Value
    Type Description
    Vect
    View Source

    Count

    Get the number of vertices in a polygon shape.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    View Source

    Radius

    Get the radius of the polygon.

    Declaration
    public double Radius { get; }
    Property Value
    Type Description
    double
    View Source

    Vertices

    Get the vertices of the polygon.

    Declaration
    public IReadOnlyList<Vect> Vertices { get; }
    Property Value
    Type Description
    IReadOnlyList<><Vect>

    Methods

    View Source

    AreaForPoly(IReadOnlyList<Vect>, double)

    Calculate the signed area of this polygon. Vertices specified such that they connect in a clockwise fashion (called winding) give a positive area measurement. This is probably backwards to what you might expect.

    Declaration
    public static double AreaForPoly(IReadOnlyList<Vect> vertices, double radius)
    Parameters
    Type Name Description
    IReadOnlyList<><Vect> vertices
    double radius
    Returns
    Type Description
    double
    View Source

    CentroidForPoly(IReadOnlyList<Vect>)

    Calculate the natural centroid of a polygon.

    Declaration
    public static Vect CentroidForPoly(IReadOnlyList<Vect> vertices)
    Parameters
    Type Name Description
    IReadOnlyList<><Vect> vertices
    Returns
    Type Description
    Vect
    View Source

    GetVertex(int)

    Get the ith vertex of a polygon shape.

    Declaration
    public Vect GetVertex(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    Vect
    View Source

    MomentForPolygon(double, IReadOnlyList<Vect>, Vect, double)

    Calculate the moment of inertia for a solid polygon shape assuming its center of gravity is at its centroid. The offset is added to each vertex.

    Declaration
    public static double MomentForPolygon(double mass, IReadOnlyList<Vect> vertices, Vect offset, double radius)
    Parameters
    Type Name Description
    double mass
    IReadOnlyList<><Vect> vertices
    Vect offset
    double radius
    Returns
    Type Description
    double

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    PolygonExtensions.SetRadius(Polygon, double)
    PolygonExtensions.SetVertexes(Polygon, Vect[], Transform)
    PolygonExtensions.SetVertexes(Polygon, Vect[])
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX