Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ These are generally BSD-like, but exact details vary by crate:
If the README of a crate contains a 'License' header (or similar), the additional copyright notices and license terms applicable to that crate will be listed.
The above licensing requirement still applies to contributions to those crates, and sections of those crates will carry those license terms.
The [license](https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields) field of each crate will also reflect this.
For example, [`bevy_mikktspace`](./crates/bevy_mikktspace/README.md#license-agreement) has code under the Zlib license (as well as a copyright notice when choosing the MIT license).

The [assets](assets) included in this repository (for our [examples](./examples/README.md)) typically fall under different open licenses.
These will not be included in your game (unless copied in by you), and they are not distributed in the published bevy crates.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_mesh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bevy_math = { path = "../bevy_math", version = "0.17.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.17.0-dev" }
bevy_ecs = { path = "../bevy_ecs", version = "0.17.0-dev" }
bevy_transform = { path = "../bevy_transform", version = "0.17.0-dev" }
bevy_mikktspace = { path = "../bevy_mikktspace", version = "0.17.0-dev" }
bevy_mikktspace = { version = "0.17.0-dev" }
bevy_derive = { path = "../bevy_derive", version = "0.17.0-dev" }
bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-features = false, features = [
"std",
Expand Down
16 changes: 9 additions & 7 deletions crates/bevy_mesh/src/mikktspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ impl bevy_mikktspace::Geometry for MikktspaceGeometryHelper<'_> {
self.uvs[self.index(face, vert)]
}

fn set_tangent_encoded(&mut self, tangent: [f32; 4], face: usize, vert: usize) {
fn set_tangent(
&mut self,
tangent_space: Option<bevy_mikktspace::TangentSpace>,
face: usize,
vert: usize,
) {
let idx = self.index(face, vert);
self.tangents[idx] = tangent;
self.tangents[idx] = tangent_space.unwrap_or_default().tangent_encoded();
}
}

Expand All @@ -65,7 +70,7 @@ pub enum GenerateTangentsError {
#[error("the '{0}' vertex attribute should have {1:?} format")]
InvalidVertexAttributeFormat(&'static str, VertexFormat),
#[error("mesh not suitable for tangent generation")]
MikktspaceError,
MikktspaceError(#[from] bevy_mikktspace::GenerateTangentSpaceError),
}

pub(crate) fn generate_tangents_for_mesh(
Expand Down Expand Up @@ -113,10 +118,7 @@ pub(crate) fn generate_tangents_for_mesh(
uvs,
tangents,
};
let success = bevy_mikktspace::generate_tangents(&mut mikktspace_mesh);
if !success {
return Err(GenerateTangentsError::MikktspaceError);
}
bevy_mikktspace::generate_tangents(&mut mikktspace_mesh)?;

// mikktspace seems to assume left-handedness so we can flip the sign to correct for this
for tangent in &mut mikktspace_mesh.tangents {
Expand Down
36 changes: 0 additions & 36 deletions crates/bevy_mikktspace/Cargo.toml

This file was deleted.

176 changes: 0 additions & 176 deletions crates/bevy_mikktspace/LICENSE-APACHE

This file was deleted.

26 changes: 0 additions & 26 deletions crates/bevy_mikktspace/LICENSE-MIT

This file was deleted.

41 changes: 0 additions & 41 deletions crates/bevy_mikktspace/README.md

This file was deleted.

Loading
Loading