Sinespace Client 2026.2.1037
Client-side scripting for Sinespace
SineSpace.Scripting.Scene.SCameraManager Class Reference
Inheritance diagram for SineSpace.Scripting.Scene.SCameraManager:
ScriptClass

Public Member Functions

override void Initialise (SScript runtime, object wrapper)
 
void LockCamera (SGameObject owner)
 Takes control of the Camera as long as 'owner' exists in the scene, or until ReleaseCamera() has been called.
 
void ReleaseCamera ()
 Relinquishes control of the Camera back to Space.
 
void SetCameraPositionOrientation (SVector position, SQuaternion orientation)
 Forces the camera to be at position facing orientation for the frame. Needs to be called every frame.
 
SRay ScreenCoordinatesToRay (SVector screenCoordinates)
 Returns a ray going from camera through a screen point.
 
SVector ScreenCoordinatesToWorld (SVector screenCoordinates)
 Transforms a point from screen space into world space.
 
SVector WorldCoordinatesToScreen (SVector coordinates)
 Transforms position from world space into screen space.
 
void ShakeCamera (float magnitude, float time)
 
void ShakeCamera (float amplitude, float frequency, float time)
 
- Public Member Functions inherited from ScriptClass
void ReportError (string error, bool fatal, UnityEngine.Object target=null)
 
void Initialise (SScript runtime, object wrapper)
 

Properties

bool IsLocked [get]
 Returns true if the Camera is locked.
 
SGameObject MainCamera [get]
 Note, this property is generally read-only. It's position is driven by internal code. Will return null if main camera is not yet initialized.
 
SGameObject ActiveVirtualCamera [get]
 Get the currently active Cinemachine Virtual Camera game object.
 
- Properties inherited from ScriptClass
virtual bool Alive [get]
 
DynValue CachedData [get, set]
 

Additional Inherited Members

- Protected Member Functions inherited from ScriptClass
void Initialise (SScript runtime)
 

Member Function Documentation

◆ Initialise()

override void SineSpace.Scripting.Scene.SCameraManager.Initialise ( SScript runtime,
object wrapper )

◆ LockCamera()

void SineSpace.Scripting.Scene.SCameraManager.LockCamera ( SGameObject owner)

Takes control of the Camera as long as 'owner' exists in the scene, or until ReleaseCamera() has been called.

Space.Camera.LockCamera()
– If no camera position/orientation is set upon locking, the camera will lock on the avatar.

◆ ReleaseCamera()

void SineSpace.Scripting.Scene.SCameraManager.ReleaseCamera ( )

Relinquishes control of the Camera back to Space.

– Let's lock the camera for a moment
Space.Camera.LockCamera()
– Now we can release it
if Space.Camera.IsLocked then
Space.Camera.ReleaseCamera()
Space.Log("Camera released")
end

◆ ScreenCoordinatesToRay()

SRay SineSpace.Scripting.Scene.SCameraManager.ScreenCoordinatesToRay ( SVector screenCoordinates)

Returns a ray going from camera through a screen point.

Parameters
screenCoordinatesScreen Corrdinates(Use screen size percent range(0,1))
local ray=Space.Camera.ScreenCoordinatesToRay(Vector.New(0.5,0.5,0))
Space.Log("Direction "..ray.Direction.ToString().." Origin "..ray.Origin.ToString())

◆ ScreenCoordinatesToWorld()

SVector SineSpace.Scripting.Scene.SCameraManager.ScreenCoordinatesToWorld ( SVector screenCoordinates)

Transforms a point from screen space into world space.

Parameters
screenCoordinatesScreen Corrdinates(Use screen size percent range(0,1)

–Vector3 the worldspace point created by converting the screen space point at the provided distance z from the camera plane.

Space.Log(Space.Camera.ScreenCoordinatesToWorld(Vector.New(0.5,0.5,0)).ToString())

◆ SetCameraPositionOrientation()

void SineSpace.Scripting.Scene.SCameraManager.SetCameraPositionOrientation ( SVector position,
SQuaternion orientation )

Forces the camera to be at position facing orientation for the frame. Needs to be called every frame.

Parameters
positionCamera Position
orientationCamera Rotation
local VectorPos = Vector.New(0,0,0)
local VectorRot = Quaternion.Euler(-60,0,0)
Space.Camera.LockCamera()
Space.Camera.SetCameraPositionOrientation (VectorPos,VectorRot)
– Now the camera is positioned at the global origin and is facing the sky at 60 degrees.

◆ ShakeCamera() [1/2]

void SineSpace.Scripting.Scene.SCameraManager.ShakeCamera ( float amplitude,
float frequency,
float time )

◆ ShakeCamera() [2/2]

void SineSpace.Scripting.Scene.SCameraManager.ShakeCamera ( float magnitude,
float time )

◆ WorldCoordinatesToScreen()

SVector SineSpace.Scripting.Scene.SCameraManager.WorldCoordinatesToScreen ( SVector coordinates)

Transforms position from world space into screen space.

Parameters
coordinatesWorld space position
local trans=Space.Host.ExecutingObject
Space.Log(Space.Camera.WorldCoordinatesToScreen(trans.WorldPosition).ToString())

Property Documentation

◆ ActiveVirtualCamera

SGameObject SineSpace.Scripting.Scene.SCameraManager.ActiveVirtualCamera
get

Get the currently active Cinemachine Virtual Camera game object.

Space.Log(Space.Camera.ActiveVirtualCamera.Name)
–print "Virtual PlayerCamera" to the console

< /example>

◆ IsLocked

bool SineSpace.Scripting.Scene.SCameraManager.IsLocked
get

Returns true if the Camera is locked.

Space.Camera.LockCamera();
Space.Log(Space.Camera.IsLocked)
&ndash;prints "True" to the console

◆ MainCamera

SGameObject SineSpace.Scripting.Scene.SCameraManager.MainCamera
get

Note, this property is generally read-only. It's position is driven by internal code. Will return null if main camera is not yet initialized.

Space.Log(Space.Camera.MainCamera.Name)
&ndash;print "Main Camera" to the console