Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-camera

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Configure Camera projection, viewports, framing and screen/world conversion. Use for split-screen, pointer rays, wrong screenToWorld results or AIR_E_ORTHO_WIDTH.

  • 9 files
  • 81 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-camera

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestriggers.md

≈300 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Cocos AIR camera triggers

Source annotations refer to the AIR checkout.

When to use what

  • "Put a view into a scene" -> node.addComponent(Camera); the render object is camera.camera (src/cocos/misc/camera-component.ts:202).
  • "Switch perspective and orthographic framing" -> camera.projection, plus fov/fovAxis or orthoHeight/orthoWidth; table in camera-projection.md.
  • "Fit a loaded model in view" -> frameObject(camera, target, fallbackDistance?) (src/air/utils/frame-object.ts:35).
  • "Split-screen or picture-in-picture" -> camera.rect (normalized viewport Rect).
  • "Two cameras, who draws on top" -> camera.priority + camera.clearFlags; behavior in multi-camera.md.
  • "Which nodes does this camera draw" -> camera.visibility layer mask (bit values owned by cocosair-scene-graph).
  • "Convert a pointer pixel to a world ray / node position" -> camera.screenToWorld, camera.screenPointToRay, camera.convertToUINode; coordinate space in screen-world.md.
  • "Clip at an arbitrary near plane (mirror, water)" -> camera.camera.calculateObliqueMat(Vec4) and camera.camera.getClipSpaceMinz().

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "switch perspective and orthographic views",
  "fit a loaded model in view",
  "stack cameras or create split-screen views",
  "convert pointer pixels to a world ray",
  "screenToWorld results or orthographic width are wrong"
]
owns
[
  "projection",
  "viewport",
  "camera-framing",
  "screen-world",
  "camera-order",
  "oblique-plane"
]
not_for
[
  "register node layer bits -> cocosair-scene-graph",
  "offscreen render targets -> cocosair-rendering",
  "physics collision queries -> cocosair-physics"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "配置相机投影、视口、可见层和多相机顺序,并进行坐标转换、射线拾取与模型取景。用于相机配置或屏幕与世界坐标问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-camera