Implemented a custom physics engine #316
|
@ -19,7 +19,7 @@
|
|||
Interpolate: true
|
||||
Sleeping Enabled: true
|
||||
Freeze Position X: false
|
||||
Freeze Position Y: false
|
||||
Freeze Position Y: true
|
||||
Freeze Position Z: false
|
||||
Freeze Rotation X: false
|
||||
Freeze Rotation Y: false
|
||||
|
@ -29,6 +29,7 @@
|
|||
DrawColliders: false
|
||||
Colliders:
|
||||
- Is Trigger: false
|
||||
Collision Tag: 1
|
||||
Type: Sphere
|
||||
Radius: 1
|
||||
Friction: 0.400000006
|
||||
|
@ -90,6 +91,7 @@
|
|||
DrawColliders: false
|
||||
Colliders:
|
||||
- Is Trigger: false
|
||||
Collision Tag: 1
|
||||
Type: Sphere
|
||||
Radius: 2.5
|
||||
Friction: 0.400000006
|
||||
|
@ -130,6 +132,7 @@
|
|||
DrawColliders: false
|
||||
Colliders:
|
||||
- Is Trigger: false
|
||||
Collision Tag: 1
|
||||
Type: Box
|
||||
Half Extents: {x: 1, y: 1, z: 1}
|
||||
Friction: 0.400000006
|
||||
|
|
|
@ -236,9 +236,17 @@ namespace SHADE
|
|||
{
|
||||
static constexpr float ONE_OVER_TWELVE = (1.0f / 12.0f);
|
||||
|
||||
const float H2_PLUS_D2 = Extents.y * Extents.y + Extents.z * Extents.z;
|
||||
const float W2_PLUS_H2 = Extents.x * Extents.x + Extents.y * Extents.y;
|
||||
const float W2_PLUS_D2 = Extents.x * Extents.x + Extents.z * Extents.z;
|
||||
const float WIDTH = 2.0f * Extents.x;
|
||||
const float HEIGHT = 2.0f * Extents.y;
|
||||
const float DEPTH = 2.0f * Extents.z;
|
||||
|
||||
const float WIDTH_SQUARED = WIDTH * WIDTH;
|
||||
const float HEIGHT_SQUARED = HEIGHT * HEIGHT;
|
||||
const float DEPTH_SQUARED = DEPTH * DEPTH;
|
||||
|
||||
const float H2_PLUS_D2 = HEIGHT_SQUARED + DEPTH_SQUARED;
|
||||
const float W2_PLUS_H2 = WIDTH_SQUARED + HEIGHT_SQUARED;
|
||||
const float W2_PLUS_D2 = WIDTH_SQUARED + DEPTH_SQUARED;
|
||||
|
||||
SHMatrix result;
|
||||
result.m[0][0] = ONE_OVER_TWELVE * mass * H2_PLUS_D2;
|
||||
|
|
Loading…
Reference in New Issue