Jypeli 10
The simple game programming library
Jypeli.Physics2d.VertexHelper luokkareferenssi

Staattiset julkiset jäsenfunktiot

static Vector2D[] ApplyMatrix (ref Matrix2x3 matrix, Vector2D[] vertexes)
 
static Vector2D[][] ApplyMatrixToRange (ref Matrix2x3 matrix, Vector2D[][] polygons)
 
static Vector2D[] CenterVertexes (Vector2D[] vertexes)
 repositions the polygon so the Centroid is the origin. Lisää...
 
static Vector2D[][] CenterVertexesRange (Vector2D[][] polygons)
 
static Vector2D[] CreateCircle (Scalar radius, int vertexCount)
 
static Vector2D[] CreateFromBitmap (bool[,] bitmap)
 Takes a 2D Boolean array with a true value representing a collidable pixel and converts it to an array of vertex that surrounds that bitmap. The bitmap should be a single piece if there are many pieces it will only return the geometry of the first piece it comes across. Make sure there are at least 3 pixels in a piece otherwise an exception will be thrown (it wont be a polygon). Lisää...
 
static Vector2D[] CreateFromBitmap (IBitmap bitmap)
 
static Vector2D[][] CreateRangeFromBitmap (bool[,] bitmap)
 
static Vector2D[][] CreateRangeFromBitmap (IBitmap bitmap)
 
static Vector2D[] CreateRectangle (Scalar width, Scalar height)
 creates vertexes that describe a Rectangle. Lisää...
 
static Scalar GetArea (Vector2D[] vertexes)
 Calculates the area of a polygon. Lisää...
 
static Scalar GetAreaOfRange (Vector2D[][] polygons)
 
static Vector2D GetCentroid (Vector2D[] vertexes)
 Calculates the Centroid of a polygon. Lisää...
 
static Vector2D GetCentroidOfRange (Vector2D[][] polygons)
 
static Scalar GetInertia (Vector2D[] vertexes)
 Calculates the moment of inertia for a polygon Lisää...
 
static Scalar GetInertiaOfRange (Vector2D[][] polygons)
 
static Vector2D[] GetIntersection (Vector2D[] vertexes, Line line)
 
static Vector2D[] GetIntersection (Vector2D[] vertexes, Scalar radius)
 INCOMPLETE! TODO: FINISH Lisää...
 
static Vector2D[][] GetIntersectionOfRange (Vector2D[][] polygons, Line line)
 
static VertexInfo GetVertexInfo (Vector2D[] vertexes)
 
static VertexInfo GetVertexInfoOfRange (Vector2D[][] polygons)
 
static Vector2D[] GetVertexNormals (Vector2D[] vertexes)
 
static Vector2D[][] GetVertexNormalsOfRange (Vector2D[][] polygons)
 
static Vector2D[] Reduce (Vector2D[] vertexes)
 Reduces a Polygon's number of vertexes. Lisää...
 
static Vector2D[] Reduce (Vector2D[] vertexes, Scalar areaTolerance)
 Reduces a Polygon's number of vertexes. Lisää...
 
static Vector2D[][] ReduceRange (Vector2D[][] polygons)
 
static Vector2D[][] ReduceRange (Vector2D[][] polygons, Scalar areaTolerance)
 
static Vector2D[] Subdivide (Vector2D[] vertexes, Scalar maxLength)
 makes sure the distance between 2 vertexes is under the length passed, by adding vertexes between them. Lisää...
 
static Vector2D[] Subdivide (Vector2D[] vertexes, Scalar maxLength, bool loop)
 makes sure the distance between 2 vertexes is under the length passed, by adding vertexes between them. Lisää...
 
static Vector2D[][] SubdivideRange (Vector2D[][] polygons, Scalar maxLength)
 
static Vector2D[][] SubdivideRange (Vector2D[][] polygons, Scalar maxLength, bool loop)
 

Paketin staattiset funktiot

static void CalculateNormals (Vector2D[] vertexes, Vector2D[] normals, int offset)
 

Yksityiskohtainen selite

Määrittely tiedoston VertexHelper.cs rivillä 66.

Jäsenfunktioiden dokumentaatio

◆ ApplyMatrix()

static Vector2D[] Jypeli.Physics2d.VertexHelper.ApplyMatrix ( ref Matrix2x3  matrix,
Vector2D[]  vertexes 
)
static

◆ ApplyMatrixToRange()

static Vector2D[][] Jypeli.Physics2d.VertexHelper.ApplyMatrixToRange ( ref Matrix2x3  matrix,
Vector2D  polygons[][] 
)
static

Määrittely tiedoston VertexHelper.cs rivillä 72.

Viittaukset Jypeli.Physics2d.VertexHelper.ApplyMatrix().

◆ CalculateNormals()

static void Jypeli.Physics2d.VertexHelper.CalculateNormals ( Vector2D[]  vertexes,
Vector2D[]  normals,
int  offset 
)
staticpackage

◆ CenterVertexes()

static Vector2D[] Jypeli.Physics2d.VertexHelper.CenterVertexes ( Vector2D[]  vertexes)
static

repositions the polygon so the Centroid is the origin.

Parametrit
vertexesThe vertexes of the polygon.
Palauttaa
The vertexes of the polygon with the Centroid as the Origin.

Määrittely tiedoston VertexHelper.cs rivillä 507.

Viittaukset AdvanceMath.Geometry2D.BoundingPolygon.GetCentroid() ja AdvanceMath.Vector2D.Subtract().

◆ CenterVertexesRange()

static Vector2D[][] Jypeli.Physics2d.VertexHelper.CenterVertexesRange ( Vector2D  polygons[][])
static

◆ CreateCircle()

static Vector2D[] Jypeli.Physics2d.VertexHelper.CreateCircle ( Scalar  radius,
int  vertexCount 
)
static

◆ CreateFromBitmap() [1/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.CreateFromBitmap ( bool  bitmap[,])
static

Takes a 2D Boolean array with a true value representing a collidable pixel and converts it to an array of vertex that surrounds that bitmap. The bitmap should be a single piece if there are many pieces it will only return the geometry of the first piece it comes across. Make sure there are at least 3 pixels in a piece otherwise an exception will be thrown (it wont be a polygon).

Parametrit
bitmapa bitmap to be converted. true means its collidable.
Palauttaa
A Vector2D[] representing the bitmap.

Määrittely tiedoston VertexHelper.cs rivillä 92.

Viittaukset Jypeli.Physics2d.VertexHelper.CreateFromBitmap().

Viitattu Jypeli.Physics2d.VertexHelper.CreateFromBitmap().

◆ CreateFromBitmap() [2/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.CreateFromBitmap ( IBitmap  bitmap)
static

◆ CreateRangeFromBitmap() [1/2]

static Vector2D[][] Jypeli.Physics2d.VertexHelper.CreateRangeFromBitmap ( bool  bitmap[,])
static

◆ CreateRangeFromBitmap() [2/2]

static Vector2D[][] Jypeli.Physics2d.VertexHelper.CreateRangeFromBitmap ( IBitmap  bitmap)
static

◆ CreateRectangle()

static Vector2D[] Jypeli.Physics2d.VertexHelper.CreateRectangle ( Scalar  width,
Scalar  height 
)
static

creates vertexes that describe a Rectangle.

Parametrit
width
heightThe length of the Rectangle
Palauttaa
array of vectors the describe a rectangle

Määrittely tiedoston VertexHelper.cs rivillä 118.

◆ GetArea()

static Scalar Jypeli.Physics2d.VertexHelper.GetArea ( Vector2D[]  vertexes)
static

Calculates the area of a polygon.

Parametrit
vertexesThe vertexes of the polygon.
Palauttaa
The area.

Määrittely tiedoston VertexHelper.cs rivillä 482.

Viittaukset AdvanceMath.Geometry2D.BoundingPolygon.GetArea().

◆ GetAreaOfRange()

static Scalar Jypeli.Physics2d.VertexHelper.GetAreaOfRange ( Vector2D  polygons[][])
static

Määrittely tiedoston VertexHelper.cs rivillä 524.

Viittaukset AdvanceMath.Geometry2D.BoundingPolygon.GetArea().

◆ GetCentroid()

static Vector2D Jypeli.Physics2d.VertexHelper.GetCentroid ( Vector2D[]  vertexes)
static

Calculates the Centroid of a polygon.

Parametrit
vertexesThe vertexes of the polygon.
Palauttaa
The Centroid of a polygon.

This is Also known as Center of Gravity/Mass.

Määrittely tiedoston VertexHelper.cs rivillä 496.

Viittaukset AdvanceMath.Geometry2D.BoundingPolygon.GetCentroid().

◆ GetCentroidOfRange()

static Vector2D Jypeli.Physics2d.VertexHelper.GetCentroidOfRange ( Vector2D  polygons[][])
static

◆ GetInertia()

static Scalar Jypeli.Physics2d.VertexHelper.GetInertia ( Vector2D[]  vertexes)
static

Calculates the moment of inertia for a polygon

Parametrit
vertexes
Palauttaa
the moment of inertia

Määrittely tiedoston VertexHelper.cs rivillä 150.

Viittaukset AdvanceMath.Geometry2D.BoundingPolygon.GetInertia().

◆ GetInertiaOfRange()

static Scalar Jypeli.Physics2d.VertexHelper.GetInertiaOfRange ( Vector2D  polygons[][])
static

Määrittely tiedoston VertexHelper.cs rivillä 154.

Viittaukset AdvanceMath.Vector2D.Dot() ja AdvanceMath.Vector2D.ZCross().

◆ GetIntersection() [1/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.GetIntersection ( Vector2D[]  vertexes,
Line  line 
)
static

◆ GetIntersection() [2/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.GetIntersection ( Vector2D[]  vertexes,
Scalar  radius 
)
static

INCOMPLETE! TODO: FINISH

Parametrit
vertexes
radius
Palauttaa

Määrittely tiedoston VertexHelper.cs rivillä 191.

Viittaukset AdvanceMath.Vector2D.Add(), AdvanceMath.Vector2D.Lerp(), AdvanceMath.Vector2D.Magnitude ja AdvanceMath.Vector2D.ToArray().

Viitattu Jypeli.Physics2d.VertexHelper.GetIntersectionOfRange().

◆ GetIntersectionOfRange()

static Vector2D[][] Jypeli.Physics2d.VertexHelper.GetIntersectionOfRange ( Vector2D  polygons[][],
Line  line 
)
static

Määrittely tiedoston VertexHelper.cs rivillä 514.

Viittaukset Jypeli.Physics2d.VertexHelper.GetIntersection().

◆ GetVertexInfo()

static VertexInfo Jypeli.Physics2d.VertexHelper.GetVertexInfo ( Vector2D[]  vertexes)
static

◆ GetVertexInfoOfRange()

static VertexInfo Jypeli.Physics2d.VertexHelper.GetVertexInfoOfRange ( Vector2D  polygons[][])
static

◆ GetVertexNormals()

static Vector2D[] Jypeli.Physics2d.VertexHelper.GetVertexNormals ( Vector2D[]  vertexes)
static

◆ GetVertexNormalsOfRange()

static Vector2D[][] Jypeli.Physics2d.VertexHelper.GetVertexNormalsOfRange ( Vector2D  polygons[][])
static

Määrittely tiedoston VertexHelper.cs rivillä 328.

Viittaukset Jypeli.Physics2d.VertexHelper.GetVertexNormals().

◆ Reduce() [1/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.Reduce ( Vector2D[]  vertexes)
static

Reduces a Polygon's number of vertexes.

Parametrit
vertexesThe Polygon to reduce.
Palauttaa
The reduced vertexes.

Määrittely tiedoston VertexHelper.cs rivillä 434.

Viittaukset Jypeli.Physics2d.VertexHelper.Reduce().

Viitattu Jypeli.Physics2d.VertexHelper.Reduce() ja Jypeli.Physics2d.VertexHelper.ReduceRange().

◆ Reduce() [2/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.Reduce ( Vector2D[]  vertexes,
Scalar  areaTolerance 
)
static

Reduces a Polygon's number of vertexes.

Parametrit
vertexesThe Polygon to reduce.
areaToleranceThe amount the removal of a vertex is allowed to change the area of the polygon. (Setting this value to 0 will reverse what the Subdivide method does)
Palauttaa
The reduced vertexes.

Määrittely tiedoston VertexHelper.cs rivillä 447.

Viittaukset AdvanceMath.Vector2D.ZCross().

◆ ReduceRange() [1/2]

static Vector2D[][] Jypeli.Physics2d.VertexHelper.ReduceRange ( Vector2D  polygons[][])
static

◆ ReduceRange() [2/2]

static Vector2D[][] Jypeli.Physics2d.VertexHelper.ReduceRange ( Vector2D  polygons[][],
Scalar  areaTolerance 
)
static

Määrittely tiedoston VertexHelper.cs rivillä 588.

Viittaukset Jypeli.Physics2d.VertexHelper.Reduce().

◆ Subdivide() [1/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.Subdivide ( Vector2D[]  vertexes,
Scalar  maxLength 
)
static

makes sure the distance between 2 vertexes is under the length passed, by adding vertexes between them.

Parametrit
vertexesthe original vertexes.
maxLengththe maximum distance allowed between 2 vertexes
Palauttaa
The new vertexes.

Määrittely tiedoston VertexHelper.cs rivillä 380.

Viittaukset Jypeli.Physics2d.VertexHelper.Subdivide().

Viitattu Jypeli.Physics2d.VertexHelper.Subdivide() ja Jypeli.Physics2d.VertexHelper.SubdivideRange().

◆ Subdivide() [2/2]

static Vector2D[] Jypeli.Physics2d.VertexHelper.Subdivide ( Vector2D[]  vertexes,
Scalar  maxLength,
bool  loop 
)
static

makes sure the distance between 2 vertexes is under the length passed, by adding vertexes between them.

Parametrit
vertexesthe original vertexes.
maxLengththe maximum distance allowed between 2 vertexes
loopif it should check the distance between the first and last vertex.
Palauttaa
The new vertexes.

Määrittely tiedoston VertexHelper.cs rivillä 391.

Viittaukset AdvanceMath.Vector2D.CopyTo(), AdvanceMath.Vector2D.Magnitude ja AdvanceMath.Vector2D.Multiply().

◆ SubdivideRange() [1/2]

static Vector2D[][] Jypeli.Physics2d.VertexHelper.SubdivideRange ( Vector2D  polygons[][],
Scalar  maxLength 
)
static

◆ SubdivideRange() [2/2]

static Vector2D[][] Jypeli.Physics2d.VertexHelper.SubdivideRange ( Vector2D  polygons[][],
Scalar  maxLength,
bool  loop 
)
static

Määrittely tiedoston VertexHelper.cs rivillä 602.

Viittaukset Jypeli.Physics2d.VertexHelper.Subdivide().


Dokumentaatio tälle luokalle luotiin seuraavasta tiedostosta: