# DirectionalLight

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-media3d/struct-directionallight/

**struct** · [`ferroui-media3d`](/docs/0.5.0/api/ferroui-media3d/) · v0.5.0

```rust
struct DirectionalLight
```

WPF's `DirectionalLight`: parallel light travelling along `Direction` ((0, 0, -1) by default).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L107)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`direction_property`](#function-direction_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_color_and_direction`](#function-with_color_and_direction)
- [`direction`](#function-direction)
- [`set_direction`](#function-set_direction)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L111)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<DirectionalLight>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L111)

<a id="function-direction_property"></a>

### direction_property

```rust
fn direction_property() -> &'static StyledProperty<Vector3D>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L123)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L131)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```

A white light along the negative z axis.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L136)

<a id="function-with_color_and_direction"></a>

### with_color_and_direction

```rust
fn with_color_and_direction(color: Color, direction: Vector3D) -> Ref<Self>
```

A light of `color` along `direction`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L141)

<a id="function-direction"></a>

### direction

```rust
fn direction(self: &Self) -> Vector3D
```

The direction the light travels in.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L149)

<a id="function-set_direction"></a>

### set_direction

```rust
fn set_direction(self: &Self, value: Vector3D)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Media3D/light.rs#L153)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`Model3DImplExt`](/docs/0.5.0/api/ferroui-media3d/trait-model3dimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<DirectionalLight>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`Model3DImpl`](/docs/0.5.0/api/ferroui-media3d/trait-model3dimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
