A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
docs(graphics): two documented facts the code contradicts
yhh6c507f6170c8
diff --git a/docs/astro/src/content/docs/graphics/camera.mdx b/docs/astro/src/content/docs/graphics/camera.mdxindex 6a83a4b98..3c65d76be 100644--- a/docs/astro/src/content/docs/graphics/camera.mdx+++ b/docs/astro/src/content/docs/graphics/camera.mdx@@ -53,8 +53,8 @@ the camera by moving its entity's `Transform`.| `projectionType` | `ProjectionType` | `Orthographic` | `Orthographic` (2D) or `Perspective`. || `orthoSize` | number | `540` | Visible half-height in world units (Orthographic) — your **zoom**. Animatable. || `fov` | number | `60` | Field of view in degrees (Perspective only; 1–179). |-| `nearPlane` | number | `0.1` | Near clip distance. |-| `farPlane` | number | `1000` | Far clip distance. |+| `nearPlane` | number | `0.1` | Near clip distance (Perspective only). |+| `farPlane` | number | `1000` | Far clip distance. Orthographic has no near plane and renders a symmetric `±farPlane` box, so this is its reach in both directions. || `aspectRatio` | number | `1.77` | Width / height. `0` = auto from the viewport. || `isActive` | boolean | `true` | Whether this camera is eligible to be the active one. || `priority` | number | `0` | Tie-breaker among active cameras (higher wins). |diff --git a/docs/astro/src/content/docs/graphics/lighting.mdx b/docs/astro/src/content/docs/graphics/lighting.mdxindex d8888a109..635b75a32 100644--- a/docs/astro/src/content/docs/graphics/lighting.mdx+++ b/docs/astro/src/content/docs/graphics/lighting.mdx@@ -216,9 +216,10 @@ way the flat term is. A light with no environment stays exactly what it was: thecoefficients are zero, and the same expression is the flat term again.<Aside>- Lights are still placed in the plane: a `Light2D` has no third coordinate, so- distance is measured in xy and a point light's height comes from its radius. The- normal and the view vector are the three-dimensional part of the model.+ How far a light is depends on what it is lighting. A sprite has no depth of its+ own, so distance is measured in the plane and the light's `z` does not enter. A+ mesh with normals measures across all three, against the world `z` of the light's+ own entity — which is where a point or spot light's height comes from.</Aside>## Shadows between meshesdiff --git a/docs/astro/src/content/docs/zh-cn/graphics/camera.mdx b/docs/astro/src/content/docs/zh-cn/graphics/camera.mdxindex a2107756a..0497c44ac 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/camera.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/camera.mdx@@ -48,8 +48,8 @@ SDK 默认值为 2D 调好(正交、活动、`orthoSize` 540)。移动相机就| `projectionType` | `ProjectionType` | `Orthographic` | `Orthographic`(2D)或 `Perspective`。 || `orthoSize` | number | `540` | 可见半高(世界单位,正交)——你的**缩放**。可动画。 || `fov` | number | `60` | 视场角(度,仅透视;1–179)。 |-| `nearPlane` | number | `0.1` | 近裁剪距离。 |-| `farPlane` | number | `1000` | 远裁剪距离。 |+| `nearPlane` | number | `0.1` | 近裁剪距离(仅透视)。 |+| `farPlane` | number | `1000` | 远裁剪距离。正交相机没有近裁剪面,渲染的是一个对称的 `±farPlane` 盒子,所以这个值是它两个方向上的范围。 || `aspectRatio` | number | `1.77` | 宽 / 高。`0` = 从视口自动推算。 || `isActive` | boolean | `true` | 该相机是否有资格成为活动相机。 || `priority` | number | `0` | 活动相机之间的优先级(高者胜)。 |diff --git a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdxindex 3bd7484b5..2d0e5f901 100644--- a/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx+++ b/docs/astro/src/content/docs/zh-cn/graphics/lighting.mdx@@ -204,8 +204,9 @@ cmds.spawn().insert(Light2D, {系数为零,同一个表达式又变回那个平坦项。<Aside>- 灯仍然摆在平面上:`Light2D` 没有第三个坐标,所以距离在 xy 内度量,点光的高度来自它的- 半径。法线与视线才是这个模型里三维的部分。+ 灯有多远,取决于它照的是什么。精灵没有自己的厚度,所以距离在平面内度量,灯的 `z` 不+ 参与;带法线的网格在三个轴上度量,依据的是灯所在实体的世界 `z` ——点光与聚光的高度+ 正是从那里来的。</Aside>## mesh 之间的阴影