Skip to content

Ellipsoid primitive#24849

Open
JasmineLowen wants to merge 4 commits into
bevyengine:mainfrom
JasmineLowen:ellipsoid-primitive
Open

Ellipsoid primitive#24849
JasmineLowen wants to merge 4 commits into
bevyengine:mainfrom
JasmineLowen:ellipsoid-primitive

Conversation

@JasmineLowen

@JasmineLowen JasmineLowen commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Objective

Solution

  • This is mostly just an ellipse in 3d or a weird sphere. Most of the code was stolen from these two
  • Caveat: The formula for calculating the area of an ellipsoid is pretty complex and performance is bad. Wikipedia mentions an approximation formula which should probably be fine for most game engine use cases so I chose this for now
  • Implementing the nearest_point function that the sphere has is also pretty hard for the ellipsoid so I left it out for now. I think it's not that essential. Potentially we could implement it with an euler approximation but I'm shying a bit away from iterative algorithms in the math library since I want to keep things snappy

Testing

  • Added some unit tests.
  • Added the new primitives to the primitive example

Showcase

The new things in the primitives examples:

screenshot-20260702-230436 screenshot-20260703-131556

@JasmineLowen JasmineLowen force-pushed the ellipsoid-primitive branch from 2ce0990 to 855ba64 Compare July 3, 2026 11:17
@kfc35 kfc35 added A-Math Fundamental domain-agnostic mathematical operations D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Feature A new feature, making something new possible labels Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Math Fundamental domain-agnostic mathematical operations C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants