bevyengine / bevyengine/bevy

Clarify how `Plane3d` is oriented in space

Open
#13,019 6 comments 0 reactions 0 assignees View on GitHub
A-Math C-Docs
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## How can Bevy's documentation be improved?

We have a primitive, `Plane3d`, which really describes a rectangular section of an infinite plane. At the level of the type itself, it is described by its `normal` and a `half-size`:
```rust
pub struct Plane3d {
/// The normal of the plane. The plane will be placed perpendicular to this direction
pub normal: Dir3,
/// Half of the width and height of the plane
pub half_size: Vec2,
}
```
The documentation doesn't actually say how the rectangle is rotated along the axis of the normal, although this is implicit, for example, in its implementation of `Meshable`.

Notably, this area is also a little bit thorny, since it's [impossible](https://en.wikipedia.org/wiki/Hairy_ball_theorem) to have a consistent (continuous) orientation for this rectangle over the entire sphere of possible normals. Right now, the thing implied by `Meshable` is underdetermined at `normal == Vec::NEG_Y`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.