sceneview-mcp 3.5.5 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -12
- package/llms.txt +131 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ catch {
|
|
|
39
39
|
API_DOCS = "SceneView API docs not found. Run `npm run prepare` to bundle llms.txt.";
|
|
40
40
|
}
|
|
41
41
|
const NODE_SECTIONS = parseNodeSections(API_DOCS);
|
|
42
|
-
const server = new Server({ name: "sceneview-mcp", version: "3.
|
|
42
|
+
const server = new Server({ name: "sceneview-mcp", version: "3.6.1" }, { capabilities: { resources: {}, tools: {} } });
|
|
43
43
|
// ─── Resources ───────────────────────────────────────────────────────────────
|
|
44
44
|
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
45
45
|
resources: [
|
|
@@ -514,7 +514,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
514
514
|
? [
|
|
515
515
|
`**SPM dependency:**`,
|
|
516
516
|
`\`\`\`swift`,
|
|
517
|
-
`.package(url: "${sample.spmDependency ?? sample.dependency}", from: "3.6.
|
|
517
|
+
`.package(url: "${sample.spmDependency ?? sample.dependency}", from: "3.6.1")`,
|
|
518
518
|
`\`\`\``,
|
|
519
519
|
]
|
|
520
520
|
: [
|
|
@@ -732,7 +732,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
732
732
|
` name: "MyApp",`,
|
|
733
733
|
` platforms: [.iOS(.v17), .macOS(.v14), .visionOS(.v1)],`,
|
|
734
734
|
` dependencies: [`,
|
|
735
|
-
` .package(url: "https://github.com/sceneview/sceneview", from: "3.6.
|
|
735
|
+
` .package(url: "https://github.com/sceneview/sceneview", from: "3.6.1")`,
|
|
736
736
|
` ],`,
|
|
737
737
|
` targets: [`,
|
|
738
738
|
` .executableTarget(`,
|
|
@@ -803,7 +803,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
803
803
|
`### 1. Add SPM Dependency`,
|
|
804
804
|
``,
|
|
805
805
|
`\`\`\`swift`,
|
|
806
|
-
`.package(url: "https://github.com/sceneview/sceneview", from: "3.6.
|
|
806
|
+
`.package(url: "https://github.com/sceneview/sceneview", from: "3.6.1")`,
|
|
807
807
|
`\`\`\``,
|
|
808
808
|
``,
|
|
809
809
|
`### 2. Minimum Platform`,
|
|
@@ -1083,15 +1083,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1083
1083
|
// ── list_platforms ────────────────────────────────────────────────────────
|
|
1084
1084
|
case "list_platforms": {
|
|
1085
1085
|
const platforms = [
|
|
1086
|
-
{ platform: "Android", renderer: "Filament", framework: "Jetpack Compose", status: "Stable", version: "3.6.
|
|
1087
|
-
{ platform: "Android TV", renderer: "Filament", framework: "Compose TV", status: "Alpha", version: "3.6.
|
|
1086
|
+
{ platform: "Android", renderer: "Filament", framework: "Jetpack Compose", status: "Stable", version: "3.6.1", dependency: "io.github.sceneview:sceneview:3.6.0", features: ["3D", "AR (ARCore)", "Model loading (GLB/glTF)", "Geometry nodes", "Physics", "Gestures"] },
|
|
1087
|
+
{ platform: "Android TV", renderer: "Filament", framework: "Compose TV", status: "Alpha", version: "3.6.1", dependency: "io.github.sceneview:sceneview:3.6.0", features: ["3D", "D-pad controls", "Auto-rotation", "Model loading"] },
|
|
1088
1088
|
{ platform: "Android XR", renderer: "Jetpack XR SceneCore", framework: "Compose XR", status: "Planned", version: "-", dependency: "-", features: ["Spatial computing", "Hand tracking", "Passthrough"] },
|
|
1089
|
-
{ platform: "iOS", renderer: "RealityKit", framework: "SwiftUI", status: "Alpha", version: "3.6.
|
|
1090
|
-
{ platform: "macOS", renderer: "RealityKit", framework: "SwiftUI", status: "Alpha", version: "3.6.
|
|
1091
|
-
{ platform: "visionOS", renderer: "RealityKit", framework: "SwiftUI", status: "Alpha", version: "3.6.
|
|
1092
|
-
{ platform: "Web", renderer: "Filament.js (WASM)", framework: "Kotlin/JS", status: "Alpha", version: "3.6.
|
|
1093
|
-
{ platform: "Desktop", renderer: "Software / Filament JNI", framework: "Compose Desktop", status: "Alpha", version: "3.6.
|
|
1094
|
-
{ platform: "Flutter", renderer: "Filament / RealityKit", framework: "PlatformView", status: "Alpha", version: "3.6.
|
|
1089
|
+
{ platform: "iOS", renderer: "RealityKit", framework: "SwiftUI", status: "Alpha", version: "3.6.1", dependency: "SceneViewSwift (SPM)", features: ["3D", "AR (ARKit)", "16 node types", "USDZ models"] },
|
|
1090
|
+
{ platform: "macOS", renderer: "RealityKit", framework: "SwiftUI", status: "Alpha", version: "3.6.1", dependency: "SceneViewSwift (SPM)", features: ["3D", "Orbit camera", "USDZ models"] },
|
|
1091
|
+
{ platform: "visionOS", renderer: "RealityKit", framework: "SwiftUI", status: "Alpha", version: "3.6.1", dependency: "SceneViewSwift (SPM)", features: ["3D", "Immersive spaces", "Hand tracking (planned)"] },
|
|
1092
|
+
{ platform: "Web", renderer: "Filament.js (WASM)", framework: "Kotlin/JS", status: "Alpha", version: "3.6.1", dependency: "@sceneview/sceneview-web", features: ["3D", "WebXR AR/VR", "GLB models", "WebGL2"] },
|
|
1093
|
+
{ platform: "Desktop", renderer: "Software / Filament JNI", framework: "Compose Desktop", status: "Alpha", version: "3.6.1", dependency: "sceneview-desktop (local)", features: ["3D", "Software renderer", "Wireframe"] },
|
|
1094
|
+
{ platform: "Flutter", renderer: "Filament / RealityKit", framework: "PlatformView", status: "Alpha", version: "3.6.1", dependency: "flutter pub: sceneview", features: ["3D", "AR", "Android + iOS bridge"] },
|
|
1095
1095
|
];
|
|
1096
1096
|
const lines = [
|
|
1097
1097
|
"## SceneView Supported Platforms\n",
|
package/llms.txt
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
SceneView is a declarative 3D and AR SDK for Android (Jetpack Compose, Filament, ARCore) and Apple platforms — iOS, macOS, visionOS (SwiftUI, RealityKit, ARKit) — with shared core logic via Kotlin Multiplatform. Each platform uses its native renderer: Filament on Android, RealityKit on Apple.
|
|
4
4
|
|
|
5
5
|
**Android — Maven artifacts (version 3.6.0):**
|
|
6
|
-
- 3D only: `io.github.sceneview:sceneview:3.6.
|
|
7
|
-
- AR + 3D: `io.github.sceneview:arsceneview:3.6.
|
|
6
|
+
- 3D only: `io.github.sceneview:sceneview:3.6.1`
|
|
7
|
+
- AR + 3D: `io.github.sceneview:arsceneview:3.6.1`
|
|
8
8
|
|
|
9
9
|
**Apple (iOS 17+ / macOS 14+ / visionOS 1+) — Swift Package:**
|
|
10
10
|
- `https://github.com/sceneview/sceneview-swift.git` (from: "3.6.0")
|
|
@@ -18,8 +18,8 @@ SceneView is a declarative 3D and AR SDK for Android (Jetpack Compose, Filament,
|
|
|
18
18
|
### build.gradle (app module)
|
|
19
19
|
```kotlin
|
|
20
20
|
dependencies {
|
|
21
|
-
implementation("io.github.sceneview:sceneview:3.6.
|
|
22
|
-
implementation("io.github.sceneview:arsceneview:3.6.
|
|
21
|
+
implementation("io.github.sceneview:sceneview:3.6.1") // 3D only
|
|
22
|
+
implementation("io.github.sceneview:arsceneview:3.6.1") // AR (includes sceneview)
|
|
23
23
|
}
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -836,10 +836,13 @@ class ModelLoader(engine: Engine, context: Context) {
|
|
|
836
836
|
fun createModelInstance(buffer: Buffer): ModelInstance
|
|
837
837
|
fun createModelInstance(@RawRes rawResId: Int): ModelInstance
|
|
838
838
|
fun createModelInstance(file: File): ModelInstance
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
fun createModel(
|
|
839
|
+
|
|
840
|
+
// releaseSourceData (default true): frees the raw buffer after Filament parses the model.
|
|
841
|
+
// Set to false only when you need to re-instantiate the same model multiple times.
|
|
842
|
+
fun createModel(assetFileLocation: String, releaseSourceData: Boolean = true): Model
|
|
843
|
+
fun createModel(buffer: Buffer, releaseSourceData: Boolean = true): Model
|
|
844
|
+
fun createModel(@RawRes rawResId: Int, releaseSourceData: Boolean = true): Model
|
|
845
|
+
fun createModel(file: File, releaseSourceData: Boolean = true): Model
|
|
843
846
|
|
|
844
847
|
// Async — safe from any thread
|
|
845
848
|
suspend fun loadModel(fileLocation: String): Model?
|
|
@@ -1369,6 +1372,113 @@ fun ARFaceTracking() {
|
|
|
1369
1372
|
|
|
1370
1373
|
---
|
|
1371
1374
|
|
|
1375
|
+
## Android Advanced APIs
|
|
1376
|
+
|
|
1377
|
+
### SceneRenderer
|
|
1378
|
+
|
|
1379
|
+
`SceneRenderer` encapsulates the Filament surface lifecycle and render-frame pipeline. Both `SceneView` (3D) and `ARSceneView` (AR) share the same surface management and frame-presentation code through this class.
|
|
1380
|
+
|
|
1381
|
+
```kotlin
|
|
1382
|
+
class SceneRenderer(engine: Engine, view: View, renderer: Renderer) {
|
|
1383
|
+
val isAttached: Boolean // true when a swap chain is ready
|
|
1384
|
+
var onSurfaceResized: ((width: Int, height: Int) -> Unit)?
|
|
1385
|
+
var onSurfaceReady: ((viewHeight: () -> Int) -> Unit)?
|
|
1386
|
+
var onSurfaceDestroyed: (() -> Unit)?
|
|
1387
|
+
|
|
1388
|
+
fun attachToSurfaceView(surfaceView: SurfaceView, isOpaque: Boolean, context: Context, display: Display, onTouch: ((MotionEvent) -> Unit)? = null)
|
|
1389
|
+
fun attachToTextureView(textureView: TextureView, isOpaque: Boolean, context: Context, display: Display, onTouch: ((MotionEvent) -> Unit)? = null)
|
|
1390
|
+
fun renderFrame(frameTimeNanos: Long, onBeforeRender: () -> Unit)
|
|
1391
|
+
fun applyResize(width: Int, height: Int)
|
|
1392
|
+
fun destroy()
|
|
1393
|
+
}
|
|
1394
|
+
```
|
|
1395
|
+
|
|
1396
|
+
Typical composable usage:
|
|
1397
|
+
```kotlin
|
|
1398
|
+
val sceneRenderer = remember(engine, renderer) { SceneRenderer(engine, view, renderer) }
|
|
1399
|
+
DisposableEffect(sceneRenderer) { onDispose { sceneRenderer.destroy() } }
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
### NodeGestureDelegate
|
|
1403
|
+
|
|
1404
|
+
`NodeGestureDelegate` handles all gesture detection and callback logic for a `Node`. Gesture callbacks (e.g. `node.onTouch`, `node.onSingleTapConfirmed`) are forwarded through this delegate. Access it directly when you need to batch-configure callbacks or inspect `editingTransforms`:
|
|
1405
|
+
|
|
1406
|
+
```kotlin
|
|
1407
|
+
// Preferred — set callbacks directly on the node (delegates internally):
|
|
1408
|
+
node.onSingleTapConfirmed = { e -> true }
|
|
1409
|
+
node.onMove = { detector, e, worldPosition -> true }
|
|
1410
|
+
|
|
1411
|
+
// Advanced — access the delegate directly:
|
|
1412
|
+
node.gestureDelegate.editingTransforms // Set<KProperty1<Node, Any>> currently being edited
|
|
1413
|
+
node.gestureDelegate.onEditingChanged = { transforms -> /* transforms changed */ }
|
|
1414
|
+
```
|
|
1415
|
+
|
|
1416
|
+
Available callbacks on `NodeGestureDelegate` (and mirrored on `Node`):
|
|
1417
|
+
`onTouch`, `onDown`, `onShowPress`, `onSingleTapUp`, `onScroll`, `onLongPress`, `onFling`,
|
|
1418
|
+
`onSingleTapConfirmed`, `onDoubleTap`, `onDoubleTapEvent`, `onContextClick`,
|
|
1419
|
+
`onMoveBegin`, `onMove`, `onMoveEnd`,
|
|
1420
|
+
`onRotateBegin`, `onRotate`, `onRotateEnd`,
|
|
1421
|
+
`onScaleBegin`, `onScale`, `onScaleEnd`,
|
|
1422
|
+
`onEditingChanged`, `editingTransforms`.
|
|
1423
|
+
|
|
1424
|
+
### NodeAnimationDelegate
|
|
1425
|
+
|
|
1426
|
+
`NodeAnimationDelegate` handles smooth (interpolated) transform animation for a `Node`. Access via `node.animationDelegate`:
|
|
1427
|
+
|
|
1428
|
+
```kotlin
|
|
1429
|
+
// Preferred — use Node property aliases:
|
|
1430
|
+
node.isSmoothTransformEnabled = true
|
|
1431
|
+
node.smoothTransformSpeed = 5.0f // higher = faster convergence
|
|
1432
|
+
node.smoothTransform = targetTransform
|
|
1433
|
+
node.onSmoothEnd = { n -> /* reached target */ }
|
|
1434
|
+
|
|
1435
|
+
// Advanced — access the delegate directly:
|
|
1436
|
+
node.animationDelegate.smoothTransform = targetTransform
|
|
1437
|
+
```
|
|
1438
|
+
|
|
1439
|
+
The per-frame interpolation uses slerp. Once the transform reaches the target (within 0.001 tolerance), `onSmoothEnd` fires and the animation clears.
|
|
1440
|
+
|
|
1441
|
+
### NodeState
|
|
1442
|
+
|
|
1443
|
+
`NodeState` is an immutable snapshot of a `Node`'s observable state. Use it for ViewModel-driven UI or save/restore patterns:
|
|
1444
|
+
|
|
1445
|
+
```kotlin
|
|
1446
|
+
data class NodeState(
|
|
1447
|
+
val position: Position = Position(),
|
|
1448
|
+
val quaternion: Quaternion = Quaternion(),
|
|
1449
|
+
val scale: Scale = Scale(1f),
|
|
1450
|
+
val isVisible: Boolean = true,
|
|
1451
|
+
val isEditable: Boolean = false,
|
|
1452
|
+
val isTouchable: Boolean = true
|
|
1453
|
+
)
|
|
1454
|
+
|
|
1455
|
+
// Capture current state
|
|
1456
|
+
val state: NodeState = node.toState()
|
|
1457
|
+
|
|
1458
|
+
// Restore state
|
|
1459
|
+
node.applyState(state)
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
### ARPermissionHandler
|
|
1463
|
+
|
|
1464
|
+
`ARPermissionHandler` abstracts camera permission and ARCore availability checks away from `ComponentActivity`, enabling testability:
|
|
1465
|
+
|
|
1466
|
+
```kotlin
|
|
1467
|
+
interface ARPermissionHandler {
|
|
1468
|
+
fun hasCameraPermission(): Boolean
|
|
1469
|
+
fun requestCameraPermission(onResult: (granted: Boolean) -> Unit)
|
|
1470
|
+
fun shouldShowPermissionRationale(): Boolean
|
|
1471
|
+
fun openAppSettings()
|
|
1472
|
+
fun checkARCoreAvailability(): ArCoreApk.Availability
|
|
1473
|
+
fun requestARCoreInstall(userRequestedInstall: Boolean): Boolean
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// Production implementation backed by ComponentActivity:
|
|
1477
|
+
class ActivityARPermissionHandler(activity: ComponentActivity) : ARPermissionHandler
|
|
1478
|
+
```
|
|
1479
|
+
|
|
1480
|
+
---
|
|
1481
|
+
|
|
1372
1482
|
## sceneview-core (KMP)
|
|
1373
1483
|
|
|
1374
1484
|
`sceneview-core` is a Kotlin Multiplatform module containing platform-independent logic shared between Android and iOS. It targets `jvm("android")`, `iosArm64`, `iosSimulatorArm64`, and `iosX64`. It depends on `dev.romainguy:kotlin-math:1.6.0` (exposed as `api`).
|
|
@@ -1494,6 +1604,19 @@ generateShape(polygonPath: List<Float2>, polygonHoles: List<Int>, delaunayPoints
|
|
|
1494
1604
|
| `CollisionShape` | Base class — `rayIntersection(ray, rayHit): Boolean` |
|
|
1495
1605
|
| `Intersections` | Static tests: sphere-sphere, box-box, ray-sphere, ray-box, ray-plane |
|
|
1496
1606
|
|
|
1607
|
+
The Android `CollisionSystem` (in `sceneview` module) exposes `hitTest()` for screen-space and ray-based queries:
|
|
1608
|
+
```kotlin
|
|
1609
|
+
// Preferred API
|
|
1610
|
+
collisionSystem.hitTest(motionEvent): List<HitResult> // from touch event
|
|
1611
|
+
collisionSystem.hitTest(xPx, yPx): List<HitResult> // screen pixels
|
|
1612
|
+
collisionSystem.hitTest(viewPosition: Float2): List<HitResult> // normalized [0..1]
|
|
1613
|
+
collisionSystem.hitTest(ray: Ray): List<HitResult> // explicit ray
|
|
1614
|
+
|
|
1615
|
+
// @Deprecated — use hitTest() instead
|
|
1616
|
+
@Deprecated collisionSystem.raycast(ray): HitResult? // → hitTest(ray).firstOrNull()
|
|
1617
|
+
@Deprecated collisionSystem.raycastAll(ray): List<HitResult> // → hitTest(ray)
|
|
1618
|
+
```
|
|
1619
|
+
|
|
1497
1620
|
### Triangulation
|
|
1498
1621
|
|
|
1499
1622
|
| Class | Purpose |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sceneview-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"mcpName": "io.github.sceneview/mcp",
|
|
5
5
|
"description": "MCP server for SceneView — cross-platform 3D & AR SDK for Android and iOS. Give Claude the full SceneView SDK so it writes correct, compilable code.",
|
|
6
6
|
"keywords": [
|