Borrowing it
Nothing to install: this file belongs to hexianWeb/Third-Person-MC. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/hexianWeb/Third-Person-MC/main/.agent/skills/vtj-raycasting-system/SKILL.mdgit clone --depth 1 https://github.com/hexianWeb/Third-Person-MCWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hexianweb/third-person-mc/vtj-raycasting-system)<a href="https://agentmods.dev/skills/hexianweb/third-person-mc/vtj-raycasting-system"><img src="https://agentmods.dev/badge/skills/hexianweb/third-person-mc/vtj-raycasting-system.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00029 | $0.02478 |
| Opus 5 | $0.00015 | $0.01239 |
| Sonnet 5 | $0.00006 | $0.00496 |
| Haiku 4.5 | $0.00003 | $0.00248 |
Grade A, and why
vtj-raycasting-system scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 374 lines — stays where its author put it; the contents beside it link to each section on GitHub.
vite-threejs Raycasting System
Overview
本项目的射线系统主要用于 方块交互(挖掘、放置)和 目标选择。
核心原则:始终使用 iMouse.normalizedMouse 获取 NDC 坐标,射线检测结果通过 mitt 事件通知。
When to Use
- 实现点击拾取功能
- 检测鼠标悬停对象
- 实现方块交互(挖掘、放置)
- 添加目标锁定功能
基础 Raycaster 模式
import * as THREE from 'three'
import Experience from './experience.js'
import emitter from './utils/event-bus.js'
export default class ObjectPicker {
constructor() {
this.experience = new Experience()
this.scene = this.experience.scene
this.camera = this.experience.camera.instance
this.iMouse = this.experience.iMouse
this.raycaster = new THREE.Raycaster()
this.intersects = []
// 配置
this.params = {
enabled: true,
maxDistance: 100,
}
// 绑定事件
this._handleClick = this._handleClick.bind(this)
emitter.on('input:mouse_down', this._handleClick)
}
_handleClick({ button }) {
if (button !== 0 || !this.params.enabled) return
// 使用 IMouse 的 normalizedMouse(MANDATORY)
const ndc = this.iMouse.normalizedMouse
this.raycaster.setFromCamera(ndc, this.camera)
// 检测交叉
this.intersects = this.raycaster.intersectObjects(
this.scene.children,
true // recursive
)
if (this.intersects.length > 0) {
const hit = this.intersects[0]
emitter.emit('game:object-picked', {
object: hit.object,
point: hit.point,
distance: hit.distance,
})
}
}
destroy() {
emitter.off('input:mouse_down', this._handleClick)
}
}
屏幕中心射线(第一人称准星)
const CENTER_SCREEN = new THREE.Vector2(0, 0)
update() {
// 第一人称:从屏幕中心发射
this.raycaster.setFromCamera(CENTER_SCREEN, this.camera)
// 或者第三人称:从鼠标位置发射
// this.raycaster.setFromCamera(this.iMouse.normalizedMouse, this.camera)
const intersects = this.raycaster.intersectObjects(this.targets, true)
// ...
}
方块交互模式
本项目的 BlockRaycaster 实现了体素方块的射线检测:
// src/js/interaction/block-raycaster.js
export default class BlockRaycaster {
constructor() {
this.experience = new Experience()
this.camera = this.experience.camera.instance
this.iMouse = this.experience.iMouse
this.raycaster = new THREE.Raycaster()
this.raycaster.far = 8 // 最大交互距离
this.params = {
useMouse: false, // false = 屏幕中心, true = 鼠标位置
}
this.result = {
hit: false,
blockPos: null,
faceNormal: null,
adjacentPos: null, // 放置方块的位置
}
}
update(terrainMeshes) {
// 选择射线原点
const ndc = this.params.useMouse
? this.iMouse.normalizedMouse
: new THREE.Vector2(0, 0)
this.raycaster.setFromCamera(ndc, this.camera)
const intersects = this.raycaster.intersectObjects(terrainMeshes, false)
if (intersects.length > 0) {
const hit = intersects[0]
// 计算方块坐标(向下取整到格子中心)
const blockX = Math.floor(hit.point.x - hit.face.normal.x * 0.5)
const blockY = Math.floor(hit.point.y - hit.face.normal.y * 0.5)
const blockZ = Math.floor(hit.point.z - hit.face.normal.z * 0.5)
// 计算相邻方块位置(放置用)
const adjacentX = blockX + Math.round(hit.face.normal.x)
const adjacentY = blockY + Math.round(hit.face.normal.y)
const adjacentZ = blockZ + Math.round(hit.face.normal.z)
this.result = {
hit: true,
blockPos: new THREE.Vector3(blockX, blockY, blockZ),
faceNormal: hit.face.normal.clone(),
adjacentPos: new THREE.Vector3(adjacentX, adjacentY, adjacentZ),
distance: hit.distance,
}
} else {
this.result.hit = false
}
return this.result
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 374 lines · 29 tokens per session scan A 75b1dd1fc8c4
vtj-raycasting-system is a skill published in the GitHub repository hexianWeb/Third-Person-MC (190 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 2,478 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
super-claudio-brothers
Generate a unique themed Super Claudio Brothers platformer. Creates a custom level, colour palette, enemy look, and Claudio costume. Every run produces a different game.
audio-and-sound
Use this skill when adding audio or sound to a Phaser 4 game. Covers loading audio, playing sounds, music, volume, spatial audio, Web Audio API, and SoundManager. Triggers on: sound, audio, music, volume, mute.
events-system
Use this skill when working with the Phaser 4 event system. Covers EventEmitter, scene events, game events, custom events, and event-driven communication. Triggers on: events, on, emit, EventEmitter, scene events, listeners.
filters-and-postfx
Use this skill when applying visual filters or post-processing effects in Phaser 4. Covers bloom, blur, glow, color matrix, barrel distortion, displacement, custom shaders, and the filter pipeline. Triggers on: filter, post-processing, shader, bloom, blur, glow, color effects.
game-object-components
Use this skill when working with Phaser 4 game object components and the mixin system. Covers Transform, Alpha, Tint, Origin, Depth, Flip, Mask, GetBounds, Lighting, and other shared component behaviors. Triggers on: component, mixin, transform, mask, bounds, lighting.
game-setup-and-config
Use this skill when creating a new Phaser 4 game instance or configuring GameConfig options. Covers renderer selection, canvas setup, scaling, pixel art, FPS settings, boot sequence, and all config sub-objects. Triggers on: new Phaser.Game, GameConfig, game setup, renderer, pixel art, FPS.