maplant / mgf Goto Github PK
View Code? Open in Web Editor NEWMatt's Game Framework
License: GNU Lesser General Public License v3.0
Matt's Game Framework
License: GNU Lesser General Public License v3.0
Some algorithms can be substantially improved by adding SIMD versions of them, or simply enabling the SIMD feature in cgmath. This should be done in the future.
The new cgmath has some nice helpers added.
The CHANGELOG.md specifies a breaking change however: https://github.com/rustgd/cgmath/blob/master/CHANGELOG.md
Breaking: Quaternion memory layout changed to [x, y, z, w]. The From and Into impls for [S; 4] and (S, S, S, S) have been changed accordingly.
The data has moved from
pub struct Quaternion {
pub s: S,
pub v: Vector3,
}
To
pub struct Quaternion {
pub v: Vector3,
pub s: S,
}
I'm not sure if mgf depends on from/to [S;4] or (S,S,S,S). It seems unlikely to me, since those are mostly for interfacing to something like OpenGL, but I wanted to raise the issue here.
As shown in mgf_demo/balls, some objects near the edge of the "box" exhibit instability and sink far to deeply into the floor. I have a few theories on why this happens, more than likely it is due to considering the wall and floor as the same physical object.
Somehow I broke this when converting to a crate, I'll try to get it fixed by Friday.
error[E0432]: unresolved import `rand::StdRng`
--> world.rs:20:25
|
20 | use rand::{SeedableRng, StdRng};
| ^^^^^^ no `StdRng` in the root
error[E0432]: unresolved imports `rand::distributions::Range`, `rand::distributions::IndependentSample`
--> world.rs:21:27
|
21 | use rand::distributions::{Range, IndependentSample};
| ^^^^^ ^^^^^^^^^^^^^^^^^ no `IndependentSample` in `distributions`
| |
| no `Range` in `distributions`
error[E0308]: mismatched types
--> capsules.rs:69:20
|
69 | a: Point3::new(-0.5, 0.0, 0.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
|
= note: expected struct `mgf::cgmath::Point3<f32>`
found struct `cgmath::Point3<{float}>`
= note: perhaps two different versions of crate `cgmath` are being used?
error[E0308]: mismatched types
--> capsules.rs:70:20
|
70 | d: Vector3::new(1.0, 0.0, 0.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Vector3`, found struct `cgmath::Vector3`
|
= note: expected struct `mgf::cgmath::Vector3<f32>`
found struct `cgmath::Vector3<{float}>`
= note: perhaps two different versions of crate `cgmath` are being used?
error[E0308]: mismatched types
--> capsules.rs:90:28
|
90 | rb.set_pos(Point3::new(x, y, z));
| ^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
|
= note: expected struct `mgf::cgmath::Point3<f32>`
found struct `cgmath::Point3<f32>`
= note: perhaps two different versions of crate `cgmath` are being used?
error[E0308]: mismatched types
--> world.rs:131:36
|
131 | terrain_mesh.push_vert(Point3::from(vert.pos));
| ^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
|
= note: expected struct `mgf::cgmath::Point3<f32>`
found struct `cgmath::Point3<f32>`
= note: perhaps two different versions of crate `cgmath` are being used?
error[E0308]: mismatched types
--> world.rs:150:30
|
150 | terrain_mesh.set_pos(Point3::new(0.0, -10.0, 0.0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `mgf::cgmath::Point3`, found struct `cgmath::Point3`
|
= note: expected struct `mgf::cgmath::Point3<f32>`
found struct `cgmath::Point3<{float}>`
= note: perhaps two different versions of crate `cgmath` are being used?
error[E0308]: mismatched types
--> world.rs:179:85
|
179 | let id: usize = self.bodies.add_body(collider, mass, restitution, friction, world_force).into();
| ^^^^^^^^^^^ expected struct `mgf::cgmath::Vector3`, found struct `cgmath::Vector3`
|
= note: expected struct `mgf::cgmath::Vector3<f32>`
found struct `cgmath::Vector3<f32>`
= note: perhaps two different versions of crate `cgmath` are being used?
error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
--> world.rs:335:76
|
335 | model: (Matrix4::from_translation(self.bodies.x[i].to_vec())
| ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use mgf::cgmath::EuclideanSpace;`
error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
--> world.rs:351:63
|
351 | model: (Matrix4::from_translation(c.a.to_vec())
| ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use mgf::cgmath::EuclideanSpace;`
error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
--> world.rs:360:63
|
360 | model: (Matrix4::from_translation(c.a.to_vec() + c.d)
| ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use mgf::cgmath::EuclideanSpace;`
error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
--> world.rs:369:70
|
369 | model: (Matrix4::from_translation(c.center().to_vec())
| ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use mgf::cgmath::EuclideanSpace;`
error[E0277]: the trait bound `cgmath::Matrix4<_>: std::convert::From<mgf::cgmath::Quaternion<f32>>` is not satisfied
--> world.rs:370:35
|
370 | ... * Matrix4::from(self.bodies.q[i])
| ^^^^^^^^^^^^^ the trait `std::convert::From<mgf::cgmath::Quaternion<f32>>` is not implemented for `cgmath::Matrix4<_>`
|
= help: the following implementations were found:
<&'a cgmath::Matrix4<S> as std::convert::From<&'a [S; 16]>>
<&'a cgmath::Matrix4<S> as std::convert::From<&'a [[S; 4]; 4]>>
<&'a mut cgmath::Matrix4<S> as std::convert::From<&'a mut [S; 16]>>
<&'a mut cgmath::Matrix4<S> as std::convert::From<&'a mut [[S; 4]; 4]>>
and 9 others
= note: required by `std::convert::From::from`
error[E0599]: no method named `magnitude` found for struct `mgf::cgmath::Vector3<f32>` in the current scope
--> world.rs:371:75
|
371 | ... * Matrix4::from_nonuniform_scale(c.r, c.d.magnitude(), c.r)).into(),
| ^^^^^^^^^ method not found in `mgf::cgmath::Vector3<f32>`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use mgf::cgmath::InnerSpace;`
error[E0599]: no method named `to_vec` found for struct `mgf::cgmath::Point3<f32>` in the current scope
--> world.rs:385:68
|
385 | model: Matrix4::from_translation(self.terrain.center().to_vec()).into(),
| ^^^^^^ method not found in `mgf::cgmath::Point3<f32>`
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a `use` for it:
`use mgf::cgmath::EuclideanSpace;`
error: aborting due to 15 previous errors
Some errors have detailed explanations: E0277, E0308, E0432, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `mgf_demo`.
To learn more, run the command again with --verbose.
is this project dead?
Contact currently stores both contact points along with the normal. This can be reduced to simply one contact point, a normal, and a distance.
This seems to be a problem relating to how wayland and glutin handles cursors. Looking into it, but it's not a huge problem.
There are number of poor interface choices in Pool. PoolEntry for one should not be exposed, and Pool should implement some sort of Drain. All of these need to be fixed by implementing custom iterators.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.