# SCamera

**Membres** 14

|           |                                             |                                                                                                                        |
| --------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| Fonction  | [TakePhoto](#takephoto)                     | Triggers the Photo window in the UI, with the output of this camera.                                                   |
| Fonction  | [TakeSnapshot](#takesnapshot)               | Captures a texture from the camera, and saves it in a SResource                                                        |
| Propriété | [HDR](#hdr)                                 | Can this camera write HDR values? (i.e. values brighter than 1.0)                                                      |
| Propriété | [PixelWidth](#pixelwidth)                   | The width of this Camera's texture, in pixels                                                                          |
| Propriété | [PixelHeight](#pixelheight)                 | The height of this Camera's texture in pixels                                                                          |
| Propriété | [Velocity](#velocity)                       | World space speed of this camera, typically used for motion blur.                                                      |
| Propriété | [UseOcclusionCulling](#useocclusionculling) | Is Occlusion Culling enabled on this camera?                                                                           |
| Propriété | [Enabled](#enabled)                         | Is this camera enabled?                                                                                                |
| Propriété | [FieldOfView](#fieldofview)                 | The field of view of the camera, in typical scenarios, Sinespace uses a value of 52; however Unity will default to 60. |
| Propriété | [Orthographic](#orthographic)               | Does this camera render without perspective?                                                                           |
| Propriété | [OrthographicSize](#orthographicsize)       | The width of the camera when in Orthographic mode.                                                                     |
| Propriété | [NearClip](#nearclip)                       | How close can an object be to the camera plane before it is not rendered?                                              |
| Propriété | [FarClip](#farclip)                         | How far is an object from the camera plane before it is not rendered?                                                  |
| Propriété | [GameObject](#gameobject)                   | Returns a reference to the GameObject of this component.                                                               |

## Fonctions

### TakePhoto

void TakePhoto()

Triggers the Photo window in the UI, with the output of this camera. Perfect for photo booths.

Valeurs de retour

`void`

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.TakePhoto()

```

### TakeSnapshot

[SResource](/docs/fr/scripting/client-scripting-api-reference/types/sresource.md) TakeSnapshot()

Captures a texture from the camera, and saves it in a SResource

Valeurs de retour

`SResource`

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.TakeSnapshot()

```

## Propriétés

### HDR

bool HDR {get; set; }

Can this camera write HDR values? (i.e. values brighter than 1.0)

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.HDR = true

```

### PixelWidth

int PixelWidth {get; }

The width of this Camera's texture, in pixels

Exemple

**Lua**

```lua
cameraWidthPixels = Space.Host.ExecutingObject.Camera.PixelWidth

```

### PixelHeight

int PixelHeight {get; }

The height of this Camera's texture in pixels

Exemple

**Lua**

```lua
cameraHeightPixels = Space.Host.ExecutingObject.Camera.PixelHeight

```

### Velocity

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) Velocity {get; }

World space speed of this camera, typically used for motion blur.

Exemple

**Lua**

```lua
cameraVelocity = Space.Host.ExecutingObject.Camera.Velocity

```

### UseOcclusionCulling

bool UseOcclusionCulling {get; set; }

Is Occlusion Culling enabled on this camera?

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.UseOcclusionCulling = true

```

### Enabled

bool Enabled {get; set; }

Is this camera enabled?

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.Enabled = true

```

**Lua**

```lua
--clicking this object will Enable/Disable it's Camera component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.Camera

OnClick = function()
component.Enabled =  not component.Enabled
end

thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

```

### FieldOfView

float FieldOfView {get; set; }

The field of view of the camera, in typical scenarios, Sinespace uses a value of 52; however Unity will default to 60.

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.FieldOfView = 70

```

### Orthographic

bool Orthographic {get; set; }

Does this camera render without perspective?

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.Orthographic = true

```

### OrthographicSize

float OrthographicSize {get; set; }

The width of the camera when in Orthographic mode. Height will be adjusted based on aspect ratio of the Render Texture

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.OrthographicSize = 5.0 

```

### NearClip

float NearClip {get; set; }

How close can an object be to the camera plane before it is not rendered?

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.NearClip = 2.0 

```

### FarClip

float FarClip {get; set; }

How far is an object from the camera plane before it is not rendered?

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.Camera.FarClip = 6.0 

```

### GameObject

[SGameObject](/docs/fr/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

Returns a reference to the GameObject of this component.

Exemple

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.Camera.GameObject

```
