-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMotion.cs
34 lines (33 loc) · 864 Bytes
/
Motion.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace My2D_Engine
{
class Motion
{
GameObject gameobj;
//public double velocity;
public Force force;
public Vector2d VD;
public Acce acceleration;
public void ActiveForce()
{
while (gameobj.isActive)
{
acceleration.vx = force.vx / gameobj.rigidBody.Mass;
acceleration.vy = force.vy / gameobj.rigidBody.Mass;
}
}
public Vector2d LM()
{
return new Vector2d(VD.vx,VD.vy,gameobj.rigidBody.Mass * VD.velocity);
//return 0;
}
public double KE()
{
return 0.5 * gameobj.rigidBody.Mass * VD.velocity * VD.velocity;
}
}
}