This commit is contained in:
jonathan santis 2024-11-27 13:43:12 +01:00
parent 7295b4deaf
commit 16541e4a69
2 changed files with 5 additions and 2 deletions

View File

@ -58,6 +58,9 @@ const Particle = struct {
{ {
self.show = 0; self.show = 0;
} }
self.acceleration.a.x = 0;
self.acceleration.a.y = 0;
self.acceleration.a.z = 0;
} }
pub fn spawn(self:*Self,xaccel : f32,yaccel : f32) void pub fn spawn(self:*Self,xaccel : f32,yaccel : f32) void
{ {
@ -80,8 +83,8 @@ const Particle = struct {
self.velocity.a.y += val; self.velocity.a.y += val;
} }
pub fn applyForce(self : *Self,vec : pr.Vec) void { pub fn applyForce(self : *Self,vec : pr.Vec) void {
self.velocity.a.x += vec.a.x; self.velocity.a.x += vec.a.x * 0.5;
self.velocity.a.y += vec.a.y; self.velocity.a.y += vec.a.y * 0.5;
self.velocity.a.z += vec.a.z; self.velocity.a.z += vec.a.z;
} }
}; };

Binary file not shown.