new SVGSkin(idnon-null, renderernon-null)
Create a new SVG skin.
Parameters:
Name | Type | Description |
---|---|---|
id |
int | The ID for this Skin. |
renderer |
RenderWebGL | The renderer which will use this skin. |
Extends
Members
_id :int
- Inherited From:
Type:
- int
_renderer :RenderWebGL
Type:
_rotationCenter :Vec3
- Inherited From:
Type:
- Vec3
_svgRenderer :SvgRenderer
Type:
_texture :WebGLTexture
Type:
- WebGLTexture
(private) _uniforms :Object.<string, *>
- Inherited From:
The uniforms to be used by the vertex and pixel shaders. Some of these are used by other parts of the renderer as well.
Type:
- Object.<string, *>
id
- Inherited From:
rotationCenter
- Inherited From:
size
- Overrides:
Methods
calculateRotationCenter() → {Array.<number>}
- Inherited From:
Get the center of the current bounding box
Returns:
the center of the current bounding box
- Type
- Array.<number>
dispose()
- Overrides:
Dispose of this object. Do not use it after calling this method.
getTexture(scale) → {WebGLTexture}
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<number> | The scaling factors to be used. |
Returns:
The GL texture representation of this skin when drawing at the given scale.
- Type
- WebGLTexture
getUniforms(scale) → {object.<string, *>}
- Inherited From:
Update and returns the uniforms for this skin.
Parameters:
Name | Type | Description |
---|---|---|
scale |
Array.<number> | The scaling factors to be used. |
Returns:
the shader uniforms to be used when rendering with this Skin.
- Type
- object.<string, *>
setRotationCenter(x, y)
- Overrides:
Set the origin, in object space, about which this Skin should rotate.
Parameters:
Name | Type | Description |
---|---|---|
x |
number | The x coordinate of the new rotation center. |
y |
number | The y coordinate of the new rotation center. |
setSVG(svgData, rotationCenteropt)
Set the contents of this skin to a snapshot of the provided SVG data.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
svgData |
string | new SVG to use. |
|
rotationCenter |
Array.<number> |
<optional> |
Optional rotation center for the SVG. If not supplied, it will be calculated from the bounding box |