-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
179 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
interface composition { | ||
use document.{document}; | ||
use wired:math/types.{transform}; | ||
|
||
variant asset { | ||
composition(composition), | ||
document(document), | ||
} | ||
|
||
resource asset-node { | ||
constructor(); | ||
|
||
asset: func() -> option<asset>; | ||
set-asset: func(value: option<asset>); | ||
|
||
name: func() -> string; | ||
set-name: func(value: string); | ||
|
||
parent: func() -> option<asset-node>; | ||
children: func() -> list<asset-node>; | ||
add-child: func(value: borrow<asset-node>); | ||
remove-child: func(value: borrow<asset-node>); | ||
|
||
global-transform: func() -> transform; | ||
transform: func() -> transform; | ||
set-transform: func(value: transform); | ||
} | ||
|
||
/// A composition of assets. | ||
/// Roughly equivalent to a glXF file. | ||
resource composition { | ||
constructor(); | ||
|
||
nodes: func() -> list<asset-node>; | ||
add-node: func(value: borrow<asset-node>); | ||
remove-node: func(value: borrow<asset-node>); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
interface document { | ||
use scene.{scene}; | ||
|
||
/// A save-able collection of resources with an active scene. | ||
/// Roughly equivalent to a glTF file. | ||
resource document { | ||
constructor(); | ||
|
||
active-scene: func() -> option<scene>; | ||
set-active-scene: func(value: option<borrow<scene>>); | ||
|
||
/// The initial active scene, set on document load. | ||
/// If none is provided, the first scene will be used. | ||
default-scene: func() -> option<scene>; | ||
set-default-scene: func(value: option<borrow<scene>>); | ||
|
||
scenes: func() -> list<scene>; | ||
add-scene: func(value: borrow<scene>); | ||
remove-scene: func(value: borrow<scene>); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
interface material { | ||
record color { | ||
r: f32, | ||
g: f32, | ||
b: f32, | ||
a: f32, | ||
} | ||
|
||
resource material { | ||
constructor(); | ||
|
||
id: func() -> u32; | ||
/// Returns another reference to the same resource. | ||
ref: func() -> material; | ||
|
||
name: func() -> string; | ||
set-name: func(value: string); | ||
|
||
color: func() -> color; | ||
set-color: func(value: color); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
interface mesh { | ||
use material.{material}; | ||
|
||
resource primitive { | ||
id: func() -> u32; | ||
|
||
material: func() -> option<material>; | ||
set-material: func(value: option<borrow<material>>); | ||
|
||
set-indices: func(value: list<u32>); | ||
set-normals: func(value: list<f32>); | ||
set-positions: func(value: list<f32>); | ||
set-uvs: func(value: list<f32>); | ||
} | ||
|
||
resource mesh { | ||
constructor(); | ||
|
||
id: func() -> u32; | ||
/// Returns another reference to the same resource. | ||
ref: func() -> mesh; | ||
|
||
name: func() -> string; | ||
set-name: func(value: string); | ||
|
||
list-primitives: func() -> list<primitive>; | ||
create-primitive: func() -> primitive; | ||
remove-primitive: func(value: primitive); | ||
} | ||
} |
Oops, something went wrong.