Skip to content

Commit

Permalink
Initial transform-gizmo structure changes
Browse files Browse the repository at this point in the history
  • Loading branch information
urholaukkarinen committed Mar 29, 2024
1 parent 302d1f0 commit 33d4378
Show file tree
Hide file tree
Showing 27 changed files with 59 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/target
Cargo.lock
/.idea
/.vscode
.DS_Store
37 changes: 14 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
[package]
name = "egui-gizmo"
version = "0.16.2"
authors = ["Urho Laukkarinen <[email protected]>"]
edition = "2021"

license-file = "LICENSE"
readme = "README.md"
description = "3d transform gizmo for the egui library"
homepage = "https://github.com/urholaukkarinen/egui-gizmo"
repository = "https://github.com/urholaukkarinen/egui-gizmo"
categories = ["gui", "game-development", "game-engines"]
keywords = ["egui", "gizmo"]
exclude = ["/docs"]

[workspace]
members = ["demo"]
resolver = "2"
members = ["crates/*"]

[dependencies]
[workspace.package]
version = "0.1.0"
rust-version = "1.72"
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/urholaukkarinen/transform-gizmo"
repository = "https://github.com/urholaukkarinen/transform-gizmo"
authors = ["Urho Laukkarinen <[email protected]>"]

[workspace.dependencies]
transform-gizmo = { version = "0.1.0", path = "crates/transform-gizmo", default-features = false }
egui = "0.26.2"
glam = { version = "0.25.0", features = ["mint"] }
mint = "0.5"

[profile.release]
opt-level = "s"
lto = "thin"

[lints]
workspace = true
panic = "abort"

[workspace.lints.rust]
elided_lifetimes_in_paths = "allow"
Expand Down Expand Up @@ -177,5 +170,3 @@ unwrap_used = "allow"
wildcard_imports = "allow"
large-types-passed-by-value = "allow"
needless-pass-by-value = "allow"
needless_pass_by_ref_mut = "allow"
redundant_pub_crate = "allow"
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# egui-gizmo
# transform-gizmo

[![Latest version](https://img.shields.io/crates/v/egui-gizmo.svg)](https://crates.io/crates/egui-gizmo)
[![Documentation](https://docs.rs/egui-gizmo/badge.svg)](https://docs.rs/egui-gizmo)
[![Latest version](https://img.shields.io/crates/v/transform-gizmo.svg)](https://crates.io/crates/transform-gizmo)
[![Documentation](https://docs.rs/transform-gizmo/badge.svg)](https://docs.rs/transform-gizmo)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg)

3d transformation gizmo built on top of the [egui](https://github.com/emilk/egui) library.

[Try it out in a web demo](https://urholaukkarinen.github.io/egui-gizmo/)
[Try it out in a web demo](https://urholaukkarinen.github.io/transform-gizmo/)

![Rotation](media/rotation.png)
![Translation](media/translation.png)
Expand Down
File renamed without changes.
18 changes: 10 additions & 8 deletions demo/Cargo.toml → crates/transform-gizmo-demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[package]
name = "egui-gizmo-demo"
version = "0.2.0"
authors = ["Urho Laukkarinen <[email protected]>"]
edition = "2021"

license = "MIT"
name = "transform-gizmo-demo"
version.workspace = true
rust-version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true

[dependencies]
egui.workspace = true
transform-gizmo.workspace = true
bevy = "0.13"
bevy_egui = "0.25.0"
egui = "0.26.2"
egui-gizmo = { path = ".." }

[dependencies.bevy_infinite_grid]
git = "https://github.com/XYCaptain/bevy_infinite_grid.git"
Expand Down
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion demo/index.html → crates/transform-gizmo-demo/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<html>
<head>
<title>egui-gizmo demo</title>
<title>transform-gizmo demo</title>
<style>
html,
body,
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions demo/src/main.rs → crates/transform-gizmo-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bevy_infinite_grid::{InfiniteGridBundle, InfiniteGridPlugin, InfiniteGridSet
use egui::color_picker::Alpha;
use egui::{pos2, Align2, Color32, FontId, LayerId, Ui, Widget};

use egui_gizmo::{
use transform_gizmo::{
Gizmo, GizmoMode, GizmoOrientation, GizmoResult, GizmoVisuals, DEFAULT_SNAP_ANGLE,
DEFAULT_SNAP_DISTANCE,
};
Expand All @@ -16,13 +16,14 @@ use crate::camera::{setup_camera, update_camera};

mod camera;

const SOURCE_URL: &str = "https://github.com/urholaukkarinen/egui-gizmo/blob/main/demo/src/main.rs";
const SOURCE_URL: &str =
"https://github.com/urholaukkarinen/transform-gizmo/blob/main/demo/src/main.rs";

fn main() {
App::new()
.add_plugins(DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
title: "egui-gizmo demo".into(),
title: "transform-gizmo demo".into(),
present_mode: PresentMode::AutoNoVsync,
..default()
}),
Expand Down
21 changes: 21 additions & 0 deletions crates/transform-gizmo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "transform-gizmo"
version.workspace = true
rust-version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
categories = ["gui", "game-development", "game-engines"]
keywords = ["3d", "gizmo"]
readme = "../../README.md"
include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"]

[dependencies]
egui.workspace = true
glam.workspace = true
mint.workspace = true

[lints]
workspace = true
4 changes: 2 additions & 2 deletions src/lib.rs → crates/transform-gizmo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//! such as game engines and 3d modeling software.
//!
//! # Creating a gizmo
//! For a more complete example, see the online demo at <https://urholaukkarinen.github.io/egui-gizmo/>.
//! The demo sources can be found at <https://github.com/urholaukkarinen/egui-gizmo/blob/main/demo/src/main.rs>.
//! For a more complete example, see the online demo at <https://urholaukkarinen.github.io/transform-gizmo/>.
//! The demo sources can be found at <https://github.com/urholaukkarinen/transform-gizmo/blob/main/demo/src/main.rs>.
//!
//! ## A basic example
//! ```text
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion docs/egui-gizmo-demo.js

This file was deleted.

Binary file removed docs/egui-gizmo-demo_bg.wasm
Binary file not shown.
1 change: 0 additions & 1 deletion docs/index.html

This file was deleted.

Binary file removed media/rotation.png
Binary file not shown.
Binary file removed media/scale.png
Binary file not shown.
Binary file removed media/translation.png
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/build_demo_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
set -eu
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )

WASM_PATH="docs/egui-gizmo-demo_bg.wasm"
WASM_PATH="docs/transform-gizmo-demo_bg.wasm"

pushd "$script_path/../demo"
pushd "$script_path/../crates/transform-gizmo-demo"
trunk build --config Trunk.toml --release
popd

Expand Down

0 comments on commit 33d4378

Please sign in to comment.