TextureConverter
Declaration
public sealed class tainicom.Aether.Physics2D.Common.TextureTools.TextureConverter
Constructors
TextureConverter
void TextureConverter()
TextureConverter
void TextureConverter(byte? alphaTolerance, float? hullTolerance, bool? holeDetection, bool? multipartDetection, bool? pixelOffsetOptimization, Matrix4? transform)
Parameters:
| Name | Type | Description |
|---|---|---|
alphaTolerance |
System.Byte? |
|
hullTolerance |
System.Single? |
|
holeDetection |
System.Boolean? |
|
multipartDetection |
System.Boolean? |
|
pixelOffsetOptimization |
System.Boolean? |
|
transform |
Strawberry.Math.Matrix4? |
TextureConverter
void TextureConverter(uint[] data, int width)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
System.UInt32[] |
|
width |
System.Int32 |
TextureConverter
void TextureConverter(uint[] data, int width, byte? alphaTolerance, float? hullTolerance, bool? holeDetection, bool? multipartDetection, bool? pixelOffsetOptimization, Matrix4? transform)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
System.UInt32[] |
|
width |
System.Int32 |
|
alphaTolerance |
System.Byte? |
|
hullTolerance |
System.Single? |
|
holeDetection |
System.Boolean? |
|
multipartDetection |
System.Boolean? |
|
pixelOffsetOptimization |
System.Boolean? |
|
transform |
Strawberry.Math.Matrix4? |
Properties
PolygonDetectionType
Get or set the polygon detection type.
VerticesDetectionType PolygonDetectionType { get set }
HoleDetection
Will detect texture 'holes' if set to true. Slows down the detection. Default is false.
bool HoleDetection { get set }
MultipartDetection
Will detect texture multiple 'solid' isles if set to true. Slows down the detection. Default is false.
bool MultipartDetection { get set }
PixelOffsetOptimization
Will optimize the vertex positions along the interpolated normal between two edges about a half pixel (post processing). Default is false.
bool PixelOffsetOptimization { get set }
Transform
Can be used for scaling.
Matrix4 Transform { get set }
AlphaTolerance
Alpha (coverage) tolerance. Default is 20: Every pixel with a coverage value equal or greater to 20 will be counts as solid.
byte AlphaTolerance { get set }
HullTolerance
Default is 1.5f.
float HullTolerance { get set }
Methods
DetectVertices static
Detects the vertices of the supplied texture data. (PolygonDetectionType.Integrated)
Vertices DetectVertices(uint[] data, int width)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
System.UInt32[] |
The texture data. |
width |
System.Int32 |
The texture width. |
DetectVertices static
Detects the vertices of the supplied texture data.
Vertices DetectVertices(uint[] data, int width, bool holeDetection)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
System.UInt32[] |
The texture data. |
width |
System.Int32 |
The texture width. |
holeDetection |
System.Boolean |
if set to true it will perform hole detection. |
DetectVertices static
Detects the vertices of the supplied texture data.
List<Vertices> DetectVertices(uint[] data, int width, float hullTolerance, byte alphaTolerance, bool multiPartDetection, bool holeDetection)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
System.UInt32[] |
The texture data. |
width |
System.Int32 |
The texture width. |
hullTolerance |
System.Single |
The hull tolerance. |
alphaTolerance |
System.Byte |
The alpha tolerance. |
multiPartDetection |
System.Boolean |
if set to true it will perform multi part detection. |
holeDetection |
System.Boolean |
if set to true it will perform hole detection. |
DetectVertices
List<Vertices> DetectVertices()
IsSolid
bool IsSolid(ref Vector2 v)
Parameters:
| Name | Type | Description |
|---|---|---|
v |
ref Strawberry.Math.Vector2 |
IsSolid
bool IsSolid(ref int x, ref int y)
Parameters:
| Name | Type | Description |
|---|---|---|
x |
ref System.Int32 |
|
y |
ref System.Int32 |
IsSolid
bool IsSolid(ref int index)
Parameters:
| Name | Type | Description |
|---|---|---|
index |
ref System.Int32 |
InBounds
bool InBounds(ref Vector2 coord)
Parameters:
| Name | Type | Description |
|---|---|---|
coord |
ref Strawberry.Math.Vector2 |