Transform Anchor
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
It would be nice to set an anchor point, like you can on `Sprite`, on either the transform or mesh.
I am currently creating a game where I would benefit from anchoring the transform on the bottom of the entity.
## What solution would you like?
I am envisioning a new component, like this:
```rust
enum TransformAnchor {
Center,
TopLeftFront,
TopLeftCenter,
TopLeftBack,
TopRightFront,
Custom(Vec3)
etc...
}
commands.spawn((
Transform::default(),
TransformAnchor::BottomCenter,
));
```
## What alternative(s) have you considered?
An alternative would of course be to just offset the transform manually, but I find that a bit tedious to work with.
Contributor guide
Research direction
Start by reviewing the existing Sprite anchor behavior and the Transform, mesh, and Vec3 concepts mentioned in the issue. Determine whether anchoring belongs on transforms, meshes, or both, and define the supported anchor positions and custom-offset behavior before implementation. Done means the chosen API is implemented and its behavior is covered by appropriate tests or examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100