提交 8c7380a1 编写于 作者: W WestLangley

WebGLRenderer: Add .getScissor(), .getScissorTest() methods

上级 303c899f
......@@ -365,6 +365,16 @@
<h3>[method:number getPixelRatio]()</h3>
<p>Returns current device pixel ratio used.</p>
<h3>[method:Vector4 getScissor]( [param:Vector4 target] )</h3>
<p>
[page:Vector4 target] — the result will be copied into this Vector4.<br /><br />
Returns the scissor region.
</p>
<h3>[method:Boolean getScissorTest]()</h3>
<p>Returns *true* if scissor test is enabled; returns *false* otherwise.</p>
<h3>[method:Vector2 getSize]( [param:Vector2 target] )</h3>
<p>
[page:Vector2 target] — the result will be copied into this Vector2.<br /><br />
......
......@@ -227,11 +227,21 @@ export class WebGLRenderer implements Renderer {
*/
setViewport(x: Vector4 | number, y?: number, width?: number, height?: number): void;
/**
* Copies the scissor area into target.
*/
getScissor(target: Vector4): Vector4;
/**
* Sets the scissor area from (x, y) to (x + width, y + height).
*/
setScissor(x: number, y: number, width: number, height: number): void;
/**
* Returns true if scissor test is enabled; returns false otherwise.
*/
getScissorTest(): boolean;
/**
* Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.
*/
......
......@@ -466,6 +466,12 @@ function WebGLRenderer( parameters ) {
};
this.getScissor = function ( target ) {
return target.copy( _scissor );
};
this.setScissor = function ( x, y, width, height ) {
_scissor.set( x, y, width, height );
......@@ -473,6 +479,12 @@ function WebGLRenderer( parameters ) {
};
this.getScissorTest = function () {
return _scissorTest;
};
this.setScissorTest = function ( boolean ) {
state.setScissorTest( _scissorTest = boolean );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册