Camera API

editor.selectCamera(type)
Parameters:type

the camera type. Allowed values:

  • editor.CameraType_Game - the gameplay camera
  • editor.CameraType_Free - the editor free fly-by camera
  • editor.CameraType_Orbit - orbit camera around the current selection

Sets the current camera in the editor’s viewport.

editor.isFreeCamera()

Returns true if the camera is free camera mode.

editor.toggleFreeCamera()

Toggles between current in-game camera and free fly (editor) camera.

editor.getCamera()
Returns:the current editor camera
editor.cameraLookAtPoint(pt)
Parameters:pt – the point in world where the camera should look at

Orients the camera to look at a specific world point.

editor.placeCameraAtSelection()

Sets the camera position at the center of the current object selection.

editor.placeCameraAtPlayer()

Sets the camera position at the current player position.

editor.placePlayerAtCamera()

Sets the player position at the current editor camera position.

editor.fitViewToSelection()

Fit/position the camera viewport to the bounding box of the selected objects, so one can view the entire selection.

editor.fitViewToSelectionAndOrbit()

Fit/position the camera viewport to the bounding box of the selected objects, so one can view the entire selection. At the same time, enable orbit camera around the selection.

editor.setCameraSpeed(speed)
Parameters:speed

the speed of the fly camera movement. Allowed values:

  • editor.CameraSpeed_Slowest
  • editor.CameraSpeed_Slow
  • editor.CameraSpeed_Slower
  • editor.CameraSpeed_Normal
  • editor.CameraSpeed_Faster
  • editor.CameraSpeed_Fast
  • editor.CameraSpeed_Fastest

Sets the speed of the editor fly camera.

editor.addCameraBookmark(name)
Parameters:name – the name of the bookmark
Returns:the id of the bookmark object

Adds a new named camera bookmark at the current world position.

editor.deleteCameraBookmark(objectId)
Parameters:objectId – the object id of the bookmark

Deletes a camera bookmark by its name.

editor.getCameraBookmarks()
Returns:the bookmarks SimGroup object, where the bookmarks are kept.
editor.copyCameraBookmarkToClipboard(obj)
Parameters:obj – the camera bookmark object to copy

Copies the camera bookmark to clipboard as text.

editor.pasteCameraBookmarkFromClipboard()

Paste the camera bookmark from clipboard.

editor.clearCameraBookmarks()

Delete all the camera bookmarks.

editor.jumpToCameraBookmark(objectId)
Parameters:objectId – the object id of the bookmark to jump to

Jump to the camera bookmark.

editor.getObjectLocationText(obj)
Parameters:obj – the object to get position text for

Return the object location as text. Used internally by the editor.