Skip to content

Commit

Permalink
Prepare 0.6.0 release (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManevilleF committed May 3, 2023
1 parent 48331cd commit c0fb749
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# CHANGELOG

## Unreleased
## [Unreleased]

## 0.6.0

* Changed logo (#63)
* Drop `itertools` dependency (#58)
Expand All @@ -17,7 +19,7 @@
- `directional_fov` directional 120 degrees field of view (`Direction`)
* Added field of movement algorithm in `algorithms`:
- `field_of_movement` provides the available range of field of movement given a `budget` of movement and a movement `cost`
* Renamed rotation functions to follow `cw`/`ccw` terminology (old versions deprecated)
* Renamed rotation functions to follow `cw`/`ccw` terminology (old versions deprecated) (#78)

### Directions to

Expand All @@ -44,10 +46,10 @@ if a.way_to(b) == Direction::Top {

But now with accurate results !

### ExactSizeIterator
### ExactSizeIterator (#68)

* (**BREAKING**) `Hex::ring` now returns a `ExactSizeIterator` instead of a `Vec` (#68)
* (**BREAKING**) `Hex::custom_ring` now returns a `ExactSizeIterator` instead of a `Vec` (#68)
* (**BREAKING**) `Hex::ring` now returns a `ExactSizeIterator` instead of a `Vec`
* (**BREAKING**) `Hex::custom_ring` now returns a `ExactSizeIterator` instead of a `Vec`

### Mesh builder (#80)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hexx"
version = "0.5.3"
version = "0.6.0"
edition = "2021"
authors = ["Felix de Maneville <felix.maneville@gmail.com>"]
description = "Hexagonal utilities"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
[![Crates.io](https://img.shields.io/crates/v/hexx.svg)](https://crates.io/crates/hexx)
[![Docs.rs](https://docs.rs/hexx/badge.svg)](https://docs.rs/hexx)
[![dependency status](https://deps.rs/crate/hexx/0.5.3/status.svg)](https://deps.rs/crate/hexx)
[![dependency status](https://deps.rs/crate/hexx/0.6.0/status.svg)](https://deps.rs/crate/hexx)

<!-- cargo-sync-readme start -->

Expand All @@ -29,20 +29,20 @@

Run `cargo add hexx` in your project or add the following line to your `Cargo.toml`:

- `hexx = "0.5"`
- `hexx = "0.6"`

### Cargo features

`hexx` supports serialization and deserialization of most types using [serde](https://github.com/serde-rs/serde),
through the `ser_de` feature gate. To enable it add the following line to your `Cargo.toml`:

- `hexx = { version = "0.5", features = ["ser_de"] }`
- `hexx = { version = "0.6", features = ["ser_de"] }`

By default `Hex` uses rust classic memory layout, if you want to use `hexx` through the FFI or
have `Hex` be stored without any memory padding, the `packed` feature will make `Hex`
`repr(C)`. To enable this behaviour add the following line to your `Cargo.toml`:

- `hexx = { version = "0.5", features = ["packed"] }`
- `hexx = { version = "0.6", features = ["packed"] }`

## Features

Expand Down
3 changes: 2 additions & 1 deletion examples/mesh_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct HexInfo {
struct BuilderParams {
#[inspector(min = 0.0, max = 50.0)]
pub height: f32,
#[inspector(min = 0, max = 50)]
#[inspector(min = 1, max = 50)]
pub subdivisions: usize,
pub top_face: bool,
pub bottom_face: bool,
Expand Down Expand Up @@ -104,6 +104,7 @@ fn update_mesh(params: Res<BuilderParams>, info: Res<HexInfo>, mut meshes: ResMu
new_mesh = new_mesh.without_bottom_face();
}
let new_mesh = compute_mesh(new_mesh.build());
println!("Mesh has {} vertices", new_mesh.count_vertices());
let mesh = meshes.get_mut(&info.mesh_handle).unwrap();
*mesh = new_mesh;
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
//!
//! Run `cargo add hexx` in your project or add the following line to your `Cargo.toml`:
//!
//! - `hexx = "0.5"`
//! - `hexx = "0.6"`
//!
//! ### Cargo features
//!
//! `hexx` supports serialization and deserialization of most types using [serde](https://github.com/serde-rs/serde),
//! through the `ser_de` feature gate. To enable it add the following line to your `Cargo.toml`:
//!
//! - `hexx = { version = "0.5", features = ["ser_de"] }`
//! - `hexx = { version = "0.6", features = ["ser_de"] }`
//!
//! By default `Hex` uses rust classic memory layout, if you want to use `hexx` through the FFI or
//! have `Hex` be stored without any memory padding, the `packed` feature will make `Hex`
//! `repr(C)`. To enable this behaviour add the following line to your `Cargo.toml`:
//!
//! - `hexx = { version = "0.5", features = ["packed"] }`
//! - `hexx = { version = "0.6", features = ["packed"] }`
//!
//! ## Features
//!
Expand Down
8 changes: 4 additions & 4 deletions src/mesh/column_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ impl<'l> ColumnMeshBuilder<'l> {
let center = self.layout.hex_to_world_pos(self.pos);
let [a, b, c, d, e, f] = self.layout.hex_corners(self.pos);
let corners = [[a, b], [b, c], [c, d], [d, e], [e, f], [f, a]];
for div in 0..subidivisions {
let height = delta * div as f32;
for [left, right] in corners {
let normal = left - center + right - center;
for [left, right] in corners {
let normal = left - center + right - center;
for div in 0..subidivisions {
let height = delta * div as f32;
let left = Vec3::new(left.x, height, left.y);
let right = Vec3::new(right.x, height, right.y);
let quad = MeshInfo::quad([left, right], Vec3::new(normal.x, 0.0, normal.y), delta);
Expand Down

0 comments on commit c0fb749

Please sign in to comment.