mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
6c9ec88e54
# Objective Introduce isometry types for describing relative and absolute position in mathematical contexts. ## Solution For the time being, this is a very minimal implementation. This implements the following faculties for two- and three-dimensional isometry types: - Identity transformations - Creation from translations and/or rotations - Inverses - Multiplication (composition) of isometries with each other - Application of isometries to points (as vectors) - Conversion of isometries to affine transformations There is obviously a lot more that could be added, so I erred on the side of adding things that I knew would be useful, with the idea of expanding this in the near future as needed. (I also fixed some random doc problems in `bevy_math`.) --- ## Design One point of interest here is the matter of if/when to use aligned types. In the implementation of 3d isometries, I used `Vec3A` rather than `Vec3` because it has no impact on size/alignment, but I'm still not sure about that decision (although it is easily changed). For 2d isometries — which are encoded by four floats — the idea of shoving them into a single 128-bit buffer (`__m128` or whatever) sounds kind of enticing, but it's more involved and would involve writing unsafe code, so I didn't do that for now. ## Future work - Expand the API to include shortcuts like `inverse_mul` and `inverse_transform` for efficiency reasons. - Include more convenience constructors and methods (e.g. `from_xy`, `from_xyz`). - Refactor `bevy_math::bounding` to use the isometry types. - Add conversions to/from isometries for `Transform`/`GlobalTransform` in `bevy_transform`. |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_picking | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_state | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |