fix: 修复Rust文档测试和添加rapier2d WASM绑定
This commit is contained in:
@@ -12,6 +12,7 @@ use bytemuck::{Pod, Zeroable};
|
||||
///
|
||||
/// # Examples | 示例
|
||||
/// ```rust
|
||||
/// use es_engine::math::Color;
|
||||
/// let red = Color::RED;
|
||||
/// let custom = Color::new(0.5, 0.7, 0.3, 1.0);
|
||||
/// let packed = custom.to_packed(); // For GPU
|
||||
|
||||
@@ -8,6 +8,7 @@ use super::Vec2;
|
||||
///
|
||||
/// # Examples | 示例
|
||||
/// ```rust
|
||||
/// use es_engine::math::{Rect, Vec2};
|
||||
/// let rect = Rect::new(10.0, 20.0, 100.0, 50.0);
|
||||
/// let point = Vec2::new(50.0, 40.0);
|
||||
/// assert!(rect.contains_point(point));
|
||||
|
||||
@@ -9,6 +9,7 @@ use glam::Mat3;
|
||||
///
|
||||
/// # Examples | 示例
|
||||
/// ```rust
|
||||
/// use es_engine::math::{Transform2D, Vec2};
|
||||
/// let mut transform = Transform2D::new();
|
||||
/// transform.position = Vec2::new(100.0, 200.0);
|
||||
/// transform.rotation = std::f32::consts::PI / 4.0; // 45 degrees
|
||||
|
||||
@@ -8,6 +8,7 @@ use bytemuck::{Pod, Zeroable};
|
||||
///
|
||||
/// # Examples | 示例
|
||||
/// ```rust
|
||||
/// use es_engine::math::Vec2;
|
||||
/// let pos = Vec2::new(100.0, 200.0);
|
||||
/// let velocity = Vec2::new(1.0, 0.0);
|
||||
/// let new_pos = pos + velocity * 16.0;
|
||||
|
||||
Reference in New Issue
Block a user