Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes and minor API changes #39

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Cargo.lock

# Jetbrains IDE
.idea/

# VS Code
.vscode/
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ num_enum = "0.5.7"
derivative = "2.2.0"
strum = "0.24.1"
strum_macros = "0.24.3"
bitflags = "2.0.2"
mint = { version = "0.5.9", optional = true }

[features]
default = []
default = ["static-link"]
prebuilt = ["russimp-sys/prebuilt"]
static-link = ["russimp-sys/static-link"]
nozlib = ["russimp-sys/nozlib"]
Expand Down
20 changes: 8 additions & 12 deletions src/animation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,10 @@ fn camera_roll_animation_read() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down Expand Up @@ -270,12 +268,10 @@ fn debug_animations() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down
10 changes: 4 additions & 6 deletions src/bone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ fn debug_bones() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down
22 changes: 10 additions & 12 deletions src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct Camera {
pub look_at: Vector3D,
pub position: Vector3D,
pub up: Vector3D,
pub orthographic_width: f32,
}

impl From<&aiCamera> for Camera {
Expand All @@ -25,6 +26,7 @@ impl From<&aiCamera> for Camera {
look_at: (&camera.mLookAt).into(),
position: (&camera.mPosition).into(),
up: (&camera.mUp).into(),
orthographic_width: camera.mOrthographicWidth,
}
}
}
Expand All @@ -40,12 +42,10 @@ fn camera_available() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down Expand Up @@ -80,12 +80,10 @@ fn debug_camera() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down
10 changes: 4 additions & 6 deletions src/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ fn debug_face() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub enum RussimpError {
MeterialError(String),
Primitive(String),
TextureNotFound,
LogStreamNotAvailable
}

impl Display for RussimpError {
Expand Down Expand Up @@ -72,7 +73,7 @@ impl From<&aiAABB> for AABB {
}
}

#[derive(Clone, Copy, Default, Derivative)]
#[derive(PartialEq, Clone, Copy, Default, Derivative)]
#[derivative(Debug)]
#[repr(C)]
pub struct Color4D {
Expand All @@ -93,7 +94,7 @@ impl From<&aiColor4D> for Color4D {
}
}

#[derive(Clone, Copy, Default, Derivative)]
#[derive(PartialEq, Clone, Copy, Default, Derivative)]
#[derivative(Debug)]
#[repr(C)]
pub struct Color3D {
Expand Down Expand Up @@ -175,7 +176,7 @@ impl From<&aiVector2D> for Vector2D {

impl Error for RussimpError {}

#[derive(Clone, Copy, Default, Derivative)]
#[derive(Clone, Copy, Default, Derivative, PartialEq)]
#[derivative(Debug)]
#[repr(C)]
pub struct Vector3D {
Expand Down
20 changes: 8 additions & 12 deletions src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,10 @@ fn light_available() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down Expand Up @@ -126,12 +124,10 @@ fn debug_light() {

let scene = Scene::from_file(
current_directory_buf.as_str(),
vec![
PostProcess::CalculateTangentSpace,
PostProcess::Triangulate,
PostProcess::JoinIdenticalVertices,
PostProcess::SortByPrimitiveType,
],
PostProcess::CalculateTangentSpace
| PostProcess::Triangulate
| PostProcess::JoinIdenticalVertices
| PostProcess::SortByPrimitiveType,
)
.unwrap();

Expand Down
Loading