# Viewport3DVisual

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

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

```rust
struct Viewport3DVisual
```

WPF's `Viewport3DVisual`; see the documentation of the module.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`camera_property`](#function-camera_property)
- [`viewport_property`](#function-viewport_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`camera`](#function-camera)
- [`set_camera`](#function-set_camera)
- [`viewport`](#function-viewport)
- [`set_viewport`](#function-set_viewport)
- [`children`](#function-children)
- [`structure_generation`](#function-structure_generation)
- [`record_generation`](#function-record_generation)
- [`camera_generation`](#function-camera_generation)
- [`changed`](#function-changed)
- [`snapshot`](#function-snapshot)
- [`model_source`](#function-model_source)
- [`descendant_bounds`](#function-descendant_bounds)

<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/viewport_3d_visual.rs#L45)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### camera_property

```rust
fn camera_property() -> &'static StyledProperty<Option<Ref<Camera>>>
```



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

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

### viewport_property

```rust
fn viewport_property() -> &'static StyledProperty<Rect>
```



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

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

### construct

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

Creates the class data; see `FerroObject::construct`.

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

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

### new

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

An empty scene without a camera.

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

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

### camera

```rust
fn camera(self: &Self) -> Option<Ref<Camera>>
```

The camera; without one nothing is drawn.

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

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

### set_camera

```rust
fn set_camera(self: &Self, value: Option<Ref<Camera>>)
```



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

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

### viewport

```rust
fn viewport(self: &Self) -> Rect
```

The area the scene is drawn in (the arranged bounds of its `Viewport3D`); the camera
takes its aspect ratio.

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

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

### set_viewport

```rust
fn set_viewport(self: &Self, value: Rect)
```



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

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

### children

```rust
fn children(self: &Self) -> Visual3DCollection
```

The visuals of the scene (a shared handle to the collection).

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

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

### structure_generation

```rust
fn structure_generation(self: &Self) -> u64
```

The generation of the structure of the scene.

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

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

### record_generation

```rust
fn record_generation(self: &Self) -> u64
```

The generation of the records of the scene.

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

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

### camera_generation

```rust
fn camera_generation(self: &Self) -> u64
```

The generation of the camera and the viewport.

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

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

### changed

```rust
fn changed(self: &Self, handler: impl Fn(Scene3DChange) -> () + 'static) -> Subscription
```

Calls `handler` on every change of the scene (after its generation was bumped), until
the returned guard is dropped.

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

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

### snapshot

```rust
fn snapshot(self: &Self) -> Arc<Scene3DSnapshot>
```

The scene as an immutable snapshot: the same one while nothing changes.

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

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

### model_source

```rust
fn model_source(self: &Self, index: usize) -> Option<(Ref<Visual3D>, Ref<GeometryModel3D>)>
```

The visual and the model the model at `index` of the current snapshot was made from (for
the 3D hit testing); `None` for another index or when they no longer exist.

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

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

### descendant_bounds

```rust
fn descendant_bounds(self: &Self) -> Rect3D
```

The bounds of what the scene shows, in the world.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `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<Viewport3DVisual>`](/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/)

## Availability

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