Merge pull request #157 from yutannihilation/cgmath-0.18

Update cgmath 0.18
pull/166/head
sotrh 3 years ago committed by GitHub
commit e0cd2b0a39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

194
Cargo.lock generated

@ -156,12 +156,6 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "autocfg"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
[[package]]
name = "autocfg"
version = "1.0.0"
@ -337,17 +331,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
name = "cgmath"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "283944cdecc44bf0b8dd010ec9af888d3b4f142844fdbe026c20ef68148d6fe7"
dependencies = [
"approx 0.3.2",
"num-traits",
"rand 0.6.5",
]
[[package]]
name = "cgmath"
version = "0.18.0"
@ -493,7 +476,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -735,7 +718,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"cfg-if 0.1.10",
"crossbeam-utils 0.7.2",
"lazy_static",
@ -764,7 +747,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"cfg-if 0.1.10",
"lazy_static",
]
@ -775,7 +758,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"cfg-if 1.0.0",
"const_fn",
"lazy_static",
@ -983,7 +966,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.18.0",
"cgmath",
"env_logger 0.8.3",
"fs_extra",
"futures",
@ -1005,12 +988,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
@ -1328,7 +1305,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"framework",
"fs_extra",
@ -1584,7 +1561,7 @@ version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"hashbrown",
]
@ -1867,7 +1844,7 @@ version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f"
dependencies = [
"autocfg 1.0.0",
"autocfg",
]
[[package]]
@ -2090,7 +2067,7 @@ version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"num-traits",
]
@ -2100,7 +2077,7 @@ version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"num-integer",
"num-traits",
]
@ -2111,7 +2088,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"num-integer",
"num-traits",
]
@ -2122,7 +2099,7 @@ version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
dependencies = [
"autocfg 1.0.0",
"autocfg",
]
[[package]]
@ -2345,7 +2322,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.18.0",
"cgmath",
"fs_extra",
"futures",
"glob",
@ -2427,25 +2404,6 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
dependencies = [
"autocfg 0.1.7",
"libc",
"rand_chacha 0.1.1",
"rand_core 0.4.2",
"rand_hc 0.1.0",
"rand_isaac",
"rand_jitter",
"rand_os",
"rand_pcg",
"rand_xorshift",
"winapi 0.3.9",
]
[[package]]
name = "rand"
version = "0.7.3"
@ -2471,16 +2429,6 @@ dependencies = [
"rand_hc 0.3.0",
]
[[package]]
name = "rand_chacha"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
dependencies = [
"autocfg 0.1.7",
"rand_core 0.3.1",
]
[[package]]
name = "rand_chacha"
version = "0.2.2"
@ -2501,21 +2449,6 @@ dependencies = [
"rand_core 0.6.2",
]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
dependencies = [
"rand_core 0.4.2",
]
[[package]]
name = "rand_core"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
[[package]]
name = "rand_core"
version = "0.5.1"
@ -2534,15 +2467,6 @@ dependencies = [
"getrandom 0.2.2",
]
[[package]]
name = "rand_hc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "rand_hc"
version = "0.2.0"
@ -2561,59 +2485,6 @@ dependencies = [
"rand_core 0.6.2",
]
[[package]]
name = "rand_isaac"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "rand_jitter"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
dependencies = [
"libc",
"rand_core 0.4.2",
"winapi 0.3.9",
]
[[package]]
name = "rand_os"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
dependencies = [
"cloudabi 0.0.3",
"fuchsia-cprng",
"libc",
"rand_core 0.4.2",
"rdrand",
"winapi 0.3.9",
]
[[package]]
name = "rand_pcg"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
dependencies = [
"autocfg 0.1.7",
"rand_core 0.4.2",
]
[[package]]
name = "rand_xorshift"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "range-alloc"
version = "0.1.1"
@ -2635,7 +2506,7 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
dependencies = [
"autocfg 1.0.0",
"autocfg",
"crossbeam-deque 0.8.0",
"either",
"rayon-core",
@ -2654,15 +2525,6 @@ dependencies = [
"num_cpus",
]
[[package]]
name = "rdrand"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
dependencies = [
"rand_core 0.3.1",
]
[[package]]
name = "redox_syscall"
version = "0.1.57"
@ -3344,7 +3206,7 @@ checksum = "d973cfa0e6124166b50a1105a67c85de40bbc625082f35c0f56f84cb1fb0a827"
name = "tutorial1-window"
version = "0.1.0"
dependencies = [
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"futures",
"image",
@ -3360,7 +3222,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3379,7 +3241,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3398,7 +3260,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3417,7 +3279,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3435,7 +3297,7 @@ dependencies = [
name = "tutorial2-swapchain"
version = "0.1.0"
dependencies = [
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"futures",
"image",
@ -3450,7 +3312,7 @@ name = "tutorial3-pipeline"
version = "0.1.0"
dependencies = [
"anyhow",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3468,7 +3330,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3486,7 +3348,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3504,7 +3366,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3522,7 +3384,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3540,7 +3402,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3558,7 +3420,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bytemuck",
"cgmath 0.17.0",
"cgmath",
"env_logger 0.7.1",
"fs_extra",
"futures",
@ -3988,7 +3850,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
name = "windowless"
version = "0.1.0"
dependencies = [
"cgmath 0.18.0",
"cgmath",
"futures",
"image",
"raw-window-handle",

@ -15,7 +15,7 @@ path = "src/main.rs"
image = "0.23"
winit = "0.24"
shaderc = "0.7"
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
wgpu = "0.7"

@ -10,7 +10,7 @@ edition = "2018"
image = "0.23"
winit = "0.24"
shaderc = "0.7"
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
wgpu = "0.7"

@ -8,7 +8,7 @@ edition = "2018"
image = "0.23"
winit = "0.24"
# shaderc = "0.7" # REMOVED!
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
wgpu = "0.7"

@ -7,8 +7,8 @@ edition = "2018"
[dependencies]
image = "0.23"
cgmath = "0.18"
winit = "0.24"
cgmath = "0.17"
wgpu = "0.7"
env_logger = "0.7"
log = "0.4"

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
futures = "0.3"

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
futures = "0.3"

@ -83,7 +83,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -83,7 +83,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
futures = "0.3"

@ -91,7 +91,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -91,7 +91,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -114,7 +114,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -91,7 +91,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -35,7 +35,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -35,7 +35,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -35,7 +35,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);
proj * view
}

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -33,7 +33,7 @@ impl Camera {
}
pub fn calc_matrix(&self) -> Matrix4<f32> {
Matrix4::look_at_dir(
Matrix4::look_to_rh(
self.position,
Vector3::new(self.yaw.0.cos(), self.pitch.0.sin(), self.yaw.0.sin()).normalize(),
Vector3::unit_y(),

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -33,7 +33,7 @@ impl Camera {
}
pub fn calc_matrix(&self) -> Matrix4<f32> {
Matrix4::look_at_dir(
Matrix4::look_to_rh(
self.position,
Vector3::new(self.yaw.0.cos(), self.pitch.0.sin(), self.yaw.0.sin()).normalize(),
Vector3::unit_y(),

@ -7,7 +7,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = ["derive"]}
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -33,7 +33,7 @@ impl Camera {
}
pub fn calc_matrix(&self) -> Matrix4<f32> {
Matrix4::look_at_dir(
Matrix4::look_to_rh(
self.position,
Vector3::new(self.yaw.0.cos(), self.pitch.0.sin(), self.yaw.0.sin()).normalize(),
Vector3::unit_y(),

@ -33,7 +33,7 @@ impl Camera {
}
pub fn calc_matrix(&self) -> Matrix4<f32> {
Matrix4::look_at_dir(
Matrix4::look_to_rh(
self.position,
Vector3::new(self.yaw.0.cos(), self.pitch.0.sin(), self.yaw.0.sin()).normalize(),
Vector3::unit_y(),

@ -8,7 +8,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0"
bytemuck = { version = "1.4", features = [ "derive" ] }
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
futures = "0.3"
image = "0.23"

@ -11,7 +11,7 @@ For the beginner stuff, we're going to keep things very simple, we'll add things
image = "0.23"
winit = "0.24"
shaderc = "0.7"
cgmath = "0.17"
cgmath = "0.18"
env_logger = "0.7"
log = "0.4"
wgpu = "0.7"

@ -278,7 +278,7 @@ We'll start writing code in it in a bit. First we need to add some things to our
image = "0.23"
winit = "0.24"
# shaderc = "0.7" # REMOVED!
cgmath = "0.17"
cgmath = "0.18"
wgpu = "0.7"
futures = "0.3"

@ -424,8 +424,8 @@ For convenience sake, let's pull our texture code into its module. We'll first n
```toml
[dependencies]
image = "0.23"
cgmath = "0.18"
winit = "0.24"
cgmath = "0.17"
env_logger = "0.7"
log = "0.4"
futures = "0.3"

@ -4,7 +4,7 @@ While all of our previous work has seemed to be in 2d, we've actually been worki
## A perspective camera
This tutorial is more about learning to use wgpu and less about linear algebra, so I'm going to gloss over a lot of the math involved. There's plenty of reading material online if you're interested in what's going on under the hood. The first thing to know is that we need `cgmath = "0.17"` in our `Cargo.toml`.
This tutorial is more about learning to use wgpu and less about linear algebra, so I'm going to gloss over a lot of the math involved. There's plenty of reading material online if you're interested in what's going on under the hood. The first thing to know is that we need `cgmath = "0.18"` in our `Cargo.toml`.
Now that we have a math library, let's put it to use! Create a `Camera` struct above the `State` struct.
@ -22,7 +22,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
// 1.
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
// 2.
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);

@ -50,7 +50,7 @@ impl Camera {
}
pub fn calc_matrix(&self) -> Matrix4<f32> {
Matrix4::look_at_dir(
Matrix4::look_to_rh(
self.position,
Vector3::new(
self.yaw.0.cos(),

Loading…
Cancel
Save