Class Segment

    Definition

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

    A line segment shape between two points, which is mainly useful when it behaves statically, though it can be beveled to give it thickness.

    public class Segment : Shape
    Inheritance
    object
    Shape
    Segment

    Constructors

    View Source

    Segment(Body, Vect, Vect, double)

    Create a line segment.

    Declaration
    public Segment(Body body, Vect a, Vect b, double radius)
    Parameters
    Type Name Description
    Body body

    The body to attach the segment to.

    Vect a

    The first endpoint of the segment.

    Vect b

    The second endpoint of the segment.

    double radius

    The thickness of the segment.

    Properties

    View Source

    A

    Get the first endpoint of the segment shape.

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

    Area

    Calculate the area of the segment, assuming a thickness has been provided. The area is calculated assuming the endpoints would be rounded, like a capsule.

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

    B

    Get the second endpoint of the segment shape.

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

    Normal

    Get the normal of the segment shape.

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

    Radius

    Get the segment radius.

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

    Methods

    View Source

    AreaForSegment(Vect, Vect, double)

    Calculate the area of a segment, assuming a thickness has been provided. The area is calculated assuming the endpoints would be rounded, like a capsule.

    Declaration
    public static double AreaForSegment(Vect a, Vect b, double radius)
    Parameters
    Type Name Description
    Vect a
    Vect b
    double radius
    Returns
    Type Description
    double
    View Source

    MomentForMass(double)

    Calculate the moment of inertia of the segment.

    Declaration
    public double MomentForMass(double mass)
    Parameters
    Type Name Description
    double mass
    Returns
    Type Description
    double
    View Source

    MomentForSegment(double, Vect, Vect, double)

    Calculate the moment of inertia for the line segment.

    Declaration
    public static double MomentForSegment(double mass, Vect a, Vect b, double radius)
    Parameters
    Type Name Description
    double mass
    Vect a
    Vect b
    double radius
    Returns
    Type Description
    double
    View Source

    SetNeighbors(Vect, Vect)

    Let Chipmunk know about the geometry of adjacent segments to avoid colliding with endcaps.

    Declaration
    public void SetNeighbors(Vect prev, Vect next)
    Parameters
    Type Name Description
    Vect prev
    Vect next

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    SegmentExtensions.SetEndpoints(Segment, Vect, Vect)
    SegmentExtensions.SetRadius(Segment, double)
    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