mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
Javadocs
This commit is contained in:
parent
4c487f38c6
commit
9f4def5b40
@ -94,12 +94,12 @@ public class SkeletonBounds {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>Returns true if the axis aligned bounding box contains the point.</summary>
|
/** Returns true if the axis aligned bounding box contains the point. */
|
||||||
public function aabbContainsPoint (x:Number, y:Number) : Boolean {
|
public function aabbContainsPoint (x:Number, y:Number) : Boolean {
|
||||||
return x >= minX && x <= maxX && y >= minY && y <= maxY;
|
return x >= minX && x <= maxX && y >= minY && y <= maxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Returns true if the axis aligned bounding box intersects the line segment.</summary>
|
/** Returns true if the axis aligned bounding box intersects the line segment. */
|
||||||
public function aabbIntersectsSegment (x1:Number, y1:Number, x2:Number, y2:Number) : Boolean {
|
public function aabbIntersectsSegment (x1:Number, y1:Number, x2:Number, y2:Number) : Boolean {
|
||||||
if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))
|
if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))
|
||||||
return false;
|
return false;
|
||||||
@ -115,21 +115,21 @@ public class SkeletonBounds {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds.</summary>
|
/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */
|
||||||
public function aabbIntersectsSkeleton (bounds:SkeletonBounds) : Boolean {
|
public function aabbIntersectsSkeleton (bounds:SkeletonBounds) : Boolean {
|
||||||
return minX < bounds.maxX && maxX > bounds.minX && minY < bounds.maxY && maxY > bounds.minY;
|
return minX < bounds.maxX && maxX > bounds.minX && minY < bounds.maxY && maxY > bounds.minY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more
|
/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more
|
||||||
/// efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true.</summary>
|
* efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */
|
||||||
public function containsPoint (x:Number, y:Number) : BoundingBoxAttachment {
|
public function containsPoint (x:Number, y:Number) : BoundingBoxAttachment {
|
||||||
for (var i:int = 0, n:int = polygons.length; i < n; i++)
|
for (var i:int = 0, n:int = polygons.length; i < n; i++)
|
||||||
if (polygons[i].containsPoint(x, y)) return boundingBoxes[i];
|
if (polygons[i].containsPoint(x, y)) return boundingBoxes[i];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually
|
/** Returns the first bounding box attachment that contains the line segment, or null. When doing many checks, it is usually
|
||||||
/// more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true.</summary>
|
* more efficient to only call this method if {@link #aabbIntersectsSegment(float, float, float, float)} returns true. */
|
||||||
public function intersectsSegment (x1:Number, y1:Number, x2:Number, y2:Number) : BoundingBoxAttachment {
|
public function intersectsSegment (x1:Number, y1:Number, x2:Number, y2:Number) : BoundingBoxAttachment {
|
||||||
for (var i:int = 0, n:int = polygons.length; i < n; i++)
|
for (var i:int = 0, n:int = polygons.length; i < n; i++)
|
||||||
if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return boundingBoxes[i];
|
if (polygons[i].intersectsSegment(x1, y1, x2, y2)) return boundingBoxes[i];
|
||||||
|
|||||||
@ -136,7 +136,7 @@ public class SkeletonBounds {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if the bounding box attachment contains the point. */
|
/** Returns true if the polygon contains the point. */
|
||||||
public boolean containsPoint (FloatArray polygon, float x, float y) {
|
public boolean containsPoint (FloatArray polygon, float x, float y) {
|
||||||
float[] vertices = polygon.items;
|
float[] vertices = polygon.items;
|
||||||
int nn = polygon.size;
|
int nn = polygon.size;
|
||||||
@ -164,7 +164,7 @@ public class SkeletonBounds {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if the bounding box attachment contains the line segment. */
|
/** Returns true if the polygon contains the line segment. */
|
||||||
public boolean intersectsSegment (FloatArray polygon, float x1, float y1, float x2, float y2) {
|
public boolean intersectsSegment (FloatArray polygon, float x1, float y1, float x2, float y2) {
|
||||||
float[] vertices = polygon.items;
|
float[] vertices = polygon.items;
|
||||||
int nn = polygon.size;
|
int nn = polygon.size;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user