.splat-viewer

Rules for using a SplatViewer component, which displays interactive 3D Gaussian-splat scenes in a web page. They specify the source asset, required controls and buttons, layout behavior, and supported interaction and loading options.

In plain words
What is it for?
Use them when creating SplatViewer examples with camera controls, loading states, menus, downloads, full-screen actions, overlays, or large lazily loaded assets.
Why use it?
They keep examples consistent with the component's expected structure and prevent controls or layout from being wired up incorrectly.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/playcanvas/react/splat-viewer
Clone the repo
git clone --depth 1 https://github.com/playcanvas/react
Per session 608 This file is loaded in full into every session.
When invoked 608 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00608 $0.00608
Opus 5 $0.00304 $0.00304
Sonnet 5 $0.00122 $0.00122
Haiku 4.5 $0.00061 $0.00061

Measured yesterday against content hash 60a2608833e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

.splat-viewer 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 yesterday.

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.

packages/blocks/src/.splat-viewer.mdc · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SplatViewer Component

A responsive and composable component for displaying Gaussian splats. Includes built-in camera controls, loading states, and optional UI slots for overlays or actions. Supports large assets with lazy loading and automatic framing.

📚 Splat Viewer Docs

Features

  • Orbit and fly controls
  • Keyboard and mouse controls
  • Controlled and uncontrolled mode
  • Suspenseful loading
  • Camera animations (coming soon)
  • Way points (coming soon)

Rules

Example

import * as Splat from '@/components/ui/splat-viewer';
import './viewer.css';

export function SplatViewerDemo() {
  return (
    <Splat.Viewer src={splatUrl} autoPlay className="rounded-t-lg lg:rounded-lg shadow-xl cursor-grab active:cursor-grabbing" >
      <Splat.Controls autoHide >
        <div className="flex gap-1 pointer-events-auto flex-grow">
            <Splat.FullScreenButton />
            <Splat.DownloadButton />
        </div>
        <div className="flex gap-1 pointer-events-auto">
          <Splat.CameraModeToggle />
          <Splat.HelpButton />
          <Splat.MenuButton />
        </div>
      </Splat.Controls>
  </Splat.Viewer>
  )
}

Styling

.splat-viewer {
  background-color: #f0f2e5;
  padding-left: .3rem;
  padding-right: .3rem;
  border-radius: .3rem;
}

Component Parts

import { 
  SplatViewer, 
  FullScreenButton, 
  DownloadButton, 
  MenuButton, 
  Controls 
} from "@/components/ui/splat-viewer";

Props

type SplatViewerProps = {
  src: string;              // URL of the splat file
  autoPlay?: boolean;       // Whether to automatically start playing
  className?: string;       // Additional CSS classes
  children?: React.ReactNode; // UI controls and overlays
}

Read the full file on GitHub · 93 lines

Changes

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.

  1. yesterday First seen · 93 lines · 608 tokens per session scan A 60a2608833e1

Subscribe to this mod's changes

.splat-viewer is a cursor rule published in the GitHub repository playcanvas/react (525 stars, last pushed 13d ago), licensed MIT. It adds 608 tokens to every session, about $0.0030 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.