Physics Adjustments
This commit is contained in:
parent
e746462295
commit
2b0344630e
2 changed files with 4 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ public class RigidBody {
|
|||
public Vector3f CrossSectionAreas = new Vector3f(1.8f * 0.9f, 0.6f * 0.9f, 1.8f * 0.6f);
|
||||
public Vector3f WeightDistribution = new Vector3f(2.0f,5.0f,7.0f);
|
||||
public float FallingAcceleration = 0.0f;
|
||||
public float Bounciness = 2f;
|
||||
public float Bounciness = 1f;
|
||||
|
||||
public final Vector3f LinearVelocity = new Vector3f();
|
||||
public final Vector3f AngularVelocity = new Vector3f();
|
||||
|
|
@ -37,7 +37,7 @@ public class RigidBody {
|
|||
public final Matrix3f InverseInertiaLocal = new Matrix3f();
|
||||
public final Matrix3f InverseInertiaWorld = new Matrix3f();
|
||||
|
||||
public float Restitution = 0.3f; // 0 = fully inelastic, 1 = perfectly elastic
|
||||
public float Restitution = 0.0f; // 0 = fully inelastic, 1 = perfectly elastic
|
||||
public float Friction = 0.5f;
|
||||
public boolean IsStatic = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ public class RigidCollision {
|
|||
float j = -(1 + Restitution) * VelocityAlongNormal / InverseMassSum;
|
||||
Impulse.set(normal).mul(j);
|
||||
|
||||
body1.ApplyImpulse(NegatedImpulse.set(Impulse).negate().mul(body1.Bounciness), Point);
|
||||
body1.ApplyImpulse(NegatedImpulse.set(Impulse).negate(), Point);
|
||||
|
||||
body2.ApplyImpulse(Impulse.mul(body2.Bounciness),Point);
|
||||
body2.ApplyImpulse(Impulse,Point);
|
||||
|
||||
ApplyFriction(body1, body2, normal, Point, Dist1, Dist2, j);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue