Class SpiderGL.Space.DepthRangeStack
The SpiderGL.Space.ViewportStack is a stack for viewport rectangles.
- Defined in: space.js
- Extends SpiderGL.Core.ObjectBase
Constructor Attributes | Constructor Name and Description |
---|---|
SpiderGL.Space.DepthRangeStack(onChange)
Creates a SpiderGL.Space.ViewportStack.
|
Field Attributes | Field Name and Description |
---|---|
<readonly> |
Gets a copy of the matrix at the top of the stack.
|
<readonly> |
Gets a reference to the matrix at the top of the stack.
|
<readonly> |
Gets the stack depth
Initially, the stack contains an identity matrix, so its depth is one.
|
<readonly> |
Alias for #rect.
|
<readonly> |
Alias for #rect$.
|
- Fields borrowed from class SpiderGL.Core.ObjectBase:
- uid
Method Summary
Method Attributes | Method Name and Description |
---|---|
inner(m)
Post-multiplies the matrix at the top with the passed matrix
The matrix a at the top will be replaced by a * m.
|
|
load(m)
Replaces the matrix at the top with a clone of the passed matrix.
|
|
Replaces the matrix at the top with an identity matrix.
|
|
pop()
Pops the stack.
|
|
push()
Pushes into the stack the range at its top.
|
|
reset()
Resets the stack.
|
Event Attributes | Event Name and Description |
---|---|
onChange()
Gets/Sets the callback invoked whenever the top rectangle changes.
|
Class Detail
SpiderGL.Space.DepthRangeStack(onChange)
Creates a SpiderGL.Space.ViewportStack.
SpiderGL.Space.ViewportStack is a stack for viewport rectangles, specified with lower and left coordinates, width and height.
Initially, the stack depth is one and contains a rectangle with lower-eft coordinates equal to zero and width and height equal to one, that is, the array [0, 0, 1, 1].
Every method or getter to access the top rectangle returns a copy of the internal rectangle.
For performance reasons, variants of the above accessors (having the same identifier with the postfix "$" appended) that return a reference to the internal rectangle are also present.
var s = new SpiderGL.Space.ViewportStack(); var dw = width / nx; var dh = height / ny; s.load(x, y, width, height); for (var x=0; x
- Parameters:
- {function(this)} onChange Optional
- A callback function called whenever the stack is modified.
- See:
- reset
- SpiderGL.Space.TransformationStack
Field Detail
<readonly>
{array}
range
Gets a copy of the matrix at the top of the stack.
Initially, the stack has depth one and contains an identity matrix.
- See:
- #matrix$
<readonly>
{array}
range$
Gets a reference to the matrix at the top of the stack.
The returned array MUST NOT be changed.
Initially, the stack has depth one and contains an identity matrix.
- See:
- #matrix
<readonly>
{number}
size
Gets the stack depth
Initially, the stack contains an identity matrix, so its depth is one.
<readonly>
{array}
top
Alias for #rect.
- See:
- #top$
- #rect
<readonly>
{array}
top$
Alias for #rect$.
- See:
- #top
- #rect$
Method Detail
-
inner(m)Post-multiplies the matrix at the top with the passed matrix The matrix a at the top will be replaced by a * m.
- Parameters:
- {array} m
- The matrix to post-multiply.
- See:
- #load
-
load(m)Replaces the matrix at the top with a clone of the passed matrix.
- Parameters:
- {array} m
- The matrix to push on the stack. The matrix actually pushed is a clone of m.
- See:
- #loadIdentity
- #multiply
- SpiderGL.Math.Mat4.dup
-
loadIdentity()Replaces the matrix at the top with an identity matrix.
- See:
- #load
- #multiply
- SpiderGL.Math.Mat4.identity
- SpiderGL.Math.Mat4.identity$
-
pop()Pops the stack. After a pop operation, the stack depth is decremented by one. Nothing is done if the stack has only one element.
- See:
- #push
-
push()Pushes into the stack the range at its top. After a push operation, the stack depth is incremented by one and the two rectangle at its top are identical. There is no limit on the depth the stack can reach.
- See:
- #pop
-
reset()Resets the stack. The stack is reset to its initial state, that is, a stack with depth one containing the identity rectangle, that is, [0, 0, 1, 1].
- See:
- #loadIdentity
Event Detail
onChange()
Gets/Sets the callback invoked whenever the top rectangle changes.
Initially, no callback is defined.