Skip to content

Commit a526c24

Browse files
committed
type safety
1 parent 82ae5c0 commit a526c24

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

drafts/2025-02-04-fyrox-game-engine-1.0.0-rc.1.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,17 @@ modern GAPIs.
106106

107107
# Type Safety for Handles
108108

109+
![type safety](type_safety.png)
110+
109111
For a long time Fyrox supported only "untyped" handles (such as `Handle<Node>` or `Handle<UiNode>`), this
110-
approach was bug-prone because it effectively erased all the useful type information. This release adds
111-
strongly typed handles for all the scene and UI entities. It is now possible to store `camera: Handle<Camera>`
112-
in a script and access the camera by it using a simple `graph[camera].projection_matrix()`. There's no need
113-
to do a manual type casting. Typed handle improved the editor side as well - the handle selector will show
114-
only the objects of the right type.
112+
approach was bug-prone because it effectively erased all the useful information about the actual node or widget type.
113+
This release adds strongly typed handles for all the scene and UI entities. It is now possible to store
114+
`camera: Handle<Camera>` in a script and access the camera by it using a simple `graph[camera].projection_matrix()`.
115+
There's no need to do a manual type casting. Typed handle improved the editor side as well - the handle selector will
116+
show only the objects of the right type.
117+
118+
The internals of the engine will slowly migrate to strongly-typed handles, there's a lot of places that can be improved
119+
with strongly-typed handles.
115120

116121
# Scene
117122

drafts/type_safety.png

100 KB
Loading

0 commit comments

Comments
 (0)