added ability to create quads
@@ -54,6 +54,7 @@ pub struct Menu {
create_cone: Handle<UiNode>,
create_sphere: Handle<UiNode>,
create_cylinder: Handle<UiNode>,
+ create_quad: Handle<UiNode>,
create_point_light: Handle<UiNode>,
create_spot_light: Handle<UiNode>,
create_directional_light: Handle<UiNode>,
@@ -118,6 +119,7 @@ impl Menu {
let create_cone;
let create_sphere;
let create_cylinder;
+ let create_quad;
let create_point_light;
let create_spot_light;
let create_directional_light;
@@ -184,6 +186,13 @@ impl Menu {
.build(ctx);
create_cone
},
+ {
+ create_quad =
+ MenuItemBuilder::new(WidgetBuilder::new().with_min_size(min_size))
+ .with_content(MenuItemContent::text("Quad"))
+ .build(ctx);
+ create_quad
+ },
])
.build(ctx),
MenuItemBuilder::new(WidgetBuilder::new().with_min_size(min_size))
@@ -414,6 +423,7 @@ impl Menu {
create_cone,
create_sphere,
create_cylinder,
+ create_quad,
create_point_light,
create_spot_light,
create_directional_light,
@@ -590,6 +600,17 @@ impl Menu {
AddNodeCommand::new(mesh),
)))
.unwrap();
+ } else if message.destination() == self.create_quad {
+ let mesh = MeshBuilder::new(BaseBuilder::new().with_name("Quad"))
+ .with_surfaces(vec![Surface::new(Arc::new(RwLock::new(
+ SurfaceSharedData::make_quad(&Matrix4::identity()),
+ )))])
+ .build_node();
+ self.message_sender
+ .send(Message::DoSceneCommand(SceneCommand::AddNode(
+ AddNodeCommand::new(mesh),
+ )))
+ .unwrap();
} else if message.destination() == self.create_camera {
let node =
CameraBuilder::new(BaseBuilder::new().with_name("Camera")).build_node();
