uPano  v3.1
InfinityCode.uPano.RotatableRectUV Struct Reference

Rotatable UV of texture side More...

Public Types

enum  Rotation { Rotation.rotation0, Rotation.rotation90, Rotation.rotation180, Rotation.rotation270 }
 Enum of rotation angles More...
 

Public Member Functions

 RotatableRectUV (float left, float top, float right, float bottom, Rotation rotation=Rotation.rotation0)
 Constructor More...
 
bool Contain (Vector2 uv)
 Checks the current rect contains this UV More...
 
Vector2 GetUVBilinear (float rx, float ry)
 Returns UV at normalized coordinates for this rect More...
 
Vector3 GetWorldPosition (Vector2 uv, CubeSide cubeSide)
 Converts UV to Unity World Position on the side of the cube with the size (2, 2, 2) More...
 
void SetUVToArray (Vector2[] uv, int index)
 Sets UV values in the array More...
 

Public Attributes

float left
 Left texture U More...
 
float top
 Top texture V More...
 
float right
 Right texture U More...
 
float bottom
 Bottom texture V More...
 
Rotation rotation
 Rotation of UV More...
 

Properties

static RotatableRectUV full [get]
 UV whole texture More...
 
float height [get]
 Height of texture V More...
 
float width [get]
 Width of texture U More...
 
float this[int index] [get, set]
 Get and set side by index More...
 

Detailed Description

Rotatable UV of texture side

Member Enumeration Documentation

◆ Rotation

Enum of rotation angles

Enumerator
rotation0 

0 degrees

rotation90 

90 degrees

rotation180 

180 degrees

rotation270 

270 degrees

Constructor & Destructor Documentation

◆ RotatableRectUV()

InfinityCode.uPano.RotatableRectUV.RotatableRectUV ( float  left,
float  top,
float  right,
float  bottom,
Rotation  rotation = Rotation.rotation0 
)

Constructor

Parameters
leftLeft texture U
topTop texture V
rightRight texture U
bottomBottom texture V
rotationRotation of UV

Member Function Documentation

◆ Contain()

bool InfinityCode.uPano.RotatableRectUV.Contain ( Vector2  uv)

Checks the current rect contains this UV

Parameters
uvUV
Returns
True - current rect contains UV, false - otherwise

◆ GetUVBilinear()

Vector2 InfinityCode.uPano.RotatableRectUV.GetUVBilinear ( float  rx,
float  ry 
)

Returns UV at normalized coordinates for this rect

Parameters
rxRelative X (0-1)
ryRelative Y (0-1)
Returns
UV

◆ GetWorldPosition()

Vector3 InfinityCode.uPano.RotatableRectUV.GetWorldPosition ( Vector2  uv,
CubeSide  cubeSide 
)

Converts UV to Unity World Position on the side of the cube with the size (2, 2, 2)

Parameters
uvUV
cubeSideSide of the cube
Returns
Unity World Position

◆ SetUVToArray()

void InfinityCode.uPano.RotatableRectUV.SetUVToArray ( Vector2[]  uv,
int  index 
)

Sets UV values in the array

Parameters
uvArray of UV values
indexStart index

Member Data Documentation

◆ bottom

float InfinityCode.uPano.RotatableRectUV.bottom

Bottom texture V

◆ left

float InfinityCode.uPano.RotatableRectUV.left

Left texture U

◆ right

float InfinityCode.uPano.RotatableRectUV.right

Right texture U

◆ rotation

Rotation InfinityCode.uPano.RotatableRectUV.rotation

Rotation of UV

◆ top

float InfinityCode.uPano.RotatableRectUV.top

Top texture V

Property Documentation

◆ full

RotatableRectUV InfinityCode.uPano.RotatableRectUV.full
staticget

UV whole texture

◆ height

float InfinityCode.uPano.RotatableRectUV.height
get

Height of texture V

◆ this[int index]

float InfinityCode.uPano.RotatableRectUV.this[int index]
getset

Get and set side by index

Parameters
indexIndex of side
Returns
Value of the side

◆ width

float InfinityCode.uPano.RotatableRectUV.width
get

Width of texture U