Jypeli  9
The simple game programming library
Inertia.cs
Siirry tämän tiedoston dokumentaatioon.
1 namespace Jypeli
2 {
3  public partial class PhysicsObject
4  {
5  [Save]
6  private double _storedMomentOfInertia = 1;
7 
13  public double Mass
14  {
15  get { return Body.Mass; }
16  set
17  {
18  Body.Mass = value;
19  _storedMomentOfInertia = Body.MomentOfInertia;
20  }
21  }
22 
29  public double MomentOfInertia
30  {
31  get { return Body.MomentOfInertia; }
32  set
33  {
34  Body.MomentOfInertia = value;
35  _storedMomentOfInertia = Body.MomentOfInertia;
36  }
37  }
38 
42  public bool CanRotate
43  {
44  get { return !double.IsPositiveInfinity( MomentOfInertia ); }
45  set
46  {
47  if ( !value )
48  {
49  _storedMomentOfInertia = Body.MomentOfInertia;
50  Body.MomentOfInertia = double.PositiveInfinity;
51  }
52  else
53  {
54  Body.MomentOfInertia = _storedMomentOfInertia;
55  }
56  }
57  }
58 
64  public double LinearDamping
65  {
66  get { return Body.LinearDamping; }
67  set { Body.LinearDamping = value; }
68  }
69 
75  public double AngularDamping
76  {
77  get { return Body.AngularDamping; }
78  set { Body.AngularDamping = value; }
79  }
80 
81  }
82 }
Jypeli.PhysicsObject.AngularDamping
double AngularDamping
Kulmanopeuskerroin. Pienempi arvo kuin 1 (esim. 0.998) toimii kuten kitka / ilmanvastus.
Definition: Inertia.cs:76
Jypeli.PhysicsObject.LinearDamping
double LinearDamping
Nopeuskerroin. Pienempi arvo kuin 1 (esim. 0.998) toimii kuten kitka / ilmanvastus.
Definition: Inertia.cs:65
Jypeli.PhysicsObject.Body
IPhysicsBody Body
Definition: Dimensions.cs:10
Jypeli
Definition: Automobile.cs:5
Jypeli.PhysicsObject._storedMomentOfInertia
double _storedMomentOfInertia
Definition: Inertia.cs:6
Jypeli.PhysicsObject.MomentOfInertia
double MomentOfInertia
Olion hitausmomentti eli massa/paino kääntyessä. Mitä suurempi, sitä hitaampi olio on kääntymään / si...
Definition: Inertia.cs:30
Jypeli.PhysicsObject.CanRotate
bool CanRotate
Jos false, olio ei voi pyöriä.
Definition: Inertia.cs:43
Jypeli.PhysicsObject.Mass
double Mass
Olion massa (paino). Mitä enemmän massaa, sitä enemmän voimaa tarvitaan saamaan olio liikkeelle / pys...
Definition: Inertia.cs:14