We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f8a8f1 commit a35ff39Copy full SHA for a35ff39
blobs/src/rigid_body.rs
@@ -18,6 +18,7 @@ impl Deref for RigidBodyHandle {
18
#[derive(Copy, Clone, Debug)]
19
pub struct RigidBodyData {
20
pub position: Vec2,
21
+ pub velocity: Vec2,
22
pub center_of_mass: Vec2,
23
pub mass: f32,
24
pub rotation: f32,
@@ -27,6 +28,7 @@ impl Default for RigidBodyData {
27
28
fn default() -> Self {
29
Self {
30
position: Vec2::ZERO,
31
+ velocity: Vec2::ZERO,
32
center_of_mass: Vec2::ZERO,
33
mass: 1.0,
34
rotation: 0.0,
@@ -73,9 +75,10 @@ impl RigidBody {
73
75
pub fn data(&self) -> RigidBodyData {
74
76
RigidBodyData {
77
position: self.position,
78
+ velocity: self.calculated_velocity,
79
+ rotation: self.rotation,
80
center_of_mass: self.center_of_mass,
81
mass: self.calculated_mass,
- rotation: self.rotation,
82
}
83
84
0 commit comments