Math examples
The engine's math examples: what each one shows, whether it runs in a browser and the command that runs it.
Primitives, bounding volumes, curves, random sampling and ray casting with the math library. There are 6 examples on this page. For the concepts behind them, see Math.
Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.
Examples#
| Example | What it shows | Web | Run |
|---|---|---|---|
| Bounding Volume Intersections (2D) | Showcases bounding volumes and intersection tests | Yes | cargo run --example bounding_2d |
| Cubic Splines | Exhibits different modes of constructing cubic curves using splines | Yes | cargo run --example cubic_splines |
| Custom Primitives | Demonstrates how to add custom primitives and useful traits for them. | Yes | cargo run --example custom_primitives |
| Random Sampling | Demonstrates how to sample random points from mathematical primitives | Yes | cargo run --example random_sampling |
| Rendering Primitives | Shows off rendering for all math primitives as both Meshes and Gizmos | Yes | cargo run --example render_primitives |
| Smooth Follow | Demonstrates how to make an entity smoothly follow another using interpolation | Yes | cargo run --example smooth_follow |