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

/cocosair-primitives-mesh

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Build primitive geometry, Mesh buffers and MeshRenderer bindings. Use for vertex attributes, indices, wireframes or AIR_E_PRIMITIVE_DESCRIPTOR validation.

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencestriggers.md

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

primitives and mesh authoring triggers

For original references to the contracts below, see Contracts. Source annotations refer to the AIR checkout.

When to use what

  • "Draw a cube, sphere, cylinder or cone in code" -> createPrimitiveGeometry(descriptor) then utils.createMesh (src/air/primitive-geometry.ts:42, src/cocos/3d/misc/create-mesh.ts:46).
  • "Use a shape outside box/sphere/cylinder/cone, or fine-grained sub-division" -> the native primitives.box|sphere|cylinder|cone|plane|quad|torus|capsule|circle generators (src/cocos/primitive/index.ts).
  • "Move, scale or wireframe geometry without a GPU round trip" -> primitives.translate, primitives.scale, primitives.wireframed (in-place IGeometry edits, src/cocos/primitive/transform.ts).
  • "Store a primitive as a serialized asset" -> new Primitive(); p.type = ...; p.info = {...}; p.onLoaded() (src/cocos/primitive/primitive.ts:50-86); info carries only numbers.
  • "Author a custom vertex buffer by hand" -> build a Mesh.IStruct and call mesh.reset({ struct, data }) (src/cocos/3d/assets/mesh.ts:182-267,676), or hand an IGeometry to utils.createMesh.
  • "Read or copy a mesh's attributes or indices back out" -> mesh.readAttribute, mesh.copyAttribute, mesh.readIndices, mesh.copyIndices, mesh.readAttributeFormat (src/cocos/3d/assets/mesh.ts:1149-1295).
  • "Rewrite vertex or index data in place after creation" -> utils.MeshUtils.createDynamicMesh(0, geometry, out?, options?) (src/cocos/3d/misc/create-mesh.ts:419), the pattern shipped by examples/interactive-geometry/src/main.ts:155.
  • "Feed a per-instance value into a material" -> renderer.setInstancedAttribute(name, value) (src/cocos/3d/framework/mesh-renderer.ts:733).

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
[
  "generate a box, sphere, cylinder or cone",
  "attach procedural geometry to a renderer",
  "author custom vertex buffers and indices",
  "read or copy mesh attributes",
  "a primitive descriptor fails validation"
]
owns
[
  "primitive-geometry",
  "mesh-buffers",
  "vertex-attributes",
  "mesh-indices",
  "mesh-renderer",
  "wireframe"
]
not_for
[
  "draw-call batching and instancing -> cocosair-performance",
  "skeletal binding or morph weights -> cocosair-skinning-morph",
  "material uniforms and effects -> cocosair-materials-effects"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "构建基本几何和原生 Mesh,检查顶点属性、索引、边界与渲染器写入契约。用于代码生成几何或自定义网格。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-primitives-mesh