Namespace: Renderer

sap.ve.dvl~ Renderer

Methods

(static) AttachScene(sceneId, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Attaches a scene that will be displayed through this interface.
Parameters:
Name Type Attributes Description
sceneId string Scene token.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) BeginGesture(x, y, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Begins a gesture by computing target hit point, touch direction etc. Should be called at the beginning of each gesture.
Parameters:
Name Type Attributes Description
x number Horizontal coordinate in device pixels.
y number Vertical coordinate in device pixels.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) CanIsolateNode(dvlId, rendererIdopt) → {boolean}

Checks if the provided node can be isolated (by seeing if there are any visible geometry underneath it).
Parameters:
Name Type Attributes Description
dvlId string The ID of the node.
rendererId string <optional>
Renderer token.
Returns:
true if the node can be isolated, false otherwise.
Type
boolean

(static) EndGesture(rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Ends a gesture. Should be called at the end of each gesture to decrease the internal counter.
Parameters:
Name Type Attributes Description
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) GetAttachedScenePtr(rendererIdopt) → {string|sap.ve.dvl.DVLRESULT}

Retrieves the scene token for the currently attached scene.
Parameters:
Name Type Attributes Description
rendererId string <optional>
Renderer token.
Returns:
Scene token or an error code if fails.
Type
string | sap.ve.dvl.DVLRESULT

(static) GetCameraMatrices(rendererIdopt) → {JSON|sap.ve.dvl.DVLRESULT}

Gets camera matrices - View and Projection matrices.
Parameters:
Name Type Attributes Description
rendererId string <optional>
Renderer token.
Returns:
An error code or an object with the following structure:
{
     "view":       [number, ...],
     "projection": [number, ...]
}
Type
JSON | sap.ve.dvl.DVLRESULT

(static) GetIsolatedNode(rendererIdopt) → {string|sap.ve.dvl.DVLRESULT}

Returns the ID of the currently isolated node or DVLID_INVALID if nothing is isolated.
Parameters:
Name Type Attributes Description
rendererId string <optional>
Renderer token.
Returns:
The ID of the isolated node or an error code if fails.
Type
string | sap.ve.dvl.DVLRESULT

(static) GetOption(option, rendererIdopt) → {boolean}

Returns the current state of rendering options.
Parameters:
Name Type Attributes Description
option sap.ve.dvl.DVLRENDEROPTION The rendering option to get the status of.
rendererId string <optional>
Renderer token.
Returns:
Current status of the specified rendering option. true if the option is set, false if the option is cleared.
Type
boolean

(static) GetOptionF(option, rendererIdopt) → {number}

Returns the current value of rendering options.
Parameters:
Name Type Attributes Description
option sap.ve.dvl.DVLRENDEROPTIONF The option to get the value of.
rendererId string <optional>
Renderer token.
Returns:
Value of the specified option.
Type
number

(static) HitTest(x, y, rendererIdopt) → {JSON|sap.ve.dvl.DVLRESULT}

Performs hit testing and finds a 3D object(s) under the X, Y coordinates.
Parameters:
Name Type Attributes Description
x number | Array.<number> Horizontal coordinate in device pixels or an array of numbers. The length of the array must be even. The array contains (x,y) pairs [x1, y1, x2, y2, ...].
y number Vertical coordinate in device pixels.
rendererId string <optional>
Renderer token.
Returns:
An error code or an object with the following structure.
[
    {
        "id":                string,
        "ScreenCoordinateX": number,
        "ScreenCoordinateY": number,
        "WorldCoordinateX":  number,
        "WorldCoordinateY":  number,
        "WorldCoordinateZ":  number,
        "LocalCoordinateX":  number,
        "LocalCoordinateY":  number,
        "LocalCoordinateZ":  number
    },
    ...
]
Type
JSON | sap.ve.dvl.DVLRESULT

(static) Pan(x, y, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Pans the scene.
Parameters:
Name Type Attributes Description
x number Horizontal delta in device pixels.
y number Vertical delta in device pixels.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) RenderFrame(rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Renders a single frame using the currently activated camera. Call this method to draw the attached scene.
Parameters:
Name Type Attributes Description
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) RenderFrameEx(v00, v01, v02, v03, v10, v11, v12, v13, v20, v21, v22, v23, v30, v31, v32, v33, p00, p01, p02, p03, p10, p11, p12, p13, p20, p21, p22, p23, p30, p31, p32, p33, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Renders a single frame using explicitly defined View and Projection matrices. Call this method to draw the attached scene.
The function takes two unrolled 4x4 matrices.
ParameterDescription
v[row][column]A View matrix in local coordinates.
p[row][column]A Projection matrix.
Parameters:
Name Type Attributes Description
v00 number A View matrix element at index [0,0].
v01 number A View matrix element at index [0,1].
v02 number A View matrix element at index [0,2].
v03 number A View matrix element at index [0,3].
v10 number A View matrix element at index [1,0].
v11 number A View matrix element at index [1,1].
v12 number A View matrix element at index [1,2].
v13 number A View matrix element at index [1,3].
v20 number A View matrix element at index [2,0].
v21 number A View matrix element at index [2,1].
v22 number A View matrix element at index [2,2].
v23 number A View matrix element at index [2,3].
v30 number A View matrix element at index [3,0].
v31 number A View matrix element at index [3,1].
v32 number A View matrix element at index [3,2].
v33 number A View matrix element at index [3,3].
p00 number A Projection matrix element at index [0,0].
p01 number A Projection matrix element at index [0,1].
p02 number A Projection matrix element at index [0,2].
p03 number A Projection matrix element at index [0,3].
p10 number A Projection matrix element at index [1,0].
p11 number A Projection matrix element at index [1,1].
p12 number A Projection matrix element at index [1,2].
p13 number A Projection matrix element at index [1,3].
p20 number A Projection matrix element at index [2,0].
p21 number A Projection matrix element at index [2,1].
p22 number A Projection matrix element at index [2,2].
p23 number A Projection matrix element at index [2,3].
p30 number A Projection matrix element at index [3,0].
p31 number A Projection matrix element at index [3,1].
p32 number A Projection matrix element at index [3,2].
p33 number A Projection matrix element at index [3,3].
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) ResetView(flags, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Changes view to default viewport (the "Home" mode).
Parameters:
Name Type Attributes Description
flags number A combination of DVLRESETVIEWFLAG flags.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) Rotate(dx, dy, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Rotates the scene around 3D orbit rotation center (which is calculated by the BeginGesture method).
Parameters:
Name Type Attributes Description
dx number Horizontal delta in device pixels.
dy number Vertical delta in device pixels.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) SetBackgroundColor(topRed, topGreen, topBlue, topAlpha, bottomRed, bottomGreen, bottomBlue, bottomAlpha, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Sets the color which is used to clear the screen. Can be a gradient from top to bottom.
Parameters:
Name Type Attributes Description
topRed number Red component of the top of a vertical color gradient background.
topGreen number Green component of the top of a vertical color gradient background.
topBlue number Blue component of the top of a vertical color gradient background.
topAlpha number Alpha component of the top of a vertical color gradient background.
bottomRed number Red component of the bottom of a vertical color gradient background.
bottomGreen number Green component of the bottom of a vertical color gradient background.
bottomBlue number Blue component of the bottom of a vertical color gradient background.
bottomAlpha number Alpha component of the bottom of a vertical color gradient background.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) SetDimensions(width, height, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Sets the dimensions of the canvas. You usually call this in the OnResize() handler of your application. You also need to call it once the renderer is created to let it know the target resolution.
Parameters:
Name Type Attributes Description
width number Target width of the canvas in device pixels.
height number Target height of the canvas in device pixels.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) SetIsolatedNode(dvlId, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Sets or clears an isolated node.
Parameters:
Name Type Attributes Description
dvlId string The ID of the node. To clear an isolated node, you need to pass DVLID_INVALID.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) SetOption(option, enable, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Sets or clears the specified rendering option.
Parameters:
Name Type Attributes Description
option sap.ve.dvl.DVLRENDEROPTION The option to change.
enable boolean true to set the option, false to clear the option.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
CodeDescription
DVLRESULT_NOTINITIALIZEDIf renderer initialization was not performed.
DVLRESULT_HARDWAREERROR If the new option state is not supported by hardware.
DVLRESULT_BADARG If the option does not exist.
DVLRESULT_OK If the option was changed successfully.
Type
sap.ve.dvl.DVLRESULT

(static) SetOptionF(option, value, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Sets the specified rendering option value.
Parameters:
Name Type Attributes Description
option sap.ve.dvl.DVLRENDEROPTIONF The option to change.
value number A numeric value of a non boolean option to set.
rendererId string <optional>
Renderer token
Returns:
The result code of the operation.
CodeDescription
DVLRESULT_NOTINITIALIZEDIf renderer initialization was not performed.
DVLRESULT_HARDWAREERROR If the new option value is not supported by hardware.
DVLRESULT_BADARG If the option does not exist.
DVLRESULT_OK If the option was changed successfully.
Type
sap.ve.dvl.DVLRESULT

(static) ShouldRenderFrame(rendererIdopt) → {boolean}

Checks if the scene has been somehow modified and requires re-rendering.
Parameters:
Name Type Attributes Description
rendererId string <optional>
Renderer token.
Returns:
true if the scene should be re-rendered, false otherwise.
Type
boolean

(static) Tap(x, y, isDouble, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Sends the "tap" event to the core (for selection).
Parameters:
Name Type Attributes Description
x number Horizontal coordinate in device pixels.
y number Vertical coordinate in device pixels.
isDouble boolean Should the call be handled as a double or single tap.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) Zoom(y, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Zooms the scene.
Parameters:
Name Type Attributes Description
y number Zoom velocity in pixels per second.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT

(static) ZoomTo(what, dvlId, crossFadeSeconds, rendererIdopt) → {sap.ve.dvl.DVLRESULT}

Zooms the scene to a bounding box created from a particular set of nodes.
Parameters:
Name Type Attributes Description
what sap.ve.dvl.DVLZOOMTO What set of nodes to zoom to, and optionally from which view.
dvlId string The target node ID. Only used if what equals DVLZOOMTONODE or DVLZOOMTONODE_SETISOLATION.
crossFadeSeconds number Time to perform the "fly to" animation. Set to 0.0f to do this immediately.
rendererId string <optional>
Renderer token.
Returns:
The result code of the operation.
Type
sap.ve.dvl.DVLRESULT