Represents a rectangle on a cubemap face.
struct
|
CubemapFaceRect
|
implements
|
IEquatable<CubemapFaceRect>
|
The configurator object for this type.
public
static
property
|
Config
{
get
}
|
||
type
|
IConfigurator<CubemapFaceRect>
|
||
value
|
|
The configurator object. |
An
empty
cubemap
face
rectangle
at
coordinates
(0,0)
.
public
static
readonly
field
|
Zero
|
||
type
|
CubemapFaceRect
|
The cubemap face.
public
readonly
field
|
Face
|
||
type
|
CubemapFace
|
Height of cubemap face rectangle, in samples.
public
readonly
field
|
Height
|
||
type
|
int32
|
Is this cubemap face rectangle empty, i.e. it does not contain any samples?
public
property
|
IsEmpty
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
rectangle
is
empty,
false
if
not. |
public
property
|
Rect
{
get
}
|
||
type
|
Box2I
|
||
value
|
Width of cubemap face rectangle, in samples.
public
readonly
field
|
Width
|
||
type
|
int32
|
X-coordinate of top-left corner of cubemap face rectangle.
public
readonly
field
|
X1
|
||
type
|
int32
|
X-coordinate of bottom-right corner of cubemap face rectangle.
public
property
|
X2
{
get
}
|
||
type
|
int32
|
||
value
|
The coordinate. |
Y-coordinate of top-left corner of cubemap face rectangle.
public
readonly
field
|
Y1
|
||
type
|
int32
|
Y-coordinate of bottom-right corner of cubemap face rectangle.
public
property
|
Y2
{
get
}
|
||
type
|
int32
|
||
value
|
The coordinate. |
Creates a new instance of CubemapFaceRect.
public
constructor
|
CubemapFaceRect
(int32 x,
int32 y,
int32 width,
int32 height,
CubemapFace face = CubemapFace.NegZ)
|
||
params
|
x
|
X-coordinate of top-left corner of cubemap face rectangle. | |
y
|
Y-coordinate of top-left corner of cubemap face rectangle. | ||
width
|
[>=0]
|
Width of cubemap face rectangle. | |
height
|
[>=0]
|
Height of cubemap face rectangle. | |
face
|
Cubemap face of rectangle (see Cubemap). |
Transforms this cubemap face region.
[Pure]
|
||||
public
method
|
ApplyTransform
(Transform transform,
int32 n)
|
|||
type
|
CubemapFaceRect
|
|||
params
|
transform
|
The transformation to apply. | ||
n
|
Maximum cubemap coordinate. | |||
returns
|
The transformed cubemap face region. If this region is step-aligned, the transformed region will also be step-aligned. |
Remarks:
The transformation center is at (n/2; n/2).
Clips this cubemap face rectangle to the given width and height.
[Pure]
|
||||
public
method
|
Clip
(int32 width,
int32 height)
|
|||
type
|
CubemapFaceRect
|
|||
params
|
width
|
[>=0]
|
The width to clip to. | |
height
|
[>=0]
|
The height to clip to. | ||
returns
|
The resulting cubemap face rectangle. |
public
method
|
Equals
(CubemapFaceRect other)
|
||
type
|
bool
|
||
params
|
other
|
Creates a new instance of CubemapFaceRect from the given corner points.
[Pure]
|
||||
public
static
method
|
FromPoints
(int32 x1,
int32 y1,
int32 x2,
int32 y2,
CubemapFace face = CubemapFace.NegZ)
|
|||
type
|
CubemapFaceRect
|
|||
params
|
x1
|
X-coordinate of first corner point. | ||
y1
|
Y-coordinate of first corner point. | |||
x2
|
X-coordinate of second corner point. | |||
y2
|
Y-coordinate of second corner point. | |||
face
|
The cubemap face. Defaults to NegZ. | |||
returns
|
The cubemap face rectangle. |
public
override
method
|
GetHashCode
()
|
||
type
|
int32
|
Shifts the coordinates of this cubemap face rectangle.
[Pure]
|
||||
public
method
|
Shift
(int32 amount)
|
|||
type
|
CubemapFaceRect
|
|||
params
|
amount
|
The number of bits to shift leftwards. Specify a negative number for shifting rightwards. | ||
returns
|
The shifted rectangle. |
Aligns this cubemap face rectangle to the given sample step.
[Pure]
|
||||
public
method
|
StepAlign
(int32 step)
|
|||
type
|
CubemapFaceRect
|
|||
params
|
step
|
[pow2]
|
The step value. | |
returns
|
The aligned cubemap face rectangle. |
Remarks:
The returned cubemap face rectangle will contain only those sample of this rectangle that have coordinates which are divisible by the given step value (i.e. X1, Y1, X2 and Y2 are divisible by step).
Returns the height of this cubemap face rectangle when using the given sample step.
[Pure]
|
||||
public
method
|
StepHeight
(int32 step)
|
|||
type
|
int32
|
|||
params
|
step
|
[pow2]
|
The sample step. | |
returns
|
|
The rectangle height, in aligned sample steps. |
Returns the width of this cubemap face rectangle when using the given sample step.
[Pure]
|
||||
public
method
|
StepWidth
(int32 step)
|
|||
type
|
int32
|
|||
params
|
step
|
[pow2]
|
The sample step. | |
returns
|
|
The rectangle width, in aligned sample steps. |
Returns the cubemap coordinates of a sample in this rectangle.
[Pure]
|
||||
public
method
|
ToCube
(int32 x,
int32 y,
int32 n = MappingUtil.MaxSize,
int32 step = 1)
|
|||
type
|
Vec3I
|
|||
params
|
x
|
Local X-coordinate of sample in this rectangle. | ||
y
|
Local Y-coordinate of sample in this rectangle. | |||
n
|
Maximum cubemap coordinate. | |||
step
|
[>=1]
|
The
sample
step.
Defaults
to
1 . |
||
returns
|
The cubemap coordinates. |
Returns the cubemap face coordinates of a sample in this rectangle.
[Pure]
|
||||
public
method
|
ToFace
(int32 x,
int32 y,
int32 step = 1)
|
|||
type
|
CubemapFaceCoordsI
|
|||
params
|
x
|
Local X-coordinate of sample in this rectangle. | ||
y
|
Local Y-coordinate of sample in this rectangle. | |||
step
|
[>=1]
|
The
sample
step.
Defaults
to
1 . |
||
returns
|
The cubemap face coordinates. |
public
override
method
|
ToString
()
|
||
type
|
string
|
Wraps this cubemap face region along the cubemap face X-axis.
[Pure]
|
||||
public
method
|
WrapX
(int32 n,
bool edge,
out CubemapFaceRect wrapped,
out Vec2I xy)
|
|||
type
|
Transform
|
|||
params
|
n
|
Maximum cubemap coordinate. | ||
edge
|
Wrap around if region only touches a cubemap edge? | |||
wrapped
|
The cubemap face region part that lies on the wrapped cubemap face. Will be step-aligned if this region is step-aligned. | |||
xy
|
Local coordinates of the top-left sample of wrapped in this cubemap face region (see remarks). | |||
returns
|
The affine transformation to apply to wrapped in order to fit the samples into the corresponding region of this cubemap face rectangle. |
Remarks:
Before wrapping, this region is clipped to the following bounds (in the order given):
region.ToFace(xy.X, xy.Y, 1)
Wraps this cubemap face region along the cubemap face Y-axis.
[Pure]
|
||||
public
method
|
WrapY
(int32 n,
bool edge,
out CubemapFaceRect wrapped,
out Vec2I xy)
|
|||
type
|
Transform
|
|||
params
|
n
|
Maximum cubemap coordinate. | ||
edge
|
Wrap around if region only touches a cubemap edge? | |||
wrapped
|
The cubemap face region part that lies on the wrapped cubemap face. Will be step-aligned if this region is step-aligned. | |||
xy
|
Local coordinates of the top-left sample of wrapped in this cubemap face region (see remarks). | |||
returns
|
The affine transformation to apply to wrapped in order to fit the samples into the corresponding region of this cubemap face rectangle. |
Remarks:
Before wrapping, this region is clipped to the following bounds (in the order given):
region.ToFace(xy.X, xy.Y, 1)