Expand description
§变换系统
提供 3D 空间中的位置、旋转和缩放变换,以及层次变换的支持。
§核心概念
§使用示例
use anvilkit_core::math::Transform;
use glam::{Vec3, Quat};
// 创建基础变换
let mut transform = Transform::from_xyz(1.0, 2.0, 3.0);
// 链式调用设置属性
transform = transform
.with_rotation(Quat::from_rotation_y(std::f32::consts::PI / 4.0))
.with_scale(Vec3::splat(2.0));
// 应用变换到点
let point = Vec3::ZERO;
let transformed_point = transform.transform_point(point);Structs§
- Global
Transform - 全局变换组件,表示世界空间中的最终变换。
- Transform
- 表示 3D 空间中位置、旋转和缩放的变换组件。