Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions astraweave-destruction/src/fracture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,38 @@ mod tests {

#[test]
fn planar_cut_is_stable() {
let a = planar_children(&parent());
let b = planar_children(&parent());
let source = parent();
let a = planar_children(&source);
let b = planar_children(&source);
assert_eq!(a, b);
assert!(a[0].id < a[1].id || a[0].id != a[1].id);
assert_eq!(a[0].mass.saturating_add(a[1].mass), parent().mass);
assert_ne!(a[0].id, a[1].id);
assert_eq!(a[0].id, mix_sim_seed(source.id, 0, SIM_SYSTEM_DESTRUCTION));
assert_eq!(a[1].id, mix_sim_seed(source.id, 1, SIM_SYSTEM_DESTRUCTION));
let shift = source.half[0].mul_ratio(1, 2);
assert_eq!(a[0].half[0], shift);
assert_eq!(a[1].half[0], shift);
assert_eq!(a[0].pos[0], source.pos[0].saturating_sub(shift));
assert_eq!(a[1].pos[0], source.pos[0].saturating_add(shift));
for axis in 1..3 {
assert_eq!(a[0].pos[axis], source.pos[axis]);
assert_eq!(a[1].pos[axis], source.pos[axis]);
assert_eq!(a[0].half[axis], source.half[axis]);
assert_eq!(a[1].half[axis], source.half[axis]);
}
assert_eq!(a[0].mass, source.mass.mul_ratio(1, 2));
assert_eq!(a[1].mass, source.mass.saturating_sub(a[0].mass));
assert_eq!(a[0].mass.saturating_add(a[1].mass), source.mass);
assert_eq!(a[0].flags, source.flags);
assert_eq!(a[1].flags, source.flags);
assert_eq!(a[0].structure, source.structure);
assert_eq!(a[1].structure, source.structure);
assert_eq!(a[0].island, source.island);
assert_eq!(a[1].island, source.island);
}

#[test]
fn stone_break_strength_is_one_hundred() {
assert_eq!(BreakRule::stone().strength, Fixed64::from_int(100));
}

#[test]
Expand Down
4 changes: 0 additions & 4 deletions astraweave-physics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ harness = false
name = "vehicle"
harness = false

[[bench]]
name = "destruction"
harness = false

[[bench]]
name = "ragdoll"
harness = false
Expand Down
6 changes: 3 additions & 3 deletions astraweave-physics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Full-featured physics simulation for AstraWeave, wrapping **Rapier3D 0.22**.

## Overview

Provides rigid body dynamics, character controllers, broadphase spatial hashing, projectiles, ragdolls, vehicles, cloth, gravity zones, wind/water environments, and destructible objects.
Provides rigid body dynamics, character controllers, broadphase spatial hashing, projectiles, ragdolls, vehicles, cloth, and wind/water environments. `break_destructible` only removes a Rapier body. Fracture is `astraweave-destruction`.

## Key Types

Expand All @@ -17,9 +17,9 @@ Provides rigid body dynamics, character controllers, broadphase spatial hashing,
| `Ragdoll` / `RagdollBuilder` | Multi-bone ragdoll creation |
| `Vehicle` / `VehicleManager` | Vehicle dynamics with drivetrain |
| `ClothManager` | Particle-based cloth with distance constraints |
| `DestructionManager` | Fracture patterns and debris |
| `break_destructible` | Removes a Rapier body. Fracture and debris are `astraweave-destruction` |
| `EnvironmentManager` | Wind zones, water volumes, buoyancy |
| `GravityManager` | Composable gravity zones |
| `PhysicsWorld::gravity` | Rapier gravity vector. `gravity.rs` and `GravityManager` are removed (#330) |

## Feature Flags

Expand Down
178 changes: 0 additions & 178 deletions astraweave-physics/benches/destruction.rs

This file was deleted.

Loading
Loading