diff --git a/benches/core/body.bench.ts b/benches/core/body.bench.ts index 0266813..a55466c 100644 --- a/benches/core/body.bench.ts +++ b/benches/core/body.bench.ts @@ -4,6 +4,7 @@ import * as cameraState from '../../src/core/CameraState'; import { FollowBodyThree } from '../../src/three/body/FollowBodyThree'; import { HardLockToTargetBodyThree } from '../../src/three/body/HardLockToTargetBodyThree'; +import { OrbitFollowBodyThree } from '../../src/three/body/OrbitFollowBodyThree'; import { PositionComposerBodyThree } from '../../src/three/body/PositionComposerBodyThree'; import { makeMovingMeshTarget, makeMovingTarget } from '../targets'; @@ -32,6 +33,31 @@ group('Body.update @body', () => { }); }); + bench('OrbitFollow (damping, axis moving)', function* () { + const { object, step } = makeMovingTarget(); + const body = new OrbitFollowBodyThree(object, { damping: 0.5 }); + const out = cameraState.create(); + yield warm(() => { + step(); + body.horizontal.applyDelta(0.5); + body.update(out, 0.016, false); + return out.position[0]; + }); + }); + + bench('OrbitFollow (threeRing, damping, axis moving)', function* () { + const { object, step } = makeMovingTarget(); + const body = new OrbitFollowBodyThree(object, { orbitStyle: 'threeRing', damping: 0.5 }); + const out = cameraState.create(); + yield warm(() => { + step(); + body.horizontal.applyDelta(0.5); + body.vertical.applyDelta(Math.sin(body.horizontal.value) * 0.5); + body.update(out, 0.016, false); + return out.position[0]; + }); + }); + bench('PositionComposer (deadZone + hardLimit)', function* () { const { object, step } = makeMovingTarget(); const body = new PositionComposerBodyThree(object, { diff --git a/docs/advanced/custom-components.mdx b/docs/advanced/custom-components.mdx index e2956c6..2bbcda4 100644 --- a/docs/advanced/custom-components.mdx +++ b/docs/advanced/custom-components.mdx @@ -81,6 +81,7 @@ export function pointerDrift(pointer: { x: number; y: number }, strength = 0.1, | `target`, `hasTarget` | `Vec3`, `boolean` | The point the Body follows, if any. Used by [blend hints](/blending/introduction#blend-hints). | | `lookAtTarget`, `hasLookAtTarget` | `Vec3`, `boolean` | The point the Aim looks at, if any. | | `referenceUp` | `Vec3` | Which way is up for Aims. Defaults to `[0, 1, 0]`. | +| `rotationDampingBypass` | `Quat` | How far a Body turned the camera this frame, for example around an orbit. Aims with damping follow this turn right away. Reset to identity every frame. | Vectors are plain arrays (`[x, y, z]`, quaternions `[x, y, z, w]`) from [`math`](https://github.com/pmndrs/math), which klipp depends on. Use its `vec3` and `quat` functions to work with them, or copy to three.js with `vector.fromArray(out.position)`. diff --git a/docs/body/camera-controls.mdx b/docs/body/camera-controls.mdx index 1335173..9fdc38d 100644 --- a/docs/body/camera-controls.mdx +++ b/docs/body/camera-controls.mdx @@ -1,7 +1,7 @@ --- title: CameraControls description: Lets the user orbit, pan and zoom with the mouse or touch. -nav: 24 +nav: 25 --- A user-controlled orbit camera, built on [`camera-controls`](https://github.com/yomotsu/camera-controls). It still takes part in priority and blending like any other camera. Unlike other Bodies, it controls both position and rotation, so don't add an Aim next to it. diff --git a/docs/body/follow.mdx b/docs/body/follow.mdx index 543afb6..f3de3af 100644 --- a/docs/body/follow.mdx +++ b/docs/body/follow.mdx @@ -12,7 +12,8 @@ Keeps the camera at `offset` from the target. By default the offset turns with t | ------- | ----------- | ------- | | `target` | What to follow. See [Targets](/getting-started/core-concepts#targets). | | | `offset` | Where the camera sits relative to the target. | `[0, 0, 10]` | -| `damping` | Seconds to catch up with the target. `0` is instant. See [Damping](/getting-started/core-concepts#damping). | `0` | +| `damping` | Seconds to catch up with the target's position. `0` is instant. See [Damping](/getting-started/core-concepts#damping). | `0` | +| `rotationDamping` | Seconds to turn with the target, for every `bindingMode` but `worldSpace`. `0` is instant. | `0` | | `maxSpeed` | Maximum catch-up speed, in units per second. | `Infinity` | | `bindingMode` | How the offset turns with the target. See below. | `BindingModes.lockToTarget` | @@ -23,7 +24,7 @@ Keeps the camera at `offset` from the target. By default the offset turns with t | `lockToTarget` | full rotation, including roll. | | `lockToTargetNoRoll` | yaw and pitch, but never rolls. | | `lockToTargetWithWorldUp` | yaw only. Good for flying or jumping targets. | -| `lockToTargetOnAssign` | rotation at the moment `target` is set, then stays fixed. | +| `lockToTargetOnAssign` | rotation at the moment `target` is set, the camera goes live or this mode is chosen, then stays fixed. | | `worldSpace` | nothing. The offset is always in world space. | A target without rotation, like a fixed point, always uses world space. diff --git a/docs/body/introduction.mdx b/docs/body/introduction.mdx index 21ac584..41b5dcc 100644 --- a/docs/body/introduction.mdx +++ b/docs/body/introduction.mdx @@ -12,6 +12,7 @@ A Body decides where the camera is. Where it looks is up to the [Aim](/aim/intro | ---- | ---------- | | [`HardLockToTarget`](/body/hard-lock-to-target) | Placing the camera exactly on a target: first person, a camera mounted on something, a fixed spot. | | [`Follow`](/body/follow) | Keeping a fixed offset from a target: chase cameras, third person. | +| [`OrbitFollow`](/body/orbit-follow) | Letting the user orbit and zoom around a target: third person, inspecting an object. | | [`PositionComposer`](/body/position-composer) | Keeping a target at a spot on screen: top-down, side-scrollers, anything with a fixed rotation. | | [`CameraControls`](/body/camera-controls) | Letting the user orbit, pan and zoom. three.js and React only. | diff --git a/docs/body/orbit-follow.mdx b/docs/body/orbit-follow.mdx new file mode 100644 index 0000000..f43220b --- /dev/null +++ b/docs/body/orbit-follow.mdx @@ -0,0 +1,148 @@ +--- +title: OrbitFollow +description: Lets the user orbit and zoom around a target. +nav: 23 +--- + +Puts the camera on a sphere around the target, or on a surface through [three rings](#three-rings). Three [`InputAxis`](/input/input-axis) pick the spot: `horizontal` goes around the target and `vertical` up and down, both in degrees, and `radial` zooms. They can be driven by the mouse, touch, the wheel and pinches through an [input controller](/input/input-controller), or from code. Pair it with an Aim that looks at the same target, like [`HardLookAt`](/aim/hard-look-at), for an orbit or third person camera. + +The camera sits `radius × exp(radial)` away from the target. `radial` is the natural log of the zoom: `0` is `radius`, `ln 2` twice as far, `ln 0.5` half as far. That way each step of the wheel zooms by the same ratio near and far, and a pinch zooms exactly as much as the fingers spread. + +To start from a specific spot, pass a `position` to the camera's [`initialState`](/api/virtual-camera#initialstate). `horizontal` and `vertical` are set from its direction around the target, `radial` keeps its value. Later on, `setFromPosition(position)` and `setFromRotation(rotation)` on the body ease the camera there with the axes' damping. + +## Settings + +| Setting | Description | Default | +| ------- | ----------- | ------- | +| `target` | What to orbit. See [Targets](/getting-started/core-concepts#targets). | | +| `orbitStyle` | `'sphere'`, or `'threeRing'` for a surface through three rings. | `'sphere'` | +| `radius` | Distance from the target while `radial` is `0`, for `'sphere'`. Changes ease in with the `radial` axis' `damping`. | `10` | +| `orbits` | The `top`, `center` and `bottom` ring for `'threeRing'`, each a `radius` and a `height` above the target. | see [Three rings](#three-rings) | +| `splineCurvature` | How strongly the `'threeRing'` surface curves between the rings, from `0` to `1`. | `0` | +| `targetOffset` | Center of the orbit relative to the target, turned by `bindingMode`. | `[0, 0, 0]` | +| `bindingMode` | How the orbit turns with the target. See [Follow](/body/follow#bindingmode). | `BindingModes.worldSpace` | +| `damping` | Seconds to catch up with the target. See [Damping](#damping). | `0` | +| `rotationDamping` | Seconds to turn with the target, for every `bindingMode` but `worldSpace`. | `0` | +| `maxSpeed` | Maximum catch-up speed, in units per second. | `Infinity` | +| `recenteringTarget` | Where `horizontal` recenters to: `'trackingTarget'` brings the camera back behind the target, `'axisCenter'` to the axis' `center`. | `'trackingTarget'` | +| `horizontal`, `vertical`, `radial` | React only. Settings for each axis, like `range`, `damping` or `recentering`. On the core and in three.js, set them on `body.horizontal` and the others. | see [Axes](#axes) | +| `autoNormalize` | React only. Keep `horizontal` inside its range after each drag. `autoNormalize` on the axis elsewhere. | `false` | +| `debug` | React only. Draws the orbit in the scene. See [Debugging](/debugging/introduction#orbits). | `false` | + +## Axes + +| Axis | Range | Center | Wraps | +| ---- | ----- | ------ | ----- | +| `horizontal` | `[-180, 180]` | `0`, the camera on the target's `+Z` side | yes | +| `vertical` | `[-90, 90]` | `0`, level with the target | no | +| `radial` | `[ln 0.5, ln 2]` | `0` | no | + +Every axis starts at its `center`. Dragging right with a positive `gain` turns the view right, the same way as [`PanTilt`](/aim/pan-tilt). + +Axes with the same `recentering.time` [recenter](/input/input-axis#recentering) together: input on one of them restarts the wait on the others. With `recenteringTarget: 'trackingTarget'`, the default, `horizontal` recenters behind the target's forward, `-Z`, whatever the `bindingMode`. + +## Three rings + +With `orbitStyle: 'threeRing'`, `vertical` runs from the `bottom` ring at the start of its range, through `center`, to the `top` ring at its end, and `radial` scales the whole surface. The rings let the camera come closer when it looks from above or below. + +By default all three rings have a `radius` of `10`, at heights `-10`, `0` and `10`: a plain cylinder whose center ring is where the sphere starts. + +## Damping + +`damping` makes the camera lag behind a moving target. Going around the orbit is never delayed by it, the camera turns around the target right away. To smooth the input itself, set `damping` on the axes. + +An Aim with damping, like [`RotationComposer`](/aim/rotation-composer), also follows the turns of the orbit without its damping, so the target stays in place on screen while the user drags. + +## Usage + + + + Core + three.js + React Three Fiber + + + +```ts +import { HardLookAtAim, OrbitFollowBody, targetPose } from '@kvvasuu/klipp'; +import { InputControllerDom } from '@kvvasuu/klipp/dom'; + +const player = targetPose.create(); // keep player.position up to date + +const body = new OrbitFollowBody(player, { radius: 8, damping: 0.3 }); +body.radial.damping = 0.15; +camera.body = body; +camera.aim = new HardLookAtAim(player); + +const orbit = { axes: { x: body.horizontal, y: body.vertical }, gain: 0.3 }; +const controller = new InputControllerDom({ + mouseButtons: { left: orbit }, + touches: { one: orbit }, + wheel: { axis: body.radial, gain: 0.001, invert: true }, + pinch: { axis: body.radial, invert: true }, +}); +klipp.whileOnScreen(camera, () => { + controller.connect(canvas); + return () => controller.disconnect(); +}); +klipp.registerUpdate(() => controller.update()); +``` + +Scrolling up and spreading a pinch are positive, while zooming in makes `radial` smaller, hence `invert`. + +**Recentering** + +```ts +const recentering = { enabled: true, wait: 1, time: 0.5 }; +body.horizontal.recentering = recentering; +body.vertical.recentering = recentering; +``` + + + + +```ts +import { Vector3 } from 'three'; +import { HardLookAtAimThree, OrbitFollowBodyThree } from '@kvvasuu/klipp/three'; + +const body = new OrbitFollowBodyThree(player, { radius: 8, targetOffset: new Vector3(0, 1.5, 0), damping: 0.3 }); +body.radial.damping = 0.15; +camera.body = body; +camera.aim = new HardLookAtAimThree(player); +``` + +Map the input as on the core. + + + + +```tsx +import { Aim, Body, InputController, VirtualCamera } from '@kvvasuu/klipp/react'; + +const orbit = { axes: { x: 'horizontal', y: 'vertical' }, gain: 0.3 }; + + + + + + + +``` + +`ref` gives you the `OrbitFollowBodyThree`. Removing an axis setting brings back its default without moving the axis. + +**Recentering** + +```tsx +const recentering = { enabled: true, wait: 1, time: 0.5 }; + + +``` + + + diff --git a/docs/body/position-composer.mdx b/docs/body/position-composer.mdx index 8fdb902..3ad127f 100644 --- a/docs/body/position-composer.mdx +++ b/docs/body/position-composer.mdx @@ -1,7 +1,7 @@ --- title: PositionComposer description: Moves the camera to keep a target at a spot on screen. -nav: 23 +nav: 24 --- Moves the camera, without rotating it, so the target stays at `screenPosition` and `cameraDistance` away. With a `deadZone` the target can move freely inside it before the camera reacts. diff --git a/docs/debugging/introduction.mdx b/docs/debugging/introduction.mdx index 861693b..b4163b9 100644 --- a/docs/debugging/introduction.mdx +++ b/docs/debugging/introduction.mdx @@ -1,6 +1,6 @@ --- title: Debugging -description: Visualize framing zones and camera frustums. +description: Visualize framing zones, camera frustums and orbits. nav: 80 --- @@ -25,6 +25,10 @@ Each element has a CSS class you can restyle: `klipp-debug-deadzone`, `klipp-deb A frustum helper draws a camera in the scene, so you can see where an inactive camera is and what it's looking at. Every camera's `state` holds what it needs: `position`, `quaternion`, `fov`, `near` and `far`. Off screen, a camera updates only now and then by default, so its frustum moves in steps. Give it [`standbyUpdate: 'always'`](/api/virtual-camera#standbyupdate) to see it move smoothly. +## Orbits + +An orbit helper draws where an [`OrbitFollow`](/body/orbit-follow) camera can move, around the point it tracks: the circle `horizontal` moves it along in orange, the arc `vertical` moves it along in blue, and the three rings of `'threeRing'` in gray. + ## Usage @@ -50,6 +54,10 @@ overlay.render(debugZones.composer(body.screenPosition, body.deadZone, body.hard `debugZones.composer` turns a composer's settings into the same boxes the React components draw. Call `render` again whenever the zones change, and `disconnect()` to remove the overlay. For group framing, `debugZones.groupFramingPaddingBox` gives the size of the padding boundary. +**Orbits** + +`orbitFollow.point(out, body.state, body, horizontal, vertical)` gives where the camera would be at any axis values, to draw with your own renderer. + @@ -83,6 +91,20 @@ scene.add(helper); helper.sync(securityCam.state, innerWidth / innerHeight); ``` +**Orbits** + +```ts +import { OrbitFollowHelperThree } from '@kvvasuu/klipp/three'; + +const helper = new OrbitFollowHelperThree(); +scene.add(helper); + +// every frame, after klipp.update +helper.sync(body); +``` + +`helper.colors` holds the `horizontal`, `vertical` and `rings` colors. + @@ -116,5 +138,13 @@ import { CameraFrustumHelper } from '@kvvasuu/klipp/react'; `ref` gives you the `THREE.CameraHelper`. +**Orbits** + +Add the `debug` prop: + +```tsx + +``` + diff --git a/docs/getting-started/building-on-the-core.mdx b/docs/getting-started/building-on-the-core.mdx index f9d08cb..af0a64c 100644 --- a/docs/getting-started/building-on-the-core.mdx +++ b/docs/getting-started/building-on-the-core.mdx @@ -48,7 +48,7 @@ class EngineFollow extends FollowBody { camera.body = new EngineFollow(player, { offset: [0, 3, 8] }); ``` -The same works for `HardLockToTargetBody`, `PositionComposerBody`, `HardLookAtAim`, `RotateWithFollowTargetAim`, `RotationComposerAim` and `PanTiltAim`. `GroupFramingExtension` reads its members through `readMembers`. +The same works for `HardLockToTargetBody`, `OrbitFollowBody`, `PositionComposerBody`, `HardLookAtAim`, `RotateWithFollowTargetAim`, `RotationComposerAim` and `PanTiltAim`. `GroupFramingExtension` reads its members through `readMembers`. diff --git a/docs/getting-started/core-concepts.mdx b/docs/getting-started/core-concepts.mdx index cf09fc3..f7f358c 100644 --- a/docs/getting-started/core-concepts.mdx +++ b/docs/getting-started/core-concepts.mdx @@ -18,7 +18,7 @@ Each camera is made of up to four kinds of pieces, which run in this order every | Piece | What it does | How many | Examples | | ----- | ------------ | -------- | -------- | -| [Body](/body/introduction) | Moves the camera | one | `Follow`, `PositionComposer` | +| [Body](/body/introduction) | Moves the camera | one | `Follow`, `OrbitFollow`, `PositionComposer` | | [Aim](/aim/introduction) | Rotates the camera | one | `HardLookAt`, `RotationComposer` | | [Extension](/extension/introduction) | Adjusts the finished shot | any | `GroupFraming`, `Lens` | | [Noise](/noise/introduction) | Adds shake on top | any | `BasicMultiChannelPerlin`, `ImpulseListener` | diff --git a/docs/input/introduction.mdx b/docs/input/introduction.mdx index 061d0c5..1135b3a 100644 --- a/docs/input/introduction.mdx +++ b/docs/input/introduction.mdx @@ -4,7 +4,7 @@ description: Mouse, touch, wheel and pinch input for cameras, or your own data. nav: 60 --- -Some pieces can be controlled by the user, like [`PanTilt`](/aim/pan-tilt). They expose **axes** (`pan`, `tilt`), and an [input controller](/input/input-controller) maps mouse and touch drags, the wheel and pinches onto those axes. +Some pieces can be controlled by the user, like [`PanTilt`](/aim/pan-tilt) or [`OrbitFollow`](/body/orbit-follow). They expose **axes** (`pan` and `tilt`, or `horizontal`, `vertical` and `radial`), and an [input controller](/input/input-controller) maps mouse and touch drags, the wheel and pinches onto those axes. Each axis is an [`InputAxis`](/input/input-axis), a value with limits, wrapping, damping and optional recentering. You can also drive an axis from your own code, for example in a cutscene, see [Input from data](/input/input-from-data). diff --git a/examples/src/index.css b/examples/src/index.css index b8b6552..c5f4ed2 100644 --- a/examples/src/index.css +++ b/examples/src/index.css @@ -361,6 +361,14 @@ body { text-align: center; } +.input-area { + position: absolute; + box-sizing: border-box; + border: 2px dashed #7ed957; + background: rgb(126 217 87 / 0.08); + pointer-events: none; +} + .pan-tilt-crosshair { position: absolute; top: 50%; diff --git a/examples/src/registry/examples.ts b/examples/src/registry/examples.ts index 682d8ef..6a18c72 100644 --- a/examples/src/registry/examples.ts +++ b/examples/src/registry/examples.ts @@ -13,6 +13,12 @@ import { BlendHints } from '../scenes/blending/BlendHints'; import { CustomBlends } from '../scenes/blending/CustomBlends'; import { Follow } from '../scenes/body/Follow'; import { HardLockToTarget } from '../scenes/body/HardLockToTarget'; +import { OrbitFollow } from '../scenes/body/OrbitFollow'; +import { OrbitFollowBindingMode } from '../scenes/body/OrbitFollowBindingMode'; +import { OrbitFollowDampedAim } from '../scenes/body/OrbitFollowDampedAim'; +import { OrbitFollowGroupFraming } from '../scenes/body/OrbitFollowGroupFraming'; +import { OrbitFollowRecentering } from '../scenes/body/OrbitFollowRecentering'; +import { OrbitFollowThreeRing } from '../scenes/body/OrbitFollowThreeRing'; import { PositionComposer } from '../scenes/body/PositionComposer'; import { PositionComposerDolly } from '../scenes/body/PositionComposerDolly'; import { PositionComposerLookahead } from '../scenes/body/PositionComposerLookahead'; @@ -20,6 +26,9 @@ import { GroupFraming } from '../scenes/extension/GroupFraming'; import { Lens } from '../scenes/extension/Lens'; import { Impulse } from '../scenes/impulse/Impulse'; import { InputFromData } from '../scenes/input/InputFromData'; +import { InputRawInput } from '../scenes/input/InputRawInput'; +import { InputTouchAndAreas } from '../scenes/input/InputTouchAndAreas'; +import { InputWheelAndPinch } from '../scenes/input/InputWheelAndPinch'; import { BasicMultiChannelPerlin } from '../scenes/noise/BasicMultiChannelPerlin'; import { Placeholder } from '../scenes/Placeholder'; import { StandbyUpdate } from '../scenes/virtual-camera/StandbyUpdate'; @@ -50,6 +59,72 @@ export const categories: ExampleCategory[] = [ spectatorTarget: [0, 3, 0], ready: true, }, + { + slug: 'orbit-follow', + title: 'OrbitFollow', + group: 'orbit-follow', + Scene: OrbitFollow, + description: + 'Drag to move the camera around the shape, scroll or pinch to zoom. The orange circle and blue arc show where dragging takes the camera. Turn on `lockPointer` and left-click to orbit with the mouse alone.', + spectatorPosition: [12, 10, 14], + spectatorTarget: [0, 1.5, 0], + ready: true, + }, + { + slug: 'orbit-follow-binding-mode', + title: 'OrbitFollow: Binding Mode', + group: 'orbit-follow', + Scene: OrbitFollowBindingMode, + description: + '`bindingMode` decides whether the orbit turns with the plane: with `lockToTargetWithWorldUp` the camera stays behind it, with `worldSpace` it keeps its heading. With `damping` the camera lags behind the plane, but dragging around the orbit is never delayed.', + spectatorPosition: [0, 14, 18], + spectatorTarget: [0, 3, 0], + ready: true, + }, + { + slug: 'orbit-follow-three-ring', + title: 'OrbitFollow: Three Rings', + group: 'orbit-follow', + Scene: OrbitFollowThreeRing, + description: + 'With `orbitStyle: threeRing` the camera moves on a surface through three rings instead of a sphere. Change the rings and `splineCurvature`, and drag up and down to follow the blue curve.', + spectatorPosition: [14, 10, 14], + spectatorTarget: [0, 2, 0], + ready: true, + }, + { + slug: 'orbit-follow-recentering', + title: 'OrbitFollow: Recentering', + group: 'orbit-follow', + Scene: OrbitFollowRecentering, + description: + 'Drag and let go. After `wait` seconds the camera eases back: behind the plane with `recenteringTarget: trackingTarget`, or to the axis center with `axisCenter`.', + spectatorPosition: [0, 14, 18], + spectatorTarget: [0, 3, 0], + ready: true, + }, + { + slug: 'orbit-follow-damped-aim', + title: 'OrbitFollow: Damped Aim', + group: 'orbit-follow', + Scene: OrbitFollowDampedAim, + description: + "The camera lags behind the plane with `damping`, and a `RotationComposer` with `aimDamping` turns toward it slowly, so the plane drifts on screen. Dragging around the orbit still keeps it in place: turns made by the Body skip the Aim's damping.", + spectatorPosition: [0, 14, 18], + spectatorTarget: [0, 3, 0], + ready: true, + }, + { + slug: 'orbit-follow-group-framing', + title: 'OrbitFollow: Group Framing', + group: 'orbit-follow', + Scene: OrbitFollowGroupFraming, + description: + 'Orbit around a group of balls while `GroupFraming` moves the camera in and out along the view, so every ball stays in the frame from any side. With `fitMode: ceiling` it only ever moves out from the orbit, with `rigid` it also moves in.', + spectatorPosition: [0, 40, 50], + spectatorTarget: [0, 0, 0], + ready: true, + }, { slug: 'position-composer', title: 'PositionComposer', @@ -197,11 +272,41 @@ export const categories: ExampleCategory[] = [ title: 'Input from data', Scene: InputFromData, description: - 'One camera, three sources of input. Pick a `source` and only its settings show up. With the mouse you can record what you do, `scripted` lets code look around with `applyDelta`, and `replay` plays the recording back without any mouse.', + 'One camera, three sources of input. Pick a `source` and only its settings show up. With the mouse you can record what you do, `scripted` lets code orbit with `applyDelta`, and `replay` plays the recording back without any mouse.', spectatorPosition: [8, 5, 8], spectatorTarget: [0, 2, 0], ready: true, }, + { + slug: 'input-wheel-and-pinch', + title: 'Wheel and Pinch', + Scene: InputWheelAndPinch, + description: + 'Scroll or pinch to zoom. The wheel moves in pixels and needs its own `gain`, while a pinch on a trackpad or a touch screen zooms exactly as much as the fingers spread. The zoom stops at `closest` and `farthest`.', + spectatorPosition: [12, 10, 14], + spectatorTarget: [0, 1.5, 0], + ready: true, + }, + { + slug: 'input-touch-and-areas', + title: 'Touch and Areas', + Scene: InputTouchAndAreas, + description: + 'Input only starts inside the green `area`, so the rest of the page stays usable. Pinch to zoom and twist to turn the box: with `lockTouchAxis` a two-finger gesture does one or the other, never both, which is handy when twisting is handled by hand from `input`. Turn off `suppressContextMenu` to get the browser menu back on right-click.', + spectatorPosition: [12, 10, 14], + spectatorTarget: [0, 1.5, 0], + ready: true, + }, + { + slug: 'input-raw-input', + title: 'Raw Input', + Scene: InputRawInput, + description: + 'Everything the controller read this frame, as plain numbers in `input`. Use it for gestures no axis maps: here a right-drag spins the shape.', + spectatorPosition: [12, 10, 14], + spectatorTarget: [0, 1.5, 0], + ready: true, + }, ], }, { diff --git a/examples/src/scene/OrbitingGroup.tsx b/examples/src/scene/OrbitingGroup.tsx new file mode 100644 index 0000000..dd2d9d6 --- /dev/null +++ b/examples/src/scene/OrbitingGroup.tsx @@ -0,0 +1,43 @@ +import { useFrame } from '@react-three/fiber'; +import type { RefObject } from 'react'; +import type { Group } from 'three'; + +import { memberOrbits, memberRadius, type GroupMember } from './groupMembers'; + +/** Balls circling the origin at different radii and speeds, with `anchorRef` kept at their average position. */ +export function OrbitingGroup({ members, anchorRef }: { members: GroupMember[]; anchorRef: RefObject }) { + useFrame(({ clock }) => { + const t = clock.elapsedTime; + let sumX = 0; + let sumY = 0; + let sumZ = 0; + let resolved = 0; + + memberOrbits.forEach((orbit, i) => { + const mesh = members[i].target.current; + if (!mesh) return; + const angle = t * orbit.speed + orbit.phase; + mesh.position.set(Math.cos(angle) * orbit.radius, orbit.height, Math.sin(angle) * orbit.radius); + sumX += mesh.position.x; + sumY += mesh.position.y; + sumZ += mesh.position.z; + resolved++; + }); + + // plain mean, matching `positionMode: 'groupAverage'`, so Aim looks at the point GroupFraming frames + const anchor = anchorRef.current; + if (anchor && resolved > 0) anchor.position.set(sumX / resolved, sumY / resolved, sumZ / resolved); + }); + + return ( + <> + {memberOrbits.map((orbit, i) => ( + + + + + ))} + + + ); +} diff --git a/examples/src/scene/clutterLayouts.ts b/examples/src/scene/clutterLayouts.ts index dee886c..1a60375 100644 --- a/examples/src/scene/clutterLayouts.ts +++ b/examples/src/scene/clutterLayouts.ts @@ -132,6 +132,23 @@ export const clutterLayouts = { { x: 3.5, z: -9, width: 1.2, height: 1.6, depth: 1.2 }, { x: 4.5, z: -15, width: 1.4, height: 1.8, depth: 1.4, color: '#c7c7cf' }, ], + // Only between and beyond the orbits of OrbitingGroup, which pass at radii 4, 6.5, 9 and 18. + groupFraming: [ + { x: 12.9, z: 4, width: 1.4, height: 0.3, depth: 1.4 }, + { x: 6.3, z: 11.9, width: 1.2, height: 0.2, depth: 1.2, color: '#9a9aa8' }, + { x: -4, z: 12.9, width: 1.6, height: 0.4, depth: 1.6, color: '#c7c7cf' }, + { x: -11.9, z: 6.3, width: 1.3, height: 0.25, depth: 1.3 }, + { x: -12.9, z: -4, width: 1.5, height: 0.35, depth: 1.5, color: '#9a9aa8' }, + { x: -6.3, z: -11.9, width: 1.2, height: 0.2, depth: 1.2 }, + { x: 4, z: -12.9, width: 1.6, height: 0.3, depth: 1.6, color: '#c7c7cf' }, + { x: 11.9, z: -6.3, width: 1.3, height: 0.45, depth: 1.3 }, + { x: 16, z: 16.5, width: 2, height: 0.5, depth: 2, color: '#9a9aa8' }, + { x: -6.3, z: 22.1, width: 1.8, height: 0.35, depth: 1.8 }, + { x: -22.3, z: 5.6, width: 2.2, height: 0.6, depth: 2.2, color: '#c7c7cf' }, + { x: -16, z: -16.5, width: 1.8, height: 0.4, depth: 1.8 }, + { x: 6.3, z: -22.1, width: 2, height: 0.3, depth: 2, color: '#9a9aa8' }, + { x: 22.3, z: -5.6, width: 1.9, height: 0.5, depth: 1.9 }, + ], } satisfies Record; export type ClutterLayout = keyof typeof clutterLayouts; diff --git a/examples/src/scene/groupMembers.ts b/examples/src/scene/groupMembers.ts new file mode 100644 index 0000000..2e48efb --- /dev/null +++ b/examples/src/scene/groupMembers.ts @@ -0,0 +1,17 @@ +import { createRef, type RefObject } from 'react'; +import type { Mesh } from 'three'; + +export const memberRadius = 1; + +export const memberOrbits = [ + { radius: 4, speed: 0.3, phase: 0, height: 0, color: '#21a9e0' }, + { radius: 9, speed: 0.45, phase: 1.3, height: 1.2, color: '#ff6b4a' }, + { radius: 6.5, speed: -0.35, phase: 2.6, height: -0.8, color: '#7ed957' }, + { radius: 18, speed: 0.22, phase: 4.2, height: 0.6, color: '#ffd23f' }, +] as const; + +export type GroupMember = { target: RefObject; radius: number }; + +/** One member per orbit of `OrbitingGroup`. */ +export const createGroupMembers = (): GroupMember[] => + memberOrbits.map(() => ({ target: createRef(), radius: memberRadius })); diff --git a/examples/src/scenes/body/Follow.tsx b/examples/src/scenes/body/Follow.tsx index 1c70685..71b4d8d 100644 --- a/examples/src/scenes/body/Follow.tsx +++ b/examples/src/scenes/body/Follow.tsx @@ -11,9 +11,10 @@ import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; export function Follow() { const planeRef = useRef(null); - const { offset, damping, bindingMode } = useControls('Follow', { + const { offset, damping, rotationDamping, bindingMode } = useControls('Follow', { offset: { x: 0, y: 0.5, z: 5 }, damping: { value: 0, min: 0, max: 2, step: 0.05 }, + rotationDamping: { value: 0, min: 0, max: 2, step: 0.05 }, bindingMode: { value: BindingModes.lockToTarget as BindingMode, options: Object.values(BindingModes) }, }); @@ -28,6 +29,7 @@ export function Follow() { target={planeRef} offset={[offset.x, offset.y, offset.z]} damping={damping} + rotationDamping={rotationDamping} bindingMode={bindingMode} /> diff --git a/examples/src/scenes/body/OrbitFollow.tsx b/examples/src/scenes/body/OrbitFollow.tsx new file mode 100644 index 0000000..12e06aa --- /dev/null +++ b/examples/src/scenes/body/OrbitFollow.tsx @@ -0,0 +1,76 @@ +import type { InputControllerDom } from '@kvvasuu/klipp/dom'; +import { Aim, Body, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import type { OrbitFollowBodyThree } from '@kvvasuu/klipp/three'; +import { useFrame } from '@react-three/fiber'; +import { useControls } from 'leva'; +import { useRef } from 'react'; +import type { Mesh } from 'three'; + +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { Crosshair } from '../../scene/Crosshair'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; +import { SpinningSubject } from '../../scene/SpinningSubject'; +import { usePointerLock } from '../../scene/usePointerLock'; + +import { OrbitInput, orbitHint } from './OrbitInput'; + +export function OrbitFollow() { + const subjectRef = useRef(null); + const bodyRef = useRef(null); + const controllerRef = useRef(null); + const valuesRef = useRef(null); + + const { radius, axisDamping, zoomDamping, autoNormalize, debug, lockPointer } = useControls('OrbitFollow', { + radius: { value: 6, min: 1, max: 20, step: 0.5 }, + axisDamping: { value: 0.1, min: 0, max: 1, step: 0.05 }, + zoomDamping: { value: 0.15, min: 0, max: 1, step: 0.05 }, + autoNormalize: true, + debug: true, + lockPointer: false, + }); + + const locked = usePointerLock(controllerRef, lockPointer); + + useFrame(() => { + const body = bodyRef.current; + if (!valuesRef.current || !body) return; + const { horizontal, vertical, radial } = body; + valuesRef.current.textContent = + `horizontal: ${horizontal.value.toFixed(1)}° vertical: ${vertical.value.toFixed(1)}° ` + + `zoom: ${Math.exp(radial.value).toFixed(2)}`; + }); + + return ( + <> + + + + + + + + + + + + + + + {locked && } +
+ {lockPointer ? 'left-click: lock cursor\nmove: orbit\nwheel: zoom' : orbitHint} +
+
+ + + ); +} diff --git a/examples/src/scenes/body/OrbitFollowBindingMode.tsx b/examples/src/scenes/body/OrbitFollowBindingMode.tsx new file mode 100644 index 0000000..f15a8ff --- /dev/null +++ b/examples/src/scenes/body/OrbitFollowBindingMode.tsx @@ -0,0 +1,53 @@ +import { BindingModes, type BindingMode } from '@kvvasuu/klipp'; +import { Aim, Body, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import { useControls } from 'leva'; +import { useRef } from 'react'; +import type { Group } from 'three'; + +import { Airplane } from '../../scene/Airplane'; +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; + +import { OrbitInput, orbitHint } from './OrbitInput'; + +export function OrbitFollowBindingMode() { + const planeRef = useRef(null); + + const { bindingMode, damping, rotationDamping, debug } = useControls('OrbitFollow: Binding Mode', { + bindingMode: { value: BindingModes.lockToTargetWithWorldUp as BindingMode, options: Object.values(BindingModes) }, + damping: { value: 0.3, min: 0, max: 2, step: 0.05 }, + rotationDamping: { value: 0, min: 0, max: 2, step: 0.05 }, + debug: true, + }); + + return ( + <> + + + + + + + + + + + + + + +
{orbitHint}
+
+ + ); +} diff --git a/examples/src/scenes/body/OrbitFollowDampedAim.tsx b/examples/src/scenes/body/OrbitFollowDampedAim.tsx new file mode 100644 index 0000000..5345089 --- /dev/null +++ b/examples/src/scenes/body/OrbitFollowDampedAim.tsx @@ -0,0 +1,50 @@ +import { BindingModes } from '@kvvasuu/klipp'; +import { Aim, Body, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import { useControls } from 'leva'; +import { useRef } from 'react'; +import type { Group } from 'three'; + +import { Airplane } from '../../scene/Airplane'; +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; + +import { OrbitInput, orbitHint } from './OrbitInput'; + +export function OrbitFollowDampedAim() { + const planeRef = useRef(null); + + const { damping, aimDamping, debug } = useControls('OrbitFollow: Damped Aim', { + damping: { value: 1, min: 0, max: 2, step: 0.05 }, + aimDamping: { value: 0.5, min: 0, max: 2, step: 0.05 }, + debug: true, + }); + + return ( + <> + + + + + + + + + + + + + + +
{orbitHint}
+
+ + ); +} diff --git a/examples/src/scenes/body/OrbitFollowGroupFraming.tsx b/examples/src/scenes/body/OrbitFollowGroupFraming.tsx new file mode 100644 index 0000000..8cc13c7 --- /dev/null +++ b/examples/src/scenes/body/OrbitFollowGroupFraming.tsx @@ -0,0 +1,62 @@ +import { Aim, Body, Extension, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import type { GroupFramingFitMode } from '@kvvasuu/klipp/three'; +import { useControls } from 'leva'; +import { useRef, useState } from 'react'; +import type { Group } from 'three'; + +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { createGroupMembers } from '../../scene/groupMembers'; +import { OrbitingGroup } from '../../scene/OrbitingGroup'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; + +import { OrbitInput, orbitHint } from './OrbitInput'; + +export function OrbitFollowGroupFraming() { + const [members] = useState(createGroupMembers); + const anchorRef = useRef(null); + + const { fitMode, padding, framingDamping, debug } = useControls('OrbitFollow: Group Framing', { + fitMode: { value: 'rigid' as GroupFramingFitMode, options: ['ceiling', 'rigid'] as GroupFramingFitMode[] }, + padding: { value: 1.5, min: 0, max: 10, step: 0.1 }, + framingDamping: { value: 0.1, min: 0, max: 3, step: 0.05 }, + debug: true, + }); + + return ( + <> + + + + + + + + + + + + + + + + + +
{orbitHint}
+
+ + ); +} diff --git a/examples/src/scenes/body/OrbitFollowRecentering.tsx b/examples/src/scenes/body/OrbitFollowRecentering.tsx new file mode 100644 index 0000000..bb1d3dd --- /dev/null +++ b/examples/src/scenes/body/OrbitFollowRecentering.tsx @@ -0,0 +1,54 @@ +import type { RecenteringTarget } from '@kvvasuu/klipp'; +import { Aim, Body, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import { useControls } from 'leva'; +import { useRef } from 'react'; +import type { Group } from 'three'; + +import { Airplane } from '../../scene/Airplane'; +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; + +import { OrbitInput, orbitHint } from './OrbitInput'; + +export function OrbitFollowRecentering() { + const planeRef = useRef(null); + + const { recenteringTarget, wait, time } = useControls('OrbitFollow: Recentering', { + recenteringTarget: { + value: 'trackingTarget' as RecenteringTarget, + options: ['trackingTarget', 'axisCenter'] as RecenteringTarget[], + }, + wait: { value: 0.3, min: 0, max: 5, step: 0.1 }, + time: { value: 0.3, min: 0.1, max: 3, step: 0.1 }, + }); + const recentering = { enabled: true, wait, time }; + + return ( + <> + + + + + + + + + + + + + + +
{`${orbitHint}\nlet go and wait: the camera eases back`}
+
+ + ); +} diff --git a/examples/src/scenes/body/OrbitFollowThreeRing.tsx b/examples/src/scenes/body/OrbitFollowThreeRing.tsx new file mode 100644 index 0000000..460f192 --- /dev/null +++ b/examples/src/scenes/body/OrbitFollowThreeRing.tsx @@ -0,0 +1,61 @@ +import { Aim, Body, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import { useControls } from 'leva'; +import { useRef } from 'react'; +import type { Mesh } from 'three'; + +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; +import { SpinningSubject } from '../../scene/SpinningSubject'; + +import { OrbitInput, orbitHint } from './OrbitInput'; + +const height = (value: number) => ({ value, min: -5, max: 10, step: 0.25 }); +const radius = (value: number) => ({ value, min: 0.5, max: 12, step: 0.25 }); + +export function OrbitFollowThreeRing() { + const subjectRef = useRef(null); + + const settings = useControls('OrbitFollow: Three Rings', { + topHeight: height(6), + topRadius: radius(3), + centerHeight: height(2), + centerRadius: radius(7), + bottomHeight: height(0), + bottomRadius: radius(4), + splineCurvature: { value: 0.5, min: 0, max: 1, step: 0.05 }, + }); + + return ( + <> + + + + + + + + + + + + + + +
{orbitHint}
+
+ + ); +} diff --git a/examples/src/scenes/body/OrbitInput.tsx b/examples/src/scenes/body/OrbitInput.tsx new file mode 100644 index 0000000..015ac01 --- /dev/null +++ b/examples/src/scenes/body/OrbitInput.tsx @@ -0,0 +1,20 @@ +import type { InputControllerDom } from '@kvvasuu/klipp/dom'; +import { InputController } from '@kvvasuu/klipp/react'; +import type { Ref } from 'react'; + +const orbitSource = { axes: { x: 'horizontal', y: 'vertical' }, gain: 0.3 }; + +/** Drag to orbit, scroll or pinch to zoom: the input every OrbitFollow scene shares. */ +export function OrbitInput({ ref }: { ref?: Ref }) { + return ( + + ); +} + +export const orbitHint = 'drag: orbit\nwheel or pinch: zoom'; diff --git a/examples/src/scenes/extension/GroupFraming.tsx b/examples/src/scenes/extension/GroupFraming.tsx index e352be5..a016940 100644 --- a/examples/src/scenes/extension/GroupFraming.tsx +++ b/examples/src/scenes/extension/GroupFraming.tsx @@ -1,64 +1,15 @@ import { Aim, Body, Extension, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; import type { GroupFramingFitMode, GroupFramingMode } from '@kvvasuu/klipp/three'; -import { useFrame } from '@react-three/fiber'; import { useControls } from 'leva'; -import { createRef, useRef, useState, type RefObject } from 'react'; -import { Group, Mesh } from 'three'; +import { useRef, useState } from 'react'; +import type { Group } from 'three'; +import { createGroupMembers } from '../../scene/groupMembers'; +import { OrbitingGroup } from '../../scene/OrbitingGroup'; import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; -const memberRadius = 1; - -const memberOrbits = [ - { radius: 4, speed: 0.3, phase: 0, height: 0, color: '#21a9e0' }, - { radius: 9, speed: 0.45, phase: 1.3, height: 1.2, color: '#ff6b4a' }, - { radius: 6.5, speed: -0.35, phase: 2.6, height: -0.8, color: '#7ed957' }, - { radius: 18, speed: 0.22, phase: 4.2, height: 0.6, color: '#ffd23f' }, -] as const; - -type Member = { target: RefObject; radius: number }; - -function OrbitingGroup({ members, anchorRef }: { members: Member[]; anchorRef: RefObject }) { - useFrame(({ clock }) => { - const t = clock.elapsedTime; - let sumX = 0; - let sumY = 0; - let sumZ = 0; - let resolved = 0; - - memberOrbits.forEach((orbit, i) => { - const mesh = members[i].target.current; - if (!mesh) return; - const angle = t * orbit.speed + orbit.phase; - mesh.position.set(Math.cos(angle) * orbit.radius, orbit.height, Math.sin(angle) * orbit.radius); - sumX += mesh.position.x; - sumY += mesh.position.y; - sumZ += mesh.position.z; - resolved++; - }); - - // plain mean, matching `positionMode: 'groupAverage'`, so Aim looks at the point GroupFraming frames - const anchor = anchorRef.current; - if (anchor && resolved > 0) anchor.position.set(sumX / resolved, sumY / resolved, sumZ / resolved); - }); - - return ( - <> - {memberOrbits.map((orbit, i) => ( - - - - - ))} - - - ); -} - export function GroupFraming() { - const [members] = useState(() => - memberOrbits.map(() => ({ target: createRef(), radius: memberRadius })), - ); + const [members] = useState(createGroupMembers); const anchorRef = useRef(null); const { padding, damping, screenPositionX, screenPositionY, fitMode, minDistance, maxDistance, framingMode, debug } = diff --git a/examples/src/scenes/input/InputFromData.tsx b/examples/src/scenes/input/InputFromData.tsx index e153323..10edde8 100644 --- a/examples/src/scenes/input/InputFromData.tsx +++ b/examples/src/scenes/input/InputFromData.tsx @@ -1,16 +1,18 @@ import { InputController as InputReplay, type ConsumedInput, type InputControllerConfig } from '@kvvasuu/klipp'; import type { InputControllerDom } from '@kvvasuu/klipp/dom'; -import { Aim, InputController, Klipp, VirtualCamera, useKlipp } from '@kvvasuu/klipp/react'; -import type { PanTiltAimThree } from '@kvvasuu/klipp/three'; +import { Aim, Body, InputController, Klipp, VirtualCamera, useKlipp } from '@kvvasuu/klipp/react'; +import type { OrbitFollowBodyThree } from '@kvvasuu/klipp/three'; import { useFrame } from '@react-three/fiber'; import { button, folder, useControls } from 'leva'; import { useEffect, useRef, useState, type RefObject } from 'react'; +import type { Mesh } from 'three'; import { CanvasOverlay } from '../../scene/CanvasOverlay'; import { GroundClutter } from '../../scene/GroundClutter'; import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; +import { SpinningSubject } from '../../scene/SpinningSubject'; -const lookSource = { axes: { x: 'pan', y: 'tilt' }, gain: 0.15 }; +const orbitSource = { axes: { x: 'horizontal', y: 'vertical' }, gain: 0.3 }; type Source = 'mouse' | 'scripted' | 'replay'; @@ -27,18 +29,18 @@ type Recording = { frames: ConsumedInput[]; config: InputControllerConfig | null function DataDriver({ source, recording, - panSpeed, - tiltSpeed, + horizontalSpeed, + verticalSpeed, loop, - aim, + body, controller, }: { source: Source; recording: boolean; - panSpeed: number; - tiltSpeed: number; + horizontalSpeed: number; + verticalSpeed: number; loop: boolean; - aim: RefObject; + body: RefObject; controller: RefObject; }) { const klipp = useKlipp(); @@ -69,8 +71,8 @@ function DataDriver({ let time = 0; return klipp.registerUpdate((dt) => { time += dt; - aim.current?.pan.applyDelta(Math.cos(time * 0.6) * panSpeed * dt); - aim.current?.tilt.applyDelta(Math.cos(time * 1.3) * tiltSpeed * dt); + body.current?.horizontal.applyDelta(Math.cos(time * 0.6) * horizontalSpeed * dt); + body.current?.vertical.applyDelta(Math.cos(time * 1.3) * verticalSpeed * dt); return true; }); } @@ -97,12 +99,14 @@ function DataDriver({ stop(); release(); }; - }, [klipp, source, recording, panSpeed, tiltSpeed, loop, aim, controller]); + }, [klipp, source, recording, horizontalSpeed, verticalSpeed, loop, body, controller]); useFrame(() => { - if (!liveRef.current || !aim.current) return; - const { pan, tilt } = aim.current; - const angles = `pan ${pan.value.toFixed(1)}° tilt ${tilt.value.toFixed(1)}°`; + if (!liveRef.current || !body.current) return; + const { horizontal, vertical, radial } = body.current; + const angles = + `horizontal ${horizontal.value.toFixed(1)}° vertical ${vertical.value.toFixed(1)}° ` + + `zoom ${Math.exp(radial.value).toFixed(2)}`; const frames = tape.current.frames.length; const progress = source === 'replay' @@ -120,10 +124,10 @@ function DataDriver({ const hint = source === 'mouse' ? recording - ? 'drag to look around, every frame is being recorded' - : 'drag to look around, turn on recording to capture it' + ? 'drag to orbit and scroll to zoom, every frame is being recorded' + : 'drag to orbit and scroll to zoom, turn on recording to capture it' : source === 'scripted' - ? 'code looks around on its own' + ? 'code orbits on its own' : recordedFrames > 0 ? 'replaying the recording, no mouse involved' : 'record something with the mouse first'; @@ -139,51 +143,67 @@ function DataDriver({ } export function InputFromData() { - const aimRef = useRef(null); + const subjectRef = useRef(null); + const bodyRef = useRef(null); const controllerRef = useRef(null); - const [faceForward, setFaceForward] = useState(0); + const [resets, setResets] = useState(0); const controls = useControls('Input from data', { source: { value: 'mouse', options: sourceOptions }, Mouse: folder({ recording: false }, { render: shownFor('mouse') }), Scripted: folder( { - panSpeed: { value: 40, min: 0, max: 120, step: 5, label: 'pan °/s' }, - tiltSpeed: { value: 10, min: 0, max: 60, step: 5, label: 'tilt °/s' }, + horizontalSpeed: { value: 40, min: 0, max: 120, step: 5, label: 'horizontal °/s' }, + verticalSpeed: { value: 20, min: 0, max: 60, step: 5, label: 'vertical °/s' }, }, { render: shownFor('scripted') }, ), Replay: folder({ loop: true }, { render: shownFor('replay') }), }); - useControls('Camera', { 'face forward': button(() => setFaceForward((count) => count + 1)) }); + useControls('Camera', { 'reset view': button(() => setResets((count) => count + 1)) }); const source = controls.source as Source; useEffect(() => { - if (faceForward === 0) return; - aimRef.current?.pan.setValue(0); - aimRef.current?.tilt.setValue(0); - }, [faceForward]); + if (resets === 0) return; + bodyRef.current?.horizontal.setValue(0); + bodyRef.current?.vertical.setValue(20); + bodyRef.current?.radial.setValue(0); + }, [resets]); return ( <> - + + - - + + {source === 'mouse' && ( - + )} - + + diff --git a/examples/src/scenes/input/InputRawInput.tsx b/examples/src/scenes/input/InputRawInput.tsx new file mode 100644 index 0000000..2fabef5 --- /dev/null +++ b/examples/src/scenes/input/InputRawInput.tsx @@ -0,0 +1,93 @@ +import type { ConsumedInput } from '@kvvasuu/klipp'; +import type { InputControllerDom } from '@kvvasuu/klipp/dom'; +import { Aim, Body, InputController, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import { useFrame } from '@react-three/fiber'; +import { useRef } from 'react'; +import type { Mesh } from 'three'; + +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; +import { SpinningSubject } from '../../scene/SpinningSubject'; + +const orbitSource = { axes: { x: 'horizontal', y: 'vertical' }, gain: 0.3 }; +const spinPerPixel = 0.01; + +const pairs: [string, keyof ConsumedInput, keyof ConsumedInput][] = [ + ['left', 'leftDx', 'leftDy'], + ['middle', 'middleDx', 'middleDy'], + ['right', 'rightDx', 'rightDy'], + ['one finger', 'touchOneDx', 'touchOneDy'], + ['two fingers', 'touchTwoDx', 'touchTwoDy'], + ['three fingers', 'touchThreeDx', 'touchThreeDy'], + ['wheel', 'wheelDeltaX', 'wheelDeltaY'], + ['locked', 'lockedDx', 'lockedDy'], +]; +const held: [string, keyof ConsumedInput][] = [ + ['left', 'leftHeld'], + ['middle', 'middleHeld'], + ['right', 'rightHeld'], + ['1 finger', 'touchOneHeld'], + ['2', 'touchTwoHeld'], + ['3', 'touchThreeHeld'], +]; + +const format = (value: number) => (value === 0 ? '·' : value.toFixed(2)); + +export function InputRawInput() { + const subjectRef = useRef(null); + const controllerRef = useRef(null); + const hudRef = useRef(null); + + useFrame(() => { + const input = controllerRef.current?.input; + if (!input) return; + + // Right-drag is not mapped to any axis, so the scene spins the shape with it by hand. + if (subjectRef.current) subjectRef.current.rotation.z += input.rightDx * spinPerPixel; + + if (!hudRef.current) return; + const lines = pairs.map( + ([name, x, y]) => + `${name.padEnd(14)}${format(input[x] as number).padStart(9)}${format(input[y] as number).padStart(9)}`, + ); + lines.push(`pinch ${format(input.pinchDelta)} twist ${format(input.touchRotateDelta)}`); + lines.push( + `held: ${ + held + .filter(([, key]) => input[key]) + .map(([name]) => name) + .join(', ') || '-' + }`, + ); + hudRef.current.textContent = lines.join('\n'); + }); + + return ( + <> + + + + + + + + + + + + + + +
+      
+    
+  );
+}
diff --git a/examples/src/scenes/input/InputTouchAndAreas.tsx b/examples/src/scenes/input/InputTouchAndAreas.tsx
new file mode 100644
index 0000000..c751c60
--- /dev/null
+++ b/examples/src/scenes/input/InputTouchAndAreas.tsx
@@ -0,0 +1,85 @@
+import type { InputControllerDom, InteractiveArea } from '@kvvasuu/klipp/dom';
+import { Aim, Body, InputController, Klipp, VirtualCamera } from '@kvvasuu/klipp/react';
+import { useFrame } from '@react-three/fiber';
+import { useControls } from 'leva';
+import { useRef } from 'react';
+import type { Mesh } from 'three';
+
+import { CanvasOverlay } from '../../scene/CanvasOverlay';
+import { GroundClutter } from '../../scene/GroundClutter';
+import { SpectatorFrustum } from '../../scene/SpectatorFrustum';
+
+const orbitSource = { axes: { x: 'horizontal', y: 'vertical' }, gain: 0.3 };
+
+const areas: Record = {
+  'whole canvas': null,
+  'right half': { x: 0.5, y: 0, width: 0.5, height: 1 },
+  'bottom half': { x: 0, y: 0.5, width: 1, height: 0.5 },
+};
+
+export function InputTouchAndAreas() {
+  const subjectRef = useRef(null);
+  const controllerRef = useRef(null);
+
+  const { area, lockTouchAxis, suppressContextMenu } = useControls('Touch and Areas', {
+    area: { value: 'right half', options: Object.keys(areas) },
+    lockTouchAxis: true,
+    suppressContextMenu: true,
+  });
+  const interactiveArea = areas[area];
+
+  useFrame(() => {
+    const input = controllerRef.current?.input;
+    if (input && subjectRef.current) subjectRef.current.rotation.y -= input.touchRotateDelta;
+  });
+
+  return (
+    <>
+      
+      
+        
+        
+      
+
+      
+        
+          
+            
+          
+          
+          
+        
+      
+
+      
+        {interactiveArea && (
+          
+ )} +
+ {'one finger or a mouse button: orbit\ntwo fingers: pinch to zoom, twist to turn the box'} +
+ + + ); +} diff --git a/examples/src/scenes/input/InputWheelAndPinch.tsx b/examples/src/scenes/input/InputWheelAndPinch.tsx new file mode 100644 index 0000000..dd8476b --- /dev/null +++ b/examples/src/scenes/input/InputWheelAndPinch.tsx @@ -0,0 +1,94 @@ +import type { InputControllerDom } from '@kvvasuu/klipp/dom'; +import { Aim, Body, InputController, Klipp, VirtualCamera } from '@kvvasuu/klipp/react'; +import type { OrbitFollowBodyThree } from '@kvvasuu/klipp/three'; +import { useFrame, useThree } from '@react-three/fiber'; +import { useControls } from 'leva'; +import { useEffect, useRef } from 'react'; +import type { Mesh } from 'three'; + +import { CanvasOverlay } from '../../scene/CanvasOverlay'; +import { GroundClutter } from '../../scene/GroundClutter'; +import { SpectatorFrustum } from '../../scene/SpectatorFrustum'; +import { SpinningSubject } from '../../scene/SpinningSubject'; + +const orbitSource = { axes: { x: 'horizontal', y: 'vertical' }, gain: 0.3 }; +const deltaModes = ['pixels', 'lines', 'pages']; + +export function InputWheelAndPinch() { + const subjectRef = useRef(null); + const bodyRef = useRef(null); + const controllerRef = useRef(null); + const valuesRef = useRef(null); + const lastWheel = useRef('-'); + const domElement = useThree((state) => state.gl.domElement); + + const settings = useControls('Wheel and Pinch', { + wheelGain: { value: 0.001, min: 0.0001, max: 0.005, step: 0.0001 }, + wheelInvert: true, + pixelsPerLine: { value: 33, min: 1, max: 120, step: 1 }, + pinchGain: { value: 1, min: 0.1, max: 3, step: 0.1 }, + pinchInvert: true, + zoomDamping: { value: 0.15, min: 0, max: 1, step: 0.05 }, + closest: { value: 0.5, min: 0.1, max: 1, step: 0.05, label: 'closest zoom' }, + farthest: { value: 2, min: 1, max: 5, step: 0.1, label: 'farthest zoom' }, + }); + + useEffect(() => { + const wheel = controllerRef.current?.inputSystem.wheel; + if (wheel) wheel.pixelsPerLine = settings.pixelsPerLine; + }); + + useEffect(() => { + const onWheel = (event: WheelEvent) => { + const pinch = event.ctrlKey ? ', ctrl: a trackpad pinch' : ''; + lastWheel.current = `${event.deltaY.toFixed(1)} ${deltaModes[event.deltaMode]}${pinch}`; + }; + domElement.addEventListener('wheel', onWheel); + return () => domElement.removeEventListener('wheel', onWheel); + }, [domElement]); + + useFrame(() => { + const body = bodyRef.current; + if (!valuesRef.current || !body) return; + valuesRef.current.textContent = `zoom ${Math.exp(body.radial.value).toFixed(2)} · last wheel ${lastWheel.current}`; + }); + + return ( + <> + + + + + + + + + + + + + + +
+ {'scroll, pinch on a trackpad or with two fingers: zoom'} +
+
+ + + ); +} diff --git a/src/core/CameraState.ts b/src/core/CameraState.ts index ff034c7..d478bdf 100644 --- a/src/core/CameraState.ts +++ b/src/core/CameraState.ts @@ -17,6 +17,8 @@ export type CameraState = { hasLookAtTarget: boolean; /** Up direction used by look-at rotation. */ referenceUp: Vec3; + /** World rotation the Body turned the camera by this frame, which damped Aims follow without damping. */ + rotationDampingBypass: Quat; }; /** Create a camera state. */ @@ -33,6 +35,7 @@ export function create(): CameraState { lookAtTarget: [0, 0, 0], hasLookAtTarget: false, referenceUp: [0, 1, 0], + rotationDampingBypass: [0, 0, 0, 1], }; } @@ -50,6 +53,7 @@ export function copy(out: CameraState, source: CameraState): CameraState { vec3.copy(out.lookAtTarget, source.lookAtTarget); out.hasLookAtTarget = source.hasLookAtTarget; vec3.copy(out.referenceUp, source.referenceUp); + vec4.copy(out.rotationDampingBypass, source.rotationDampingBypass); return out; } @@ -69,6 +73,7 @@ export function merge(out: CameraState, partial: Partial): CameraSt if (partial.lookAtTarget) vec3.copy(out.lookAtTarget, partial.lookAtTarget); if (partial.hasLookAtTarget !== undefined) out.hasLookAtTarget = partial.hasLookAtTarget; if (partial.referenceUp) vec3.copy(out.referenceUp, partial.referenceUp); + if (partial.rotationDampingBypass) vec4.copy(out.rotationDampingBypass, partial.rotationDampingBypass); return out; } diff --git a/src/core/VirtualCamera.ts b/src/core/VirtualCamera.ts index b450550..e40050d 100644 --- a/src/core/VirtualCamera.ts +++ b/src/core/VirtualCamera.ts @@ -1,4 +1,4 @@ -import type { Quat, Vec3 } from 'math'; +import { quat, type Quat, type Vec3 } from 'math'; import * as cameraState from './CameraState'; import type { CameraState } from './CameraState'; @@ -342,6 +342,7 @@ export class VirtualCamera extends EventDispatcher imp update = (out: CameraState, dt: number, justActivated: boolean): boolean => { // Keep `=== true` semantics: some pieces return a real boolean even when typed as void. let stillInFlight = false; + quat.identity(out.rotationDampingBypass); if (this._body?.update(out, dt, justActivated) === true) stillInFlight = true; if (this._aim?.update(out, dt, justActivated) === true) stillInFlight = true; for (const extension of this.extensions) { diff --git a/src/core/aim/hardLookAt.ts b/src/core/aim/hardLookAt.ts index 5da7cd3..cb60a14 100644 --- a/src/core/aim/hardLookAt.ts +++ b/src/core/aim/hardLookAt.ts @@ -1,13 +1,12 @@ -import { mat4, quat, vec3, type Mat4, type Vec3 } from 'math'; +import { vec3, type Vec3 } from 'math'; import type { CameraState } from '../CameraState'; -const scratchLookMatrix: Mat4 = mat4.create(); +import { lookRotation } from './lookRotation'; /** Rotates `out` so `targetPosition` is dead-center. */ export function update(out: CameraState, targetPosition: Vec3): void { - mat4.targetTo(scratchLookMatrix, out.position, targetPosition, out.referenceUp); - quat.fromMat4(out.quaternion, scratchLookMatrix); + lookRotation(out.quaternion, out.position, targetPosition, out.referenceUp, out.quaternion); vec3.copy(out.lookAtTarget, targetPosition); out.hasLookAtTarget = true; } diff --git a/src/core/aim/lookRotation.ts b/src/core/aim/lookRotation.ts new file mode 100644 index 0000000..db4bd1a --- /dev/null +++ b/src/core/aim/lookRotation.ts @@ -0,0 +1,27 @@ +import { mat4, quat, vec3, type Mat4, type Quat, type Vec3 } from 'math'; + +const yAxis: Vec3 = [0, 1, 0]; +const forwardAxis: Vec3 = [0, 0, -1]; +const scratchDirection: Vec3 = [0, 0, 0]; +const scratchCross: Vec3 = [0, 0, 0]; +const scratchUp: Vec3 = [0, 0, 0]; +const scratchLookMatrix: Mat4 = mat4.create(); + +const isParallel = (direction: Vec3, up: Vec3): boolean => + vec3.squaredLength(vec3.cross(scratchCross, direction, up)) < 1e-12 * vec3.squaredLength(direction); + +/** + * The rotation looking from `position` at `target` with `up` on top. Looking along `up`, the screen's top comes + * from `previous`, so passing over the pole keeps the view steady. + */ +export function lookRotation(out: Quat, position: Vec3, target: Vec3, up: Vec3, previous: Quat): Quat { + vec3.subtract(scratchDirection, target, position); + let screenUp = up; + if (isParallel(scratchDirection, up)) { + vec3.transformQuat(scratchUp, yAxis, previous); + if (isParallel(scratchDirection, scratchUp)) vec3.transformQuat(scratchUp, forwardAxis, previous); + screenUp = scratchUp; + } + mat4.targetTo(scratchLookMatrix, position, target, screenUp); + return quat.fromMat4(out, scratchLookMatrix); +} diff --git a/src/core/aim/rotationComposer.ts b/src/core/aim/rotationComposer.ts index 0b1b941..74a32f3 100644 --- a/src/core/aim/rotationComposer.ts +++ b/src/core/aim/rotationComposer.ts @@ -1,4 +1,4 @@ -import { clamp, degreesToRadians, mat4, quat, vec3, vec4, type Mat4, type Quat, type Vec3 } from 'math'; +import { clamp, degreesToRadians, quat, vec3, vec4, type Quat, type Vec3 } from 'math'; import * as targetExtent from '../TargetExtent'; import type { CameraState } from '../CameraState'; @@ -10,6 +10,8 @@ import * as predictor from '../damping/predictor'; import type { DamperState, DampingConstant } from '../damping/damping'; import type { PredictorState } from '../damping/predictor'; +import { lookRotation } from './lookRotation'; + export type RotationComposerParams = { /** Where the target should land on screen: `[x, y]`, `0` = center, `±1` = edge. */ screenPosition: [number, number]; @@ -106,7 +108,6 @@ const scratchDesiredDir: Vec3 = [0, 0, 0]; const scratchDelta: Quat = [0, 0, 0, 1]; const scratchRight: Vec3 = [0, 0, 0]; const scratchUp: Vec3 = [0, 0, 0]; -const scratchLookMatrix: Mat4 = mat4.create(); const scratchExtents: [number, number] = [0, 0]; /** `[x, y, depth]` of a world point in the camera's screen space. `depth <= 0` means behind the camera. */ const scratchScreenPoint: [number, number, number] = [0, 0, 0]; @@ -127,21 +128,16 @@ function computeScreenPoint( return scratchScreenPoint; } -function lookAtRotation(out: Quat, position: Vec3, target: Vec3, up: Vec3): Quat { - mat4.targetTo(scratchLookMatrix, position, target, up); - return quat.fromMat4(out, scratchLookMatrix); -} - -/** Turns `lookRotation`, which looks at the target, to place it at screen point `(desiredX, desiredY)` instead. */ +/** Turns `lookAt`, which looks at the target, to place it at screen point `(desiredX, desiredY)` instead. */ function composeRotationForScreenPoint( out: Quat, - lookRotation: Quat, + lookAt: Quat, desiredX: number, desiredY: number, tanHalfFovH: number, tanHalfFovV: number, ): void { - quat.copy(out, lookRotation); + quat.copy(out, lookAt); if (desiredX === 0 && desiredY === 0) return; vec3.normalize(scratchDesiredDir, vec3.set(scratchDesiredDir, desiredX * tanHalfFovH, desiredY * tanHalfFovV, -1)); @@ -189,14 +185,25 @@ export function update( else quat.identity(scratchTargetRotation); vec3.add(target, target, vec3.transformQuat(scratchOffset, params.targetOffset, scratchTargetRotation)); - const { position, referenceUp, quaternion: rotation } = out; + const { position, referenceUp, quaternion: rotation, rotationDampingBypass: bypass } = out; + if (!activating && bypass[3] !== 1) { + quat.normalize(rotation, quat.multiply(rotation, bypass, rotation)); + quat.normalize( + state.publishedLookRotation, + quat.multiply(state.publishedLookRotation, bypass, state.publishedLookRotation), + ); + quat.normalize( + state.lastActiveDesiredRotation, + quat.multiply(state.lastActiveDesiredRotation, bypass, state.lastActiveDesiredRotation), + ); + } // Publish the damped look-at point so blends do not jump to the raw target position. if (activating) { damping.reset(state.lookAtDirectionDamper); damping.reset(state.lookAtDistanceDamper); } - lookAtRotation(scratchLookRotation, position, target, referenceUp); + lookRotation(scratchLookRotation, position, target, referenceUp, rotation); damping.dampQuaternion( state.lookAtDirectionDamper, state.publishedLookRotation, diff --git a/src/core/blend/lerpCameraState.ts b/src/core/blend/lerpCameraState.ts index 86a2c2b..2536735 100644 --- a/src/core/blend/lerpCameraState.ts +++ b/src/core/blend/lerpCameraState.ts @@ -148,6 +148,7 @@ export function lerp( if (hasLookAtTarget) vec3.lerp(out.lookAtTarget, a.lookAtTarget, b.lookAtTarget, clamped); out.hasLookAtTarget = hasLookAtTarget; vec3.normalize(out.referenceUp, vec3.lerp(out.referenceUp, a.referenceUp, b.referenceUp, clamped)); + quat.identity(out.rotationDampingBypass); if (useLookAtRotation) { lerpLookAtRotation(out.quaternion, a, b, clamped, out); diff --git a/src/core/body/BindingModes.ts b/src/core/body/BindingModes.ts index 7780056..3b2a240 100644 --- a/src/core/body/BindingModes.ts +++ b/src/core/body/BindingModes.ts @@ -1,4 +1,4 @@ -/** Which rotation (if any) `Follow` applies to `offset` before adding it to the target's world position. */ +/** Which rotation (if any) a Body applies to its offset before adding it to the target's world position. */ export const BindingModes = { worldSpace: 'worldSpace', lockToTarget: 'lockToTarget', diff --git a/src/core/body/FollowBody.ts b/src/core/body/FollowBody.ts index 913ea12..bb8ae97 100644 --- a/src/core/body/FollowBody.ts +++ b/src/core/body/FollowBody.ts @@ -16,6 +16,7 @@ export class FollowBody implements FollowParams { target: T; declare offset: Vec3; declare damping: DampingConstant; + declare rotationDamping: DampingConstant; declare bindingMode: BindingMode; declare maxSpeed: number; @@ -28,14 +29,14 @@ export class FollowBody implements FollowParams { } update = (out: CameraState, dt: number, justActivated: boolean): void => { - if (this.target !== this.lastTarget) { + if (justActivated || this.target !== this.lastTarget) { this.lastTarget = this.target; - this.state.assigned = false; + this.state.tracker.assigned = false; } follow.update(out, this.state, this, this.readTarget(), dt, justActivated); }; - primeFrom = (position: Vec3): void => follow.prime(this.state, this, position); + primeFrom = (position: Vec3): void => follow.prime(this.state, position); /** This frame's target pose, or `null` when there is none. */ protected readTarget(): TargetPose | null { diff --git a/src/core/body/OrbitFollowBody.ts b/src/core/body/OrbitFollowBody.ts new file mode 100644 index 0000000..4715cb7 --- /dev/null +++ b/src/core/body/OrbitFollowBody.ts @@ -0,0 +1,72 @@ +import type { Quat, Vec3 } from 'math'; + +import type { CameraState } from '../CameraState'; +import type { TargetPose } from '../TargetPose'; + +import type { DampingConstant } from '../damping/damping'; +import type { InputAxisOwner } from '../input/InputAxisOwner'; + +import * as orbitFollow from './orbitFollow'; +import type { BindingMode } from './BindingModes'; +import type { OrbitFollowParams, OrbitStyle, RecenteringTarget } from './orbitFollow'; +import type { Orbits } from './threeRing'; + +export type OrbitFollowOptions = Partial; + +/** + * Orbits a target on a sphere or through three rings, driven by three `InputAxis`: `horizontal`, `vertical` and `radial`. + * Layers override `readTarget`. + */ +export class OrbitFollowBody implements OrbitFollowParams, InputAxisOwner { + target: T; + declare orbitStyle: OrbitStyle; + declare radius: number; + declare orbits: Orbits; + declare splineCurvature: number; + declare targetOffset: Vec3; + declare bindingMode: BindingMode; + declare damping: DampingConstant; + declare rotationDamping: DampingConstant; + declare maxSpeed: number; + declare recenteringTarget: RecenteringTarget; + + readonly state = orbitFollow.createState(); + readonly horizontal = this.state.horizontal; + readonly vertical = this.state.vertical; + readonly radial = this.state.radial; + readonly inputAxes = { horizontal: this.horizontal, vertical: this.vertical, radial: this.radial }; + private lastTarget: T | undefined = undefined; + + constructor(target: T, options?: OrbitFollowOptions) { + this.target = target; + Object.assign(this, orbitFollow.createParams(options)); + } + + update = (out: CameraState, dt: number, justActivated: boolean): boolean => { + if (justActivated || this.target !== this.lastTarget) { + this.lastTarget = this.target; + this.state.tracker.assigned = false; + } + return orbitFollow.update(out, this.state, this, this.readTarget(), dt, justActivated); + }; + + /** Start from `position`'s direction around the target, keeping the zoom. */ + primeFrom = (position: Vec3): void => orbitFollow.prime(this.state, position); + + /** Eases the camera toward `position`'s direction around the target, keeping the zoom. */ + setFromPosition = (position: Vec3): void => { + const pose = this.readTarget(); + if (pose) orbitFollow.setFromPosition(this.state, this, pose, position); + }; + + /** Eases the camera around the target until it looks along `rotation`'s forward, keeping the zoom. */ + setFromRotation = (rotation: Quat): void => { + const pose = this.readTarget(); + if (pose) orbitFollow.setFromRotation(this.state, this, pose, rotation); + }; + + /** This frame's target pose, or `null` when there is none. */ + protected readTarget(): TargetPose | null { + return this.target as TargetPose | null; + } +} diff --git a/src/core/body/follow.ts b/src/core/body/follow.ts index 3817563..d742692 100644 --- a/src/core/body/follow.ts +++ b/src/core/body/follow.ts @@ -1,19 +1,22 @@ -import { mat4, quat, vec3, type Mat4, type Quat, type Vec3 } from 'math'; +import { vec3, type Quat, type Vec3 } from 'math'; import type { CameraState } from '../CameraState'; import { withDefaults } from '../params'; import type { TargetPose } from '../TargetPose'; -import * as damping from '../damping/damping'; -import type { DampingConstant, Vector3DamperState } from '../damping/damping'; +import type { DampingConstant } from '../damping/damping'; +import * as tracker from './tracker'; import { BindingModes, type BindingMode } from './BindingModes'; +import type { TrackerState } from './tracker'; export type FollowParams = { /** Offset from the target, rotated according to `bindingMode`. */ offset: Vec3; /** Response time for following the target position. */ damping: DampingConstant; + /** Response time for turning with the target, for every `bindingMode` but `worldSpace`. */ + rotationDamping: DampingConstant; /** Rotation frame used to interpret `offset`. */ bindingMode: BindingMode; /** Maximum damping speed, in world units/sec. */ @@ -23,69 +26,37 @@ export type FollowParams = { /** Every setting from `settings`, or its default. */ export const createParams = (settings?: Partial): FollowParams => withDefaults( - { offset: [0, 0, 10], damping: 0, bindingMode: BindingModes.lockToTarget, maxSpeed: Infinity }, + { offset: [0, 0, 10], damping: 0, rotationDamping: 0, bindingMode: BindingModes.lockToTarget, maxSpeed: Infinity }, settings, ); export type FollowState = { - damper: Vector3DamperState; + tracker: TrackerState; + /** Position set by `prime`, applied once a target is available. */ + primePosition: Vec3; primed: boolean; - /** Target rotation captured by `lockToTargetOnAssign`, valid while `assigned`. */ - assignedRotation: Quat; - assigned: boolean; }; export const createState = (): FollowState => ({ - damper: damping.createVector3State(), + tracker: tracker.createState(), + primePosition: [0, 0, 0], primed: false, - assignedRotation: [0, 0, 0, 1], - assigned: false, }); /** Whether `update` will read `target.rotation` this frame. */ export const needsTargetRotation = (state: FollowState, params: FollowParams): boolean => - params.bindingMode !== BindingModes.worldSpace && - !(params.bindingMode === BindingModes.lockToTargetOnAssign && state.assigned); + tracker.needsTargetRotation(state.tracker, params.bindingMode); const worldUp: Vec3 = [0, 1, 0]; -const forwardAxis: Vec3 = [0, 0, -1]; -const origin: Vec3 = [0, 0, 0]; +const noOffset: Vec3 = [0, 0, 0]; const scratchRotation: Quat = [0, 0, 0, 1]; const scratchRotatedOffset: Vec3 = [0, 0, 0]; -const scratchDesired: Vec3 = [0, 0, 0]; -const scratchForward: Vec3 = [0, 0, 0]; -const scratchLookMatrix: Mat4 = mat4.create(); -function resolveOffsetRotation(out: Quat, state: FollowState, params: FollowParams, target: TargetPose): void { - if (params.bindingMode === BindingModes.worldSpace) { - quat.identity(out); - return; - } - - if (params.bindingMode === BindingModes.lockToTargetOnAssign) { - if (!state.assigned) { - state.assigned = true; - if (target.hasRotation) quat.copy(state.assignedRotation, target.rotation); - else quat.identity(state.assignedRotation); - } - quat.copy(out, state.assignedRotation); - return; - } - - if (!target.hasRotation) { - quat.identity(out); - return; - } - quat.copy(out, target.rotation); - - if (params.bindingMode === BindingModes.lockToTarget) return; - - vec3.transformQuat(scratchForward, forwardAxis, out); - if (params.bindingMode === BindingModes.lockToTargetWithWorldUp) scratchForward[1] = 0; - if (vec3.squaredLength(scratchForward) < 1e-10) return; // degenerate (straight up/down): keep the full rotation - vec3.normalize(scratchForward, scratchForward); - mat4.targetTo(scratchLookMatrix, origin, scratchForward, worldUp); - quat.fromMat4(out, scratchLookMatrix); +function startFromPrime(state: FollowState, params: FollowParams, target: TargetPose): void { + tracker.referenceOrientation(scratchRotation, state.tracker, params.bindingMode, target); + vec3.transformQuat(scratchRotatedOffset, params.offset, scratchRotation); + vec3.subtract(scratchRotatedOffset, state.primePosition, scratchRotatedOffset); + tracker.prime(state.tracker, scratchRotatedOffset, params.offset, scratchRotation); } /** Moves `out` to the target position plus `offset`, rotated according to `bindingMode`. A `null` target leaves `out` as is. */ @@ -97,24 +68,21 @@ export function update( dt: number, justActivated: boolean, ): void { - if (justActivated) { - if (state.primed) state.primed = false; - else damping.resetVector3(state.damper); - } + if (justActivated && !state.primed) tracker.reset(state.tracker); if (!target) return; + if (state.primed) { + state.primed = false; + startFromPrime(state, params, target); + } - resolveOffsetRotation(scratchRotation, state, params, target); - vec3.transformQuat(scratchRotatedOffset, params.offset, scratchRotation); - vec3.add(scratchDesired, scratchRotatedOffset, target.position); - - damping.dampVector3(state.damper, out.position, scratchDesired, params.damping, dt, params.maxSpeed); - vec3.subtract(out.target, out.position, scratchRotatedOffset); + tracker.trackTarget(out.target, scratchRotation, state.tracker, params, target, params.offset, noOffset, dt); + vec3.add(out.position, out.target, vec3.transformQuat(scratchRotatedOffset, params.offset, scratchRotation)); out.hasTarget = true; vec3.transformQuat(out.referenceUp, worldUp, scratchRotation); } /** Start the next activation from `position` instead of snapping to the target. */ -export function prime(state: FollowState, params: FollowParams, position: Vec3): void { - damping.dampVector3(state.damper, position, position, params.damping, 0); +export function prime(state: FollowState, position: Vec3): void { + vec3.copy(state.primePosition, position); state.primed = true; } diff --git a/src/core/body/index.ts b/src/core/body/index.ts index 7875711..34fbb0b 100644 --- a/src/core/body/index.ts +++ b/src/core/body/index.ts @@ -8,6 +8,14 @@ export { FollowBody, type FollowOptions } from './FollowBody'; export * as follow from './follow'; export type { FollowParams, FollowState } from './follow'; +export { OrbitFollowBody, type OrbitFollowOptions } from './OrbitFollowBody'; +export * as orbitFollow from './orbitFollow'; +export type { OrbitFollowParams, OrbitFollowState, OrbitStyle, RecenteringTarget } from './orbitFollow'; +export * as threeRing from './threeRing'; +export type { Orbit, Orbits, ThreeRingState } from './threeRing'; +export * as tracker from './tracker'; +export type { TrackerParams, TrackerState } from './tracker'; + export { PositionComposerBody } from './PositionComposerBody'; export * as positionComposer from './positionComposer'; export type { PositionComposerParams, PositionComposerState } from './positionComposer'; diff --git a/src/core/body/orbitFollow.ts b/src/core/body/orbitFollow.ts new file mode 100644 index 0000000..79c429e --- /dev/null +++ b/src/core/body/orbitFollow.ts @@ -0,0 +1,372 @@ +import { clamp, degreesToRadians, quat, radiansToDegrees, vec3, type Euler, type Quat, type Vec3 } from 'math'; + +import type { CameraState } from '../CameraState'; +import { withDefaults } from '../params'; +import type { TargetPose } from '../TargetPose'; + +import * as damping from '../damping/damping'; +import type { DamperState, DampingConstant } from '../damping/damping'; +import type { InputAxisParams } from '../input/axis'; +import { InputAxis } from '../input/InputAxis'; +import { shortestWrappedDelta } from '../input/shortestWrappedDelta'; + +import * as threeRing from './threeRing'; +import * as tracker from './tracker'; +import { BindingModes, type BindingMode } from './BindingModes'; +import { safeFromToRotation } from './safeFromToRotation'; +import type { Orbits, ThreeRingState } from './threeRing'; +import type { TrackerState } from './tracker'; + +export type OrbitFollowParams = { + /** Shape the camera moves on: a sphere of `radius`, or a surface through three `orbits`. */ + orbitStyle: OrbitStyle; + /** Distance from the target while `radial` is `0`, for `sphere`. Changes ease in with `radial.damping`. */ + radius: number; + /** Rings the `threeRing` surface passes through, from `vertical`'s minimum to its maximum. */ + orbits: Orbits; + /** How strongly the `threeRing` surface curves between the rings, from `0` to `1`. */ + splineCurvature: number; + /** Center of the orbit relative to the target, rotated according to `bindingMode`. */ + targetOffset: Vec3; + /** Rotation frame the orbit is measured in. */ + bindingMode: BindingMode; + /** Response time for following the target position. */ + damping: DampingConstant; + /** Response time for turning with the target, for every `bindingMode` but `worldSpace`. */ + rotationDamping: DampingConstant; + /** Maximum damping speed, in world units/sec. */ + maxSpeed: number; + /** What `horizontal` recenters to: its `center`, or the side behind the target's forward. */ + recenteringTarget: RecenteringTarget; +}; + +export type OrbitStyle = 'sphere' | 'threeRing'; + +export type RecenteringTarget = 'axisCenter' | 'trackingTarget'; + +/** Every setting from `settings`, or its default. */ +export const createParams = (settings?: Partial): OrbitFollowParams => + withDefaults( + { + orbitStyle: 'sphere', + radius: 10, + orbits: { + top: { height: 10, radius: 10 }, + center: { height: 0, radius: 10 }, + bottom: { height: -10, radius: 10 }, + }, + splineCurvature: 0, + targetOffset: [0, 0, 0], + bindingMode: BindingModes.worldSpace, + damping: 0, + rotationDamping: 0, + maxSpeed: Infinity, + recenteringTarget: 'trackingTarget', + }, + settings, + ); + +/** + * `horizontal` (around the target, wraps ±180°) and `vertical` (elevation, or from the bottom to the top ring) in + * degrees, and `radial` as the natural log of the radius scale. + */ +export type OrbitFollowState = { + horizontal: InputAxis; + vertical: InputAxis; + radial: InputAxis; + radius: DamperState; + threeRing: ThreeRingState; + tracker: TrackerState; + /** Binding frame of the last `update`. */ + orientation: Quat; + /** Position set by `prime`, applied once a target is available. */ + primePosition: Vec3; + primed: boolean; +}; + +type AxisSettings = Partial; + +/** Default settings of each axis. Every axis starts at its `center`. */ +export const createAxisSettings = (): { horizontal: AxisSettings; vertical: AxisSettings; radial: AxisSettings } => ({ + horizontal: { center: 0, range: [-180, 180], wrap: true }, + vertical: { center: 0, range: [-90, 90] }, + radial: { center: 0, range: [Math.log(0.5), Math.log(2)] }, +}); + +export function createState(): OrbitFollowState { + const { horizontal, vertical, radial } = createAxisSettings(); + return { + horizontal: new InputAxis({ ...horizontal, value: horizontal.center }), + vertical: new InputAxis({ ...vertical, value: vertical.center }), + radial: new InputAxis({ ...radial, value: radial.center }), + radius: damping.createState(), + threeRing: threeRing.createState(), + tracker: tracker.createState(), + orientation: [0, 0, 0, 1], + primePosition: [0, 0, 0], + primed: false, + }; +} + +const recentersBehindTarget = (state: OrbitFollowState, params: OrbitFollowParams): boolean => + params.recenteringTarget === 'trackingTarget' && state.horizontal.recentering.enabled; + +/** Whether `update` will read `target.rotation` this frame. */ +export const needsTargetRotation = (state: OrbitFollowState, params: OrbitFollowParams): boolean => + tracker.needsTargetRotation(state.tracker, params.bindingMode) || recentersBehindTarget(state, params); + +/** Start the next update from `position`'s direction around the target. `radial` keeps its value. */ +export function prime(state: OrbitFollowState, position: Vec3): void { + vec3.copy(state.primePosition, position); + state.primed = true; +} + +const poleLimit = 90 - 1e-3; +const worldUp: Vec3 = [0, 1, 0]; +const forwardAxis: Vec3 = [0, 0, -1]; +const scratchEuler: Euler = [0, 0, 0, 'yxz']; +const scratchRotation: Quat = [0, 0, 0, 1]; +const scratchOffset: Vec3 = [0, 0, 0]; +const scratchOrientation: Quat = [0, 0, 0, 1]; +const scratchInverse: Quat = [0, 0, 0, 1]; +const backAxis: Vec3 = [0, 0, 1]; +const scratchDirection: Vec3 = [0, 0, 0]; +const scratchWorld: Vec3 = [0, 0, 0]; +const scratchAxes: [number, number] = [0, 0]; +const scratchPreviousOffset: Vec3 = [0, 0, 0]; + +/** Where `value` is within `axis`' range, from `0` to `1`. */ +function normalize(axis: InputAxis, value: number): number { + const range = axis.range; + if (!range || range[1] <= range[0]) return 0.5; + return clamp((value - range[0]) / (range[1] - range[0]), 0, 1); +} + +/** The camera's offset from the tracked point at these axis values, in the binding frame. */ +function orbitOffset( + out: Vec3, + state: OrbitFollowState, + params: OrbitFollowParams, + horizontal: number, + vertical: number, +) { + const scale = Math.exp(state.radial.value); + if (params.orbitStyle === 'threeRing') { + const t = normalize(state.vertical, vertical); + threeRing.point(out, state.threeRing, params.orbits, params.splineCurvature, t); + vec3.scale(out, out, scale); + quat.setAxisAngle(scratchRotation, worldUp, -degreesToRadians(horizontal)); + } else { + // At a pole the horizontal angle no longer moves the camera, so the view could not turn with it. + scratchEuler[0] = -degreesToRadians(clamp(vertical, -poleLimit, poleLimit)); + scratchEuler[1] = -degreesToRadians(horizontal); + quat.fromEuler(scratchRotation, scratchEuler); + vec3.set(out, 0, 0, state.radius.value * scale); + } + return vec3.transformQuat(out, out, scratchRotation); +} + +/** Where the camera would be at these axis values, around the tracked point and in the frame of the last `update`. */ +export function point( + out: Vec3, + state: OrbitFollowState, + params: OrbitFollowParams, + horizontal: number, + vertical: number, +): Vec3 { + orbitOffset(out, state, params, horizontal, vertical); + vec3.transformQuat(out, out, state.orientation); + return vec3.add(out, out, state.tracker.trackedPoint); +} + +function directionFrom( + out: Vec3, + state: OrbitFollowState, + params: OrbitFollowParams, + target: TargetPose, + position: Vec3, +) { + tracker.referenceOrientation(scratchOrientation, state.tracker, params.bindingMode, target); + vec3.add(out, target.position, vec3.transformQuat(out, params.targetOffset, scratchOrientation)); + return vec3.subtract(out, position, out); +} + +/** The `horizontal` and `vertical` values that put the camera along world `direction` from the orbit's center. */ +function axesAlong( + state: OrbitFollowState, + params: OrbitFollowParams, + target: TargetPose, + direction: Vec3, +): [number, number] | null { + tracker.referenceOrientation(scratchOrientation, state.tracker, params.bindingMode, target); + vec3.transformQuat(scratchDirection, direction, quat.conjugate(scratchInverse, scratchOrientation)); + const x = scratchDirection[0]; + const y = scratchDirection[1]; + const z = scratchDirection[2]; + if (x * x + y * y + z * z < 1e-12) return null; + scratchAxes[0] = radiansToDegrees(Math.atan2(-x, z)); + const elevation = Math.atan2(y, Math.hypot(x, z)); + const range = state.vertical.range; + if (params.orbitStyle !== 'threeRing') scratchAxes[1] = radiansToDegrees(elevation); + else if (range) scratchAxes[1] = range[0] + closestOrbitPoint(state, params, elevation) * (range[1] - range[0]); + else scratchAxes[1] = state.vertical.value; + return scratchAxes; +} + +function easeAxesTo(state: OrbitFollowState, axes: [number, number] | null): void { + if (!axes) return; + const { horizontal, vertical } = state; + const wrapped = horizontal.wrap && horizontal.range; + horizontal.applyDelta( + wrapped ? shortestWrappedDelta(horizontal.rawValue, axes[0], wrapped) : axes[0] - horizontal.rawValue, + ); + vertical.applyDelta(axes[1] - vertical.rawValue); +} + +/** Eases `horizontal` and `vertical` toward `position`'s direction around the target. `radial` keeps its value. */ +export function setFromPosition( + state: OrbitFollowState, + params: OrbitFollowParams, + target: TargetPose, + position: Vec3, +): void { + easeAxesTo(state, axesAlong(state, params, target, directionFrom(scratchWorld, state, params, target, position))); +} + +/** Eases `horizontal` and `vertical` so the camera looks along `rotation`'s forward at the target. */ +export function setFromRotation( + state: OrbitFollowState, + params: OrbitFollowParams, + target: TargetPose, + rotation: Quat, +): void { + easeAxesTo(state, axesAlong(state, params, target, vec3.transformQuat(scratchWorld, backAxis, rotation))); +} + +function primeAxes(state: OrbitFollowState, params: OrbitFollowParams, target: TargetPose, position: Vec3): void { + const axes = axesAlong(state, params, target, directionFrom(scratchWorld, state, params, target, position)); + if (!axes) return; + state.horizontal.setValue(axes[0]); + state.vertical.setValue(axes[1]); +} + +function elevationError(state: OrbitFollowState, params: OrbitFollowParams, t: number, elevation: number): number { + threeRing.point(scratchDirection, state.threeRing, params.orbits, params.splineCurvature, t); + return Math.abs(Math.atan2(scratchDirection[1], scratchDirection[2]) - elevation); +} + +/** Where between the bottom (`0`) and top (`1`) ring the direction from the target is closest to `elevation`. */ +function closestOrbitPoint(state: OrbitFollowState, params: OrbitFollowParams, elevation: number): number { + const samples = 32; + let best = 0; + let bestError = Infinity; + for (let i = 0; i <= samples; i++) { + const error = elevationError(state, params, i / samples, elevation); + if (error < bestError) { + bestError = error; + best = i / samples; + } + } + for (let step = 0.5 / samples; step > 1e-7; step /= 2) { + const below = clamp(best - step, 0, 1); + const above = clamp(best + step, 0, 1); + const belowError = elevationError(state, params, below, elevation); + const aboveError = elevationError(state, params, above, elevation); + if (belowError < bestError && belowError <= aboveError) { + best = below; + bestError = belowError; + } else if (aboveError < bestError) { + best = above; + bestError = aboveError; + } + } + return best; +} + +function centerBehindTarget(state: OrbitFollowState, params: OrbitFollowParams, target: TargetPose): void { + if (!target.hasRotation) return; + tracker.referenceOrientation(scratchOrientation, state.tracker, params.bindingMode, target); + vec3.transformQuat(scratchDirection, forwardAxis, target.rotation); + vec3.transformQuat(scratchDirection, scratchDirection, quat.conjugate(scratchInverse, scratchOrientation)); + const x = scratchDirection[0]; + const z = scratchDirection[2]; + if (x * x + z * z < 1e-12) return; + state.horizontal.center = radiansToDegrees(Math.atan2(x, -z)); +} + +const isActive = (axis: InputAxis): boolean => axis.held || axis.hadDelta; + +// Counting as input restarts the axis' recentering wait. +function shareInput(axis: InputAxis, other: InputAxis, otherActive: boolean): void { + if (otherActive && other.recentering.time === axis.recentering.time) axis.hadDelta = true; +} + +/** Input on one axis restarts the recentering wait of every axis with the same `recentering.time`. */ +function syncRecentering({ horizontal, vertical, radial }: OrbitFollowState): void { + const h = isActive(horizontal); + const v = isActive(vertical); + const r = isActive(radial); + shareInput(horizontal, vertical, v); + shareInput(horizontal, radial, r); + shareInput(vertical, horizontal, h); + shareInput(vertical, radial, r); + shareInput(radial, horizontal, h); + shareInput(radial, vertical, v); +} + +/** + * Advances the axes and places `out` on the orbit around the target. A `null` target leaves `out` as is. + * Returns `true` while an axis still has to move. + */ +export function update( + out: CameraState, + state: OrbitFollowState, + params: OrbitFollowParams, + target: TargetPose | null, + dt: number, + justActivated: boolean, +): boolean { + quat.identity(out.rotationDampingBypass); + if (justActivated) { + tracker.reset(state.tracker); + damping.reset(state.radius); + state.horizontal.idleTime = 0; + state.vertical.idleTime = 0; + state.radial.idleTime = 0; + } + if (target && recentersBehindTarget(state, params)) centerBehindTarget(state, params, target); + syncRecentering(state); + const horizontalMoving = state.horizontal.update(dt); + const verticalMoving = state.vertical.update(dt); + const radialMoving = state.radial.update(dt); + const radius = damping.damp(state.radius, params.radius, state.radial.damping, dt).value; + const moving = horizontalMoving || verticalMoving || radialMoving || radius !== params.radius; + if (!target) return moving; + if (state.primed) { + state.primed = false; + primeAxes(state, params, target, state.primePosition); + } + + orbitOffset(scratchOffset, state, params, state.horizontal.value, state.vertical.value); + + const hadPrevious = state.tracker.hasPrevious; + vec3.copy(scratchPreviousOffset, state.tracker.previousOffset); + tracker.trackTarget( + out.target, + state.orientation, + state.tracker, + params, + target, + scratchOffset, + params.targetOffset, + dt, + ); + vec3.add(out.position, out.target, vec3.transformQuat(scratchOffset, scratchOffset, state.orientation)); + out.hasTarget = true; + vec3.transformQuat(out.referenceUp, worldUp, state.orientation); + if (hadPrevious) { + vec3.transformQuat(scratchPreviousOffset, scratchPreviousOffset, state.orientation); + safeFromToRotation(out.rotationDampingBypass, scratchPreviousOffset, scratchOffset, out.referenceUp); + } + return moving; +} diff --git a/src/core/body/safeFromToRotation.ts b/src/core/body/safeFromToRotation.ts new file mode 100644 index 0000000..d555979 --- /dev/null +++ b/src/core/body/safeFromToRotation.ts @@ -0,0 +1,21 @@ +import { quat, vec3, type Quat, type Vec3 } from 'math'; + +const scratchProjectedFrom: Vec3 = [0, 0, 0]; +const scratchProjectedTo: Vec3 = [0, 0, 0]; +const scratchAxis: Vec3 = [0, 0, 0]; +const scratchPitch: Quat = [0, 0, 0, 1]; + +/** Rotation from `from` to `to` as a turn around `up` followed by a pitch, so it never adds roll. */ +export function safeFromToRotation(out: Quat, from: Vec3, to: Vec3, up: Vec3): Quat { + vec3.scaleAndAdd(scratchProjectedFrom, from, up, -vec3.dot(from, up)); + vec3.scaleAndAdd(scratchProjectedTo, to, up, -vec3.dot(to, up)); + if (vec3.squaredLength(scratchProjectedFrom) < 1e-10 || vec3.squaredLength(scratchProjectedTo) < 1e-10) { + vec3.cross(scratchAxis, from, to); + if (vec3.squaredLength(scratchAxis) < 1e-10) vec3.copy(scratchAxis, up); + return quat.setAxisAngle(out, vec3.normalize(scratchAxis, scratchAxis), vec3.angle(from, to)); + } + vec3.normalize(scratchAxis, vec3.cross(scratchAxis, up, from)); + quat.setAxisAngle(scratchPitch, scratchAxis, vec3.angle(to, up) - vec3.angle(from, up)); + quat.setAxisAngle(out, up, vec3.signedAngle(scratchProjectedFrom, scratchProjectedTo, up)); + return quat.multiply(out, out, scratchPitch); +} diff --git a/src/core/body/threeRing.ts b/src/core/body/threeRing.ts new file mode 100644 index 0000000..dd5ba03 --- /dev/null +++ b/src/core/body/threeRing.ts @@ -0,0 +1,138 @@ +import { clamp, type Vec3 } from 'math'; + +/** A horizontal ring around the target. */ +export type Orbit = { + /** Horizontal distance from the target. */ + radius: number; + /** Height above the target. */ + height: number; +}; + +export type Orbits = { top: Orbit; center: Orbit; bottom: Orbit }; + +/** A smooth curve through the rings, as `[height, radius]` knots with Bezier control points between them. */ +export type ThreeRingState = { + /** An extrapolated end, bottom, center, top and another extrapolated end. */ + knots: number[]; + ctrl1: number[]; + ctrl2: number[]; + /** Settings the curve was built for. */ + builtFor: number[]; +}; + +const knotCount = 5; + +export const createState = (): ThreeRingState => ({ + knots: new Array(knotCount * 2).fill(0), + ctrl1: new Array(knotCount * 2).fill(0), + ctrl2: new Array(knotCount * 2).fill(0), + builtFor: new Array(7).fill(Number.NaN), +}); + +function isBuiltFor(state: ThreeRingState, orbits: Orbits, splineCurvature: number): boolean { + const built = state.builtFor; + return ( + built[0] === orbits.bottom.height && + built[1] === orbits.bottom.radius && + built[2] === orbits.center.height && + built[3] === orbits.center.radius && + built[4] === orbits.top.height && + built[5] === orbits.top.radius && + built[6] === splineCurvature + ); +} + +function setKnot(knots: number[], index: number, height: number, radius: number): void { + knots[index * 2] = height; + knots[index * 2 + 1] = radius; +} + +const a = new Array(knotCount).fill(0); +const b = new Array(knotCount).fill(0); +const c = new Array(knotCount).fill(0); +const r = new Array(knotCount).fill(0); + +// Solves for control points that keep the curve's first and second derivatives continuous across knots. +function computeControlPoints({ knots, ctrl1, ctrl2 }: ThreeRingState): void { + const n = knotCount - 1; + for (let axis = 0; axis < 2; axis++) { + const k = (i: number): number => knots[i * 2 + axis]; + a[0] = 0; + b[0] = 2; + c[0] = 1; + r[0] = k(0) + 2 * k(1); + for (let i = 1; i < n - 1; i++) { + a[i] = 1; + b[i] = 4; + c[i] = 1; + r[i] = 4 * k(i) + 2 * k(i + 1); + } + a[n - 1] = 2; + b[n - 1] = 7; + c[n - 1] = 0; + r[n - 1] = 8 * k(n - 1) + k(n); + + for (let i = 1; i < n; i++) { + const m = a[i] / b[i - 1]; + b[i] -= m * c[i - 1]; + r[i] -= m * r[i - 1]; + } + ctrl1[(n - 1) * 2 + axis] = r[n - 1] / b[n - 1]; + for (let i = n - 2; i >= 0; i--) ctrl1[i * 2 + axis] = (r[i] - c[i] * ctrl1[(i + 1) * 2 + axis]) / b[i]; + for (let i = 0; i < n - 1; i++) ctrl2[i * 2 + axis] = 2 * k(i + 1) - ctrl1[(i + 1) * 2 + axis]; + ctrl2[(n - 1) * 2 + axis] = 0.5 * (k(n) + ctrl1[(n - 1) * 2 + axis]); + } +} + +function build(state: ThreeRingState, orbits: Orbits, splineCurvature: number): void { + const { bottom, center, top } = orbits; + const { knots, builtFor } = state; + setKnot(knots, 1, bottom.height, bottom.radius); + setKnot(knots, 2, center.height, center.radius); + setKnot(knots, 3, top.height, top.radius); + // The ends continue past the outer rings and pull toward the target as the curvature grows. + const keep = 1 - clamp(splineCurvature, 0, 1); + setKnot( + knots, + 0, + keep * (1.5 * bottom.height - 0.5 * center.height), + keep * (1.5 * bottom.radius - 0.5 * center.radius), + ); + setKnot(knots, 4, keep * (1.5 * top.height - 0.5 * center.height), keep * (1.5 * top.radius - 0.5 * center.radius)); + computeControlPoints(state); + + builtFor[0] = bottom.height; + builtFor[1] = bottom.radius; + builtFor[2] = center.height; + builtFor[3] = center.radius; + builtFor[4] = top.height; + builtFor[5] = top.radius; + builtFor[6] = splineCurvature; +} + +/** + * Writes the point of the curve at `t` to `out` as `[0, height, radius]`: `0` is the bottom ring, `0.5` the center + * ring and `1` the top ring. Rebuilds the curve only when the rings or the curvature changed. + */ +export function point(out: Vec3, state: ThreeRingState, orbits: Orbits, splineCurvature: number, t: number): Vec3 { + if (!isBuiltFor(state, orbits, splineCurvature)) build(state, orbits, splineCurvature); + const { knots, ctrl1, ctrl2 } = state; + + let s = clamp(t, 0, 1) * 2; + let segment = 1; + if (s > 1) { + s -= 1; + segment = 2; + } + const d = 1 - s; + const w0 = d * d * d; + const w1 = 3 * d * d * s; + const w2 = 3 * d * s * s; + const w3 = s * s * s; + const i = segment * 2; + const j = (segment + 1) * 2; + out[0] = 0; + out[1] = w0 * knots[i] + w1 * ctrl1[i] + w2 * ctrl2[i] + w3 * knots[j]; + out[2] = w0 * knots[i + 1] + w1 * ctrl1[i + 1] + w2 * ctrl2[i + 1] + w3 * knots[j + 1]; + return out; +} diff --git a/src/core/body/tracker.ts b/src/core/body/tracker.ts new file mode 100644 index 0000000..bfceff8 --- /dev/null +++ b/src/core/body/tracker.ts @@ -0,0 +1,170 @@ +import { mat4, quat, vec3, type Mat4, type Quat, type Vec3 } from 'math'; + +import type { TargetPose } from '../TargetPose'; + +import * as damping from '../damping/damping'; +import type { DamperState, DampingConstant, Vector3DamperState } from '../damping/damping'; + +import { BindingModes, type BindingMode } from './BindingModes'; +import { safeFromToRotation } from './safeFromToRotation'; + +export type TrackerParams = { + /** Rotation frame of the camera offset and the target offset. */ + bindingMode: BindingMode; + /** Response time for following the target position. */ + damping: DampingConstant; + /** Response time for turning with the target, for every `bindingMode` but `worldSpace`. */ + rotationDamping: DampingConstant; + /** Maximum damping speed, in world units/sec. */ + maxSpeed: number; +}; + +export type TrackerState = { + /** Damped target position, the point the camera offset is added to. */ + trackedPoint: Vec3; + previousOffset: Vec3; + hasPrevious: boolean; + damper: Vector3DamperState; + /** Damped `bindingMode` rotation, the frame of the offsets. */ + orientation: Quat; + rotationDamper: DamperState; + /** Target rotation captured on entering `lockToTargetOnAssign`, valid while `assigned`. */ + assignedRotation: Quat; + assigned: boolean; +}; + +export const createState = (): TrackerState => ({ + trackedPoint: [0, 0, 0], + previousOffset: [0, 0, 0], + hasPrevious: false, + damper: damping.createVector3State(), + orientation: [0, 0, 0, 1], + rotationDamper: damping.createState(), + assignedRotation: [0, 0, 0, 1], + assigned: false, +}); + +/** Makes the next `trackTarget` snap to the target. */ +export function reset(state: TrackerState): void { + state.hasPrevious = false; + damping.resetVector3(state.damper); + damping.reset(state.rotationDamper); +} + +// A step of zero length marks a damper as started, so its next step eases instead of snapping. +function start(damper: DamperState): void { + damping.damp(damper, damper.value, 1, 0); +} + +/** Makes the next `trackTarget` ease from `point` and `orientation` instead of snapping to the target. */ +export function prime(state: TrackerState, point: Vec3, offset: Vec3, orientation: Quat): void { + reset(state); + vec3.copy(state.trackedPoint, point); + vec3.copy(state.previousOffset, offset); + quat.copy(state.orientation, orientation); + state.hasPrevious = true; + start(state.damper.x); + start(state.damper.y); + start(state.damper.z); + start(state.rotationDamper); +} + +/** Whether `referenceOrientation` will read `target.rotation` this frame. */ +export const needsTargetRotation = (state: Pick, bindingMode: BindingMode): boolean => + bindingMode !== BindingModes.worldSpace && !(bindingMode === BindingModes.lockToTargetOnAssign && state.assigned); + +const worldUp: Vec3 = [0, 1, 0]; +const forwardAxis: Vec3 = [0, 0, -1]; +const origin: Vec3 = [0, 0, 0]; +const scratchForward: Vec3 = [0, 0, 0]; +const scratchLookMatrix: Mat4 = mat4.create(); + +/** The rotation `bindingMode` applies to offsets around `target`. Captures it on entering `lockToTargetOnAssign`. */ +export function referenceOrientation( + out: Quat, + state: Pick, + bindingMode: BindingMode, + target: TargetPose, +): Quat { + if (bindingMode !== BindingModes.lockToTargetOnAssign) state.assigned = false; + if (bindingMode === BindingModes.worldSpace) return quat.identity(out); + + if (bindingMode === BindingModes.lockToTargetOnAssign) { + if (!state.assigned) { + state.assigned = true; + if (target.hasRotation) quat.copy(state.assignedRotation, target.rotation); + else quat.identity(state.assignedRotation); + } + return quat.copy(out, state.assignedRotation); + } + + if (!target.hasRotation) return quat.identity(out); + quat.copy(out, target.rotation); + + if (bindingMode === BindingModes.lockToTarget) return out; + + vec3.transformQuat(scratchForward, forwardAxis, out); + if (bindingMode === BindingModes.lockToTargetWithWorldUp) scratchForward[1] = 0; + if (vec3.squaredLength(scratchForward) < 1e-10) return out; // degenerate (straight up/down): keep the full rotation + vec3.normalize(scratchForward, scratchForward); + mat4.targetTo(scratchLookMatrix, origin, scratchForward, worldUp); + return quat.fromMat4(out, scratchLookMatrix); +} + +const scratchGoal: Vec3 = [0, 0, 0]; +const scratchReference: Quat = [0, 0, 0, 1]; +const scratchWorldOffset: Vec3 = [0, 0, 0]; +const scratchPreviousOffset: Vec3 = [0, 0, 0]; +const scratchRotation: Quat = [0, 0, 0, 1]; +const scratchDelta: Vec3 = [0, 0, 0]; +const scratchStep: Vec3 = [0, 0, 0]; +const scratchFrame: Quat = [0, 0, 0, 1]; +const scratchFrameInverse: Quat = [0, 0, 0, 1]; + +/** + * Damps the tracked point toward the target position plus `targetOffset`, per axis of the camera `offset`'s frame. + * When `offset` changes, the tracked point turns with it around the target, so moving the camera is never damped. + * Writes the tracked point to `out` and the reference orientation to `outOrientation`. + */ +export function trackTarget( + out: Vec3, + outOrientation: Quat, + state: TrackerState, + params: TrackerParams, + target: TargetPose, + offset: Vec3, + targetOffset: Vec3, + dt: number, +): Vec3 { + referenceOrientation(scratchReference, state, params.bindingMode, target); + if (state.hasPrevious) { + damping.dampQuaternion(state.rotationDamper, state.orientation, scratchReference, params.rotationDamping, dt); + } else { + quat.copy(state.orientation, scratchReference); + start(state.rotationDamper); + } + quat.copy(outOrientation, state.orientation); + vec3.add(scratchGoal, target.position, vec3.transformQuat(scratchGoal, targetOffset, outOrientation)); + vec3.transformQuat(scratchWorldOffset, offset, outOrientation); + + if (state.hasPrevious && !vec3.exactEquals(state.previousOffset, offset)) { + vec3.transformQuat(scratchPreviousOffset, state.previousOffset, outOrientation); + safeFromToRotation(scratchRotation, scratchPreviousOffset, scratchWorldOffset, worldUp); + vec3.subtract(scratchDelta, state.trackedPoint, scratchGoal); + vec3.add(state.trackedPoint, scratchGoal, vec3.transformQuat(scratchDelta, scratchDelta, scratchRotation)); + } + vec3.copy(state.previousOffset, offset); + state.hasPrevious = true; + + vec3.cross(scratchDelta, scratchWorldOffset, worldUp); + if (vec3.squaredLength(scratchDelta) < 1e-10) quat.copy(scratchFrame, outOrientation); + else quat.fromMat4(scratchFrame, mat4.targetTo(scratchLookMatrix, origin, scratchWorldOffset, worldUp)); + quat.conjugate(scratchFrameInverse, scratchFrame); + + vec3.subtract(scratchDelta, scratchGoal, state.trackedPoint); + vec3.transformQuat(scratchDelta, scratchDelta, scratchFrameInverse); + vec3.zero(scratchStep); + damping.dampVector3(state.damper, scratchStep, scratchDelta, params.damping, dt, params.maxSpeed); + vec3.add(state.trackedPoint, state.trackedPoint, vec3.transformQuat(scratchStep, scratchStep, scratchFrame)); + return vec3.copy(out, state.trackedPoint); +} diff --git a/src/react/body/Body.ts b/src/react/body/Body.ts index 4e8c0a5..482bcc6 100644 --- a/src/react/body/Body.ts +++ b/src/react/body/Body.ts @@ -1,5 +1,6 @@ import { Follow } from './Follow'; import { HardLockToTarget } from './HardLockToTarget'; +import { OrbitFollow } from './OrbitFollow'; import { PositionComposer } from './PositionComposer'; /** Body components control a ``'s position. Use at most one per camera. */ @@ -7,4 +8,5 @@ export const Body = { HardLockToTarget, Follow, PositionComposer, + OrbitFollow, }; diff --git a/src/react/body/OrbitFollow.tsx b/src/react/body/OrbitFollow.tsx new file mode 100644 index 0000000..e6059d3 --- /dev/null +++ b/src/react/body/OrbitFollow.tsx @@ -0,0 +1,96 @@ +import { useFrame } from '@react-three/fiber'; +import { useEffect, useImperativeHandle, useState, type ReactNode, type Ref } from 'react'; + +import * as orbitFollow from '../../core/body/orbitFollow'; +import * as inputAxis from '../../core/input/axis'; +import type { InputAxisParams } from '../../core/input/axis'; +import type { InputAxis } from '../../core/input/InputAxis'; +import { withDefaults } from '../../core/params'; + +import { OrbitFollowBodyThree, type OrbitFollowThreeOptions } from '../../three/body/OrbitFollowBodyThree'; +import { OrbitFollowHelperThree } from '../../three/body/OrbitFollowHelperThree'; +import { resolveVec3 } from '../../three/resolve/resolveVector3'; +import type { Target } from '../../three/resolve/Target'; + +import { useVirtualCamera } from '../VirtualCameraContext'; + +import { InputAxisOwnerContext } from '../input/InputAxisOwnerContext'; + +/** Settings of one orbit axis. It starts at `center`, then input drives its value. */ +export type OrbitFollowAxisSettings = Partial>; + +export type OrbitFollowProps = OrbitFollowThreeOptions & { + /** Target to orbit. Unresolved targets are ignored. */ + target?: Target; + /** Angle around the target, in degrees. */ + horizontal?: OrbitFollowAxisSettings; + /** Elevation above the target in degrees, or from the bottom to the top ring for `threeRing`. */ + vertical?: OrbitFollowAxisSettings; + /** Natural log of the radius scale. */ + radial?: OrbitFollowAxisSettings; + /** `horizontal.autoNormalize`: keeps it inside its range after each drag. */ + autoNormalize?: boolean; + /** Draws the orbit in the scene. */ + debug?: boolean; + ref?: Ref; + /** Nested `` picks up `horizontal`/`vertical`/`radial` without an explicit `target`. */ + children?: ReactNode; +}; + +function applyAxis(axis: InputAxis, defaults: Partial, settings: OrbitFollowAxisSettings | undefined) { + const params = withDefaults(inputAxis.createParams(defaults), settings); + params.value = axis.value; + Object.assign(axis, params); +} + +function applyAxes(body: OrbitFollowBodyThree, { horizontal, vertical, radial, autoNormalize }: OrbitFollowProps) { + const defaults = orbitFollow.createAxisSettings(); + defaults.horizontal.autoNormalize = autoNormalize; + applyAxis(body.horizontal, defaults.horizontal, horizontal); + applyAxis(body.vertical, defaults.vertical, vertical); + applyAxis(body.radial, defaults.radial, radial); +} + +/** Orbits a target, driven by the `horizontal`, `vertical` and `radial` axes. */ +export function OrbitFollow({ + target, + targetOffset, + horizontal, + vertical, + radial, + autoNormalize = false, + debug = false, + ref, + children, + ...settings +}: OrbitFollowProps) { + const camera = useVirtualCamera(); + const { targetOffset: defaultTargetOffset, ...params } = orbitFollow.createParams(settings); + const [body] = useState(() => { + const created = new OrbitFollowBodyThree(target, params); + applyAxes(created, { horizontal, vertical, radial, autoNormalize }); + for (const axis of [created.horizontal, created.vertical, created.radial]) axis.setValue(axis.center); + return created; + }); + body.target = target; + Object.assign(body, params); + resolveVec3(body.targetOffset, targetOffset ?? defaultTargetOffset); + applyAxes(body, { horizontal, vertical, radial, autoNormalize }); + + useImperativeHandle(ref, () => body, [body]); + useEffect(() => camera.setBody(body), [camera, body]); + + return ( + + {children} + {debug && } + + ); +} + +function OrbitDebug({ body }: { body: OrbitFollowBodyThree }) { + const [helper] = useState(() => new OrbitFollowHelperThree()); + useEffect(() => () => helper.dispose(), [helper]); + useFrame(() => helper.sync(body)); + return ; +} diff --git a/src/react/index.ts b/src/react/index.ts index 06be11f..c03c212 100644 --- a/src/react/index.ts +++ b/src/react/index.ts @@ -21,6 +21,7 @@ export { export { Body } from './body/Body'; export { Follow, type FollowProps } from './body/Follow'; export { HardLockToTarget, type HardLockToTargetProps } from './body/HardLockToTarget'; +export { OrbitFollow, type OrbitFollowAxisSettings, type OrbitFollowProps } from './body/OrbitFollow'; export { PositionComposer, type PositionComposerProps } from './body/PositionComposer'; export { Aim } from './aim/Aim'; diff --git a/src/three/body/OrbitFollowBodyThree.ts b/src/three/body/OrbitFollowBodyThree.ts new file mode 100644 index 0000000..1800c2d --- /dev/null +++ b/src/three/body/OrbitFollowBodyThree.ts @@ -0,0 +1,30 @@ +import * as orbitFollow from '../../core/body/orbitFollow'; +import * as targetPose from '../../core/TargetPose'; +import { OrbitFollowBody, type OrbitFollowOptions } from '../../core/body/OrbitFollowBody'; +import type { TargetPose } from '../../core/TargetPose'; + +import { readTargetPose } from '../readTargetPose'; + +import { optionalVec3, type Vector3Like } from '../resolve/resolveVector3'; +import type { Target } from '../resolve/Target'; +import type { TargetSlot } from '../resolve/TargetRegistry'; + +export type OrbitFollowThreeOptions = Omit & { + /** Center of the orbit relative to the target, rotated according to `bindingMode`. */ + targetOffset?: Vector3Like; +}; + +/** Orbits an `Object3D`, ref or fixed point, driven by `horizontal`, `vertical` and `radial`. */ +export class OrbitFollowBodyThree extends OrbitFollowBody { + targetSlot: TargetSlot | null = null; + private readonly pose = targetPose.create(); + + constructor(target: Target, { targetOffset, ...options }: OrbitFollowThreeOptions = {}) { + super(target, { ...options, targetOffset: optionalVec3(targetOffset) }); + } + + protected override readTarget(): TargetPose | null { + const withRotation = orbitFollow.needsTargetRotation(this.state, this); + return readTargetPose(this.pose, this.target, this.targetSlot, withRotation) ? this.pose : null; + } +} diff --git a/src/three/body/OrbitFollowHelperThree.ts b/src/three/body/OrbitFollowHelperThree.ts new file mode 100644 index 0000000..30926cc --- /dev/null +++ b/src/three/body/OrbitFollowHelperThree.ts @@ -0,0 +1,80 @@ +import type { Vec3 } from 'math'; +import { BufferAttribute, BufferGeometry, Color, LineBasicMaterial, LineSegments } from 'three'; + +import * as orbitFollow from '../../core/body/orbitFollow'; +import type { OrbitFollowBody } from '../../core/body/OrbitFollowBody'; + +const circleSegments = 64; +const arcSegments = 32; +const maxVertices = (circleSegments * 4 + arcSegments) * 2; +const defaultRange: [number, number] = [-90, 90]; + +const previous: Vec3 = [0, 0, 0]; +const next: Vec3 = [0, 0, 0]; + +/** + * Draws an `OrbitFollowBody`'s orbit around its tracked point: the circle the camera moves along with `horizontal`, + * the arc it moves along with `vertical`, and for `threeRing` also the three rings. + */ +export class OrbitFollowHelperThree extends LineSegments { + readonly colors = { horizontal: new Color('#ff9f1c'), vertical: new Color('#2ec4f1'), rings: new Color('#9a9aa8') }; + private readonly positions = new Float32Array(maxVertices * 3); + private readonly vertexColors = new Float32Array(maxVertices * 3); + private vertexCount = 0; + + constructor() { + super(new BufferGeometry(), new LineBasicMaterial({ vertexColors: true, toneMapped: false })); + this.geometry.setAttribute('position', new BufferAttribute(this.positions, 3)); + this.geometry.setAttribute('color', new BufferAttribute(this.vertexColors, 3)); + this.frustumCulled = false; + } + + /** Redraws the orbit from `body`'s last update. */ + sync(body: OrbitFollowBody): void { + const { horizontal, vertical } = body.state; + const [min, max] = vertical.range ?? defaultRange; + this.vertexCount = 0; + + if (body.orbitStyle === 'threeRing') { + this.circle(body, min, this.colors.rings); + this.circle(body, (min + max) / 2, this.colors.rings); + this.circle(body, max, this.colors.rings); + } + this.circle(body, vertical.value, this.colors.horizontal); + orbitFollow.point(previous, body.state, body, horizontal.value, min); + for (let i = 1; i <= arcSegments; i++) { + orbitFollow.point(next, body.state, body, horizontal.value, min + ((max - min) * i) / arcSegments); + this.segment(this.colors.vertical); + } + + this.geometry.getAttribute('position').needsUpdate = true; + this.geometry.getAttribute('color').needsUpdate = true; + this.geometry.setDrawRange(0, this.vertexCount); + } + + dispose(): void { + this.geometry.dispose(); + this.material.dispose(); + } + + private circle(body: OrbitFollowBody, vertical: number, color: Color): void { + orbitFollow.point(previous, body.state, body, 0, vertical); + for (let i = 1; i <= circleSegments; i++) { + orbitFollow.point(next, body.state, body, (360 * i) / circleSegments, vertical); + this.segment(color); + } + } + + /** Adds the segment from `previous` to `next`, then moves `previous` to `next`. */ + private segment(color: Color): void { + const offset = this.vertexCount * 3; + this.positions.set(previous, offset); + this.positions.set(next, offset + 3); + color.toArray(this.vertexColors, offset); + color.toArray(this.vertexColors, offset + 3); + this.vertexCount += 2; + previous[0] = next[0]; + previous[1] = next[1]; + previous[2] = next[2]; + } +} diff --git a/src/three/index.ts b/src/three/index.ts index 62884ed..d147850 100644 --- a/src/three/index.ts +++ b/src/three/index.ts @@ -25,6 +25,8 @@ export { Vector3Damper } from './damping/Vector3Damper'; export { FollowBodyThree, type FollowThreeOptions } from './body/FollowBodyThree'; export { HardLockToTargetBodyThree, type HardLockToTargetOptions } from './body/HardLockToTargetBodyThree'; +export { OrbitFollowBodyThree, type OrbitFollowThreeOptions } from './body/OrbitFollowBodyThree'; +export { OrbitFollowHelperThree } from './body/OrbitFollowHelperThree'; export { PositionComposerBodyThree, type PositionComposerThreeOptions } from './body/PositionComposerBodyThree'; export { HardLookAtAimThree } from './aim/HardLookAtAimThree'; diff --git a/test/core/CameraState.test.ts b/test/core/CameraState.test.ts index 07519a4..e788e1d 100644 --- a/test/core/CameraState.test.ts +++ b/test/core/CameraState.test.ts @@ -18,6 +18,7 @@ describe('cameraState.copy', () => { lookAtTarget: [7, 8, 9], hasLookAtTarget: true, referenceUp: vec3.normalize(vec3.create(), [0.1, 0.9, 0.2]), + rotationDampingBypass: quat.normalize(quat.create(), [0, 0.3, 0, 0.9]), }; const out = cameraState.create(); const outPosition = out.position; @@ -39,6 +40,7 @@ describe('cameraState.copy', () => { expect(vec3.exactEquals(out.lookAtTarget, source.lookAtTarget)).toBe(true); expect(out.hasLookAtTarget).toBe(true); expect(vec3.exactEquals(out.referenceUp, source.referenceUp)).toBe(true); + expect(vec4.exactEquals(out.rotationDampingBypass, source.rotationDampingBypass)).toBe(true); }); it('stays unchanged after the source is mutated — the actual "freeze" guarantee', () => { @@ -54,6 +56,7 @@ describe('cameraState.copy', () => { lookAtTarget: [7, 8, 9], hasLookAtTarget: true, referenceUp: [0, 1, 0], + rotationDampingBypass: [0, 0, 0, 1], }; const out = cameraState.create(); cameraState.copy(out, source); diff --git a/test/core/aim/lookRotation.test.ts b/test/core/aim/lookRotation.test.ts new file mode 100644 index 0000000..c78afd6 --- /dev/null +++ b/test/core/aim/lookRotation.test.ts @@ -0,0 +1,31 @@ +import { quat, vec3, type Quat, type Vec3 } from 'math'; +import { describe, expect, it } from 'vitest'; + +import { lookRotation } from '../../../src/core/aim/lookRotation'; + +import { forwardDot } from '../mathHelpers'; + +const up: Vec3 = [0, 1, 0]; +const screenUp = (rotation: Quat) => vec3.transformQuat(vec3.create(), up, rotation); + +describe('lookRotation', () => { + it('looks straight down with a unit rotation, keeping the previous screen top', () => { + const position: Vec3 = [0, 10, 0]; + const target: Vec3 = [0, 0, 0]; + const nearPole = lookRotation(quat.create(), [0, 10, 0.01], target, up, quat.create()); + const atPole = lookRotation(quat.create(), position, target, up, nearPole); + + expect(quat.length(atPole)).toBeCloseTo(1, 9); + expect(forwardDot(atPole, position, target)).toBeCloseTo(1, 9); + expect(vec3.dot(screenUp(atPole), screenUp(nearPole))).toBeGreaterThan(0.999); + }); + + it('falls back to the previous forward when the previous top is parallel too', () => { + const position: Vec3 = [0, 10, 0]; + const atPole = lookRotation(quat.create(), position, [0, 0, 0], up, quat.create()); + + expect(quat.length(atPole)).toBeCloseTo(1, 9); + expect(forwardDot(atPole, position, [0, 0, 0])).toBeCloseTo(1, 9); + expect(vec3.dot(screenUp(atPole), [0, 0, -1])).toBeCloseTo(1, 9); + }); +}); diff --git a/test/core/blend/lerpCameraState.test.ts b/test/core/blend/lerpCameraState.test.ts index 1d580e2..2b41492 100644 --- a/test/core/blend/lerpCameraState.test.ts +++ b/test/core/blend/lerpCameraState.test.ts @@ -20,6 +20,7 @@ function makeState(overrides: Partial = {}): CameraState { lookAtTarget: [0, 0, 0], hasLookAtTarget: false, referenceUp: [0, 1, 0], + rotationDampingBypass: [0, 0, 0, 1], ...overrides, }; } diff --git a/test/core/body/OrbitFollowBody.test.ts b/test/core/body/OrbitFollowBody.test.ts new file mode 100644 index 0000000..2241b61 --- /dev/null +++ b/test/core/body/OrbitFollowBody.test.ts @@ -0,0 +1,47 @@ +import { quat, vec3, type Vec3 } from 'math'; +import { describe, expect, it } from 'vitest'; + +import * as cameraState from '../../../src/core/CameraState'; +import * as targetPose from '../../../src/core/TargetPose'; +import { BindingModes } from '../../../src/core/body/BindingModes'; +import { OrbitFollowBody } from '../../../src/core/body/OrbitFollowBody'; +import { VirtualCamera } from '../../../src/core/VirtualCamera'; + +import { yaw } from '../mathHelpers'; + +const expectVec3 = (actual: Vec3, expected: Vec3) => { + for (let i = 0; i < 3; i++) expect(actual[i]).toBeCloseTo(expected[i], 9); +}; + +describe('OrbitFollowBody', () => { + it('exposes its axes to the camera it is set on', () => { + const body = new OrbitFollowBody(targetPose.create()); + const camera = new VirtualCamera('orbit'); + camera.setBody(body); + expect(camera.inputAxes.horizontal).toBe(body.horizontal); + expect(camera.inputAxes.vertical).toBe(body.vertical); + expect(camera.inputAxes.radial).toBe(body.radial); + }); + + it('captures the target rotation for lockToTargetOnAssign on a new target and on activation', () => { + const first = targetPose.create(); + first.hasRotation = true; + const body = new OrbitFollowBody(first, { bindingMode: BindingModes.lockToTargetOnAssign }); + const out = cameraState.create(); + body.update(out, 0.016, false); + expectVec3(out.position, [0, 0, 10]); + + const second = targetPose.create(); + second.hasRotation = true; + quat.copy(second.rotation, yaw(90)); + body.target = second; + body.update(out, 0.016, false); + expectVec3(out.position, vec3.transformQuat(vec3.create(), [0, 0, 10], yaw(90))); + + quat.identity(second.rotation); + body.update(out, 0.016, false); + expectVec3(out.position, vec3.transformQuat(vec3.create(), [0, 0, 10], yaw(90))); + body.update(out, 0.016, true); + expectVec3(out.position, [0, 0, 10]); + }); +}); diff --git a/test/core/body/orbitFollow.test.ts b/test/core/body/orbitFollow.test.ts new file mode 100644 index 0000000..890fbae --- /dev/null +++ b/test/core/body/orbitFollow.test.ts @@ -0,0 +1,396 @@ +import { quat, vec3, type Vec3 } from 'math'; +import { describe, expect, it } from 'vitest'; + +import * as hardLookAt from '../../../src/core/aim/hardLookAt'; +import * as panTilt from '../../../src/core/aim/panTilt'; +import * as rotationComposer from '../../../src/core/aim/rotationComposer'; +import * as orbitFollow from '../../../src/core/body/orbitFollow'; +import * as cameraState from '../../../src/core/CameraState'; +import * as targetPose from '../../../src/core/TargetPose'; +import { BindingModes } from '../../../src/core/body/BindingModes'; + +import { angleBetween, forwardDot, yaw } from '../mathHelpers'; + +function setup() { + const state = orbitFollow.createState(); + const params = orbitFollow.createParams(); + const target = targetPose.create(); + const out = cameraState.create(); + const step = (dt = 0.016) => orbitFollow.update(out, state, params, target, dt, false); + return { state, params, target, out, step }; +} + +function place(horizontal: number, vertical: number, radial = 0) { + const scene = setup(); + scene.state.horizontal.setValue(horizontal); + scene.state.vertical.setValue(vertical); + scene.state.radial.setValue(radial); + scene.step(); + return scene; +} + +const expectVec3 = (actual: Vec3, expected: Vec3) => { + for (let i = 0; i < 3; i++) expect(actual[i]).toBeCloseTo(expected[i], 9); +}; + +describe('orbitFollow.update', () => { + it('places the camera on a sphere of `radius` around the target', () => { + expectVec3(place(0, 0).out.position, [0, 0, 10]); + expectVec3(place(90, 0).out.position, [-10, 0, 0]); + expectVec3(place(0, 30).out.position, [0, 5, 10 * Math.cos(Math.PI / 6)]); + }); + + it('turns the view the same way as PanTilt for the same axis values', () => { + for (const [horizontal, vertical] of [ + [40, 20], + [-120, -5], + [170, 44], + ]) { + const { out } = place(horizontal, vertical); + const aim = panTilt.createState(); + aim.pan.setValue(horizontal); + aim.tilt.setValue(vertical); + const view = cameraState.create(); + panTilt.update(view, aim, null, 0.016); + expect(forwardDot(view.quaternion, out.position, [0, 0, 0])).toBeCloseTo(1, 9); + } + }); + + it('keeps turning the view with horizontal at the poles', () => { + for (const vertical of [90, -90]) { + const views = [0, 90].map((horizontal) => { + const { out } = place(horizontal, vertical); + hardLookAt.update(out, [0, 0, 0]); + expect(forwardDot(out.quaternion, out.position, [0, 0, 0])).toBeCloseTo(1, 6); + return out.quaternion; + }); + expect(angleBetween(views[0], views[1])).toBeCloseTo(Math.PI / 2, 3); + } + }); + + it('scales the radius by exp(radial)', () => { + expectVec3(place(0, 0, Math.log(2)).out.position, [0, 0, 20]); + expectVec3(place(0, 0, Math.log(0.5)).out.position, [0, 0, 5]); + }); + + it('writes the tracked point as the body target', () => { + const { target, out, step } = setup(); + vec3.set(target.position, 1, 2, 3); + step(); + expectVec3(out.target, [1, 2, 3]); + expect(out.hasTarget).toBe(true); + }); + + it('measures the orbit and the target offset in the binding frame', () => { + const { params, target, out, step } = setup(); + params.bindingMode = BindingModes.lockToTarget; + params.targetOffset = [0, 1, 0]; + target.hasRotation = true; + quat.setAxisAngle(target.rotation, [0, 0, 1], Math.PI / 2); + step(); + + expectVec3(out.target, [-1, 0, 0]); + expectVec3(out.position, [-1, 0, 10]); + expectVec3(out.referenceUp, [-1, 0, 0]); + + params.bindingMode = BindingModes.worldSpace; + quat.copy(target.rotation, yaw(90)); + step(); + expectVec3(out.target, [0, 1, 0]); + expectVec3(out.position, [0, 1, 10]); + }); + + it('eases a change of radius with radial.damping, and snaps without it', () => { + const { state, params, out, step } = setup(); + state.radial.damping = 0.3; + step(); + expectVec3(out.position, [0, 0, 10]); + + params.radius = 20; + expect(step()).toBe(true); + expect(out.position[2]).toBeGreaterThan(10); + expect(out.position[2]).toBeLessThan(20); + for (let i = 0; i < 300; i++) step(); + expectVec3(out.position, [0, 0, 20]); + expect(step()).toBe(false); + + state.radial.damping = 0; + params.radius = 5; + step(); + expectVec3(out.position, [0, 0, 5]); + }); + + it('primes the axes from a position, on the same ray at the current radius', () => { + const { state, target, out, step } = setup(); + vec3.set(target.position, 1, 0, 0); + orbitFollow.prime(state, [1 - 3, 3, 0]); + step(); + expect(state.horizontal.value).toBeCloseTo(90, 9); + expect(state.vertical.value).toBeCloseTo(45, 9); + const r = 10 / Math.SQRT2; + expectVec3(out.position, [1 - r, r, 0]); + }); + + it('primes relative to the binding frame and the target offset', () => { + const { state, params, target, out, step } = setup(); + params.bindingMode = BindingModes.lockToTarget; + params.targetOffset = [0, 1, 0]; + target.hasRotation = true; + quat.copy(target.rotation, yaw(90)); + orbitFollow.prime(state, [5, 1, 0]); + step(); + expect(state.horizontal.value).toBeCloseTo(0, 9); + expect(state.vertical.value).toBeCloseTo(0, 9); + expectVec3(out.position, [10, 1, 0]); + }); + + it('waits with priming until there is a target', () => { + const { state, params, target, out, step } = setup(); + orbitFollow.prime(state, [0, 0, -5]); + orbitFollow.update(out, state, params, null, 0.016, false); + expect(state.horizontal.value).toBe(0); + vec3.set(target.position, 0, 0, 0); + step(); + expect(Math.abs(state.horizontal.value)).toBeCloseTo(180, 9); + }); + + it('restarts the wait for recentering on activation', () => { + const { state, params, target, out } = setup(); + state.horizontal.recentering = { enabled: true, wait: 0.5, time: 0.2 }; + state.horizontal.setValue(30); + state.horizontal.idleTime = 10; + orbitFollow.update(out, state, params, target, 0.016, true); + expect(state.horizontal.value).toBe(30); + }); + + it('leaves `out` as is without a target', () => { + const { state, params, out } = setup(); + vec3.set(out.position, 7, 7, 7); + orbitFollow.update(out, state, params, null, 0.016, false); + expectVec3(out.position, [7, 7, 7]); + expect(out.hasTarget).toBe(false); + }); + + it('reports motion while an axis eases or waits to recenter', () => { + const { state, step } = setup(); + expect(step()).toBe(false); + + state.horizontal.damping = 0.2; + state.horizontal.recentering = { enabled: true, wait: 2, time: 0.2 }; + state.horizontal.applyDelta(30); + expect(step()).toBe(true); + for (let i = 0; i < 60; i++) step(); + expect(state.horizontal.value).toBeGreaterThan(29); + expect(step()).toBe(true); + for (let i = 0; i < 400; i++) step(); + expect(state.horizontal.value).toBe(0); + expect(step()).toBe(false); + }); +}); + +describe('orbitFollow recentering', () => { + function recentering(times: { horizontal: number; vertical: number }) { + const scene = setup(); + const { state } = scene; + state.horizontal.recentering = { enabled: true, wait: 0.5, time: times.horizontal }; + state.vertical.recentering = { enabled: true, wait: 0.5, time: times.vertical }; + state.vertical.setValue(40); + return scene; + } + + it('holds every axis with the same time while one of them gets input, then recenters them together', () => { + const { state, step } = recentering({ horizontal: 0.3, vertical: 0.3 }); + for (let i = 0; i < 120; i++) { + state.horizontal.applyDelta(0.1); + step(); + } + expect(state.vertical.value).toBe(40); + + for (let i = 0; i < 600; i++) step(); + expect(state.vertical.value).toBeCloseTo(0, 6); + expect(state.horizontal.value).toBeCloseTo(0, 6); + }); + + it('recenters an axis with another time while the other gets input', () => { + const { state, step } = recentering({ horizontal: 0.3, vertical: 0.4 }); + for (let i = 0; i < 300; i++) { + state.horizontal.applyDelta(0.1); + step(); + } + expect(state.vertical.value).toBeCloseTo(0, 6); + }); + + it("recenters horizontal behind the target's forward with trackingTarget", () => { + const { state, target, out, step } = recentering({ horizontal: 0.2, vertical: 0.2 }); + state.vertical.recentering = { enabled: false, wait: 0.5, time: 0.2 }; + state.vertical.setValue(0); + target.hasRotation = true; + quat.copy(target.rotation, yaw(90)); + for (let i = 0; i < 600; i++) step(); + expect(state.horizontal.value).toBeCloseTo(-90, 6); + expectVec3(out.position, [10, 0, 0]); + }); + + it('recenters to the axis center with axisCenter', () => { + const { state, params, target, step } = recentering({ horizontal: 0.2, vertical: 0.2 }); + params.recenteringTarget = 'axisCenter'; + target.hasRotation = true; + quat.copy(target.rotation, yaw(90)); + state.horizontal.setValue(50); + for (let i = 0; i < 600; i++) step(); + expect(state.horizontal.value).toBeCloseTo(0, 6); + }); + + it('reads the target rotation for trackingTarget only while horizontal recenters', () => { + const { state, params } = setup(); + expect(orbitFollow.needsTargetRotation(state, params)).toBe(false); + state.horizontal.recentering = { enabled: true, wait: 1, time: 1 }; + expect(orbitFollow.needsTargetRotation(state, params)).toBe(true); + params.recenteringTarget = 'axisCenter'; + expect(orbitFollow.needsTargetRotation(state, params)).toBe(false); + }); +}); + +describe('orbitFollow rotation damping bypass', () => { + function orbitWithComposer() { + const scene = setup(); + const composerState = rotationComposer.createState(); + const composerParams = rotationComposer.createParams({ damping: 0.5 }); + const frame = (justActivated = false) => { + orbitFollow.update(scene.out, scene.state, scene.params, scene.target, 0.016, justActivated); + rotationComposer.update(scene.out, composerState, composerParams, scene.target, 0.016, justActivated); + }; + return { ...scene, frame }; + } + + it('keeps the target centered for a damped Aim while the orbit turns', () => { + const { state, out, frame } = orbitWithComposer(); + frame(true); + for (let i = 0; i < 60; i++) { + state.horizontal.applyDelta(3); + state.vertical.applyDelta(0.5); + frame(); + expect(forwardDot(out.quaternion, out.position, [0, 0, 0])).toBeCloseTo(1, 9); + } + }); + + it('is the turn of the orbit between frames, and identity on activation and without a target', () => { + const { state, params, out, step } = setup(); + orbitFollow.update(out, state, orbitFollow.createParams(), targetPose.create(), 0.016, true); + expect(out.rotationDampingBypass).toEqual([0, 0, 0, 1]); + + state.horizontal.applyDelta(30); + step(); + expect(angleBetween(out.rotationDampingBypass, yaw(-30))).toBeCloseTo(0, 9); + + orbitFollow.update(out, state, params, null, 0.016, false); + expect(out.rotationDampingBypass).toEqual([0, 0, 0, 1]); + }); +}); + +describe('orbitFollow threeRing', () => { + function rings(horizontal: number, vertical: number, radial = 0) { + const scene = setup(); + scene.params.orbitStyle = 'threeRing'; + scene.state.horizontal.setValue(horizontal); + scene.state.vertical.setValue(vertical); + scene.state.radial.setValue(radial); + scene.step(); + return scene; + } + + it("runs from the bottom ring at vertical's minimum to the top ring at its maximum", () => { + expectVec3(rings(0, -90).out.position, [0, -10, 10]); + expectVec3(rings(0, 0).out.position, [0, 0, 10]); + expectVec3(rings(0, 90).out.position, [0, 10, 10]); + }); + + it('is a plain cylinder of the default radius by default, starting where the sphere starts', () => { + for (const vertical of [-60, -20, 30, 75]) { + const { position } = rings(0, vertical).out; + expect(Math.hypot(position[0], position[2])).toBeCloseTo(10, 9); + } + expectVec3(rings(0, 0).out.position, place(0, 0).out.position); + }); + + it('turns around the target with horizontal, the same way as the sphere', () => { + expectVec3(rings(90, 0).out.position, [-10, 0, 0]); + }); + + it('scales the whole surface by exp(radial)', () => { + expectVec3(rings(0, 90, Math.log(2)).out.position, [0, 20, 20]); + }); + + it('primes both axes from a position on the surface', () => { + const { out } = rings(30, 45); + const position = vec3.clone(out.position); + + const { state, params, step } = setup(); + params.orbitStyle = 'threeRing'; + orbitFollow.prime(state, position); + step(); + expect(state.horizontal.value).toBeCloseTo(30, 6); + expect(state.vertical.value).toBeCloseTo(45, 4); + }); +}); + +describe('orbitFollow.point', () => { + it('is where the camera is for the current axis values, for both styles', () => { + for (const orbitStyle of ['sphere', 'threeRing'] as const) { + const { state, params, target, out, step } = setup(); + params.orbitStyle = orbitStyle; + params.bindingMode = BindingModes.lockToTarget; + params.damping = 0.5; + target.hasRotation = true; + quat.copy(target.rotation, yaw(40)); + step(); + vec3.set(target.position, 3, 1, -2); + state.horizontal.applyDelta(25); + state.vertical.applyDelta(30); + step(); + const position = orbitFollow.point(vec3.create(), state, params, state.horizontal.value, state.vertical.value); + expectVec3(position, out.position); + } + }); +}); + +describe('orbitFollow.setFromPosition and setFromRotation', () => { + const settle = (step: () => unknown) => { + for (let i = 0; i < 600; i++) step(); + }; + + it("eases the camera toward a position's direction, keeping the zoom", () => { + const { state, params, target, out, step } = setup(); + state.horizontal.damping = 0.3; + state.radial.setValue(Math.log(2)); + step(); + orbitFollow.setFromPosition(state, params, target, [-3, 3, 0]); + step(); + expect(state.horizontal.value).toBeGreaterThan(0); + expect(state.horizontal.value).toBeLessThan(90); + + settle(step); + expect(state.horizontal.value).toBeCloseTo(90, 6); + expect(state.vertical.value).toBeCloseTo(45, 6); + expect(vec3.length(out.position)).toBeCloseTo(20, 6); + }); + + it('takes the short way around', () => { + const { state, params, target, step } = setup(); + state.horizontal.setValue(170); + // horizontal -170 puts the camera along yaw(170), so the shortest way from 170 is +20. + orbitFollow.setFromPosition(state, params, target, vec3.transformQuat(vec3.create(), [0, 0, 10], yaw(170))); + step(); + expect(state.horizontal.rawValue).toBeCloseTo(190, 6); + }); + + it("puts the camera opposite the rotation's forward", () => { + const { state, params, target, out, step } = setup(); + const lookDown = quat.setAxisAngle(quat.create(), [1, 0, 0], -Math.PI / 6); + orbitFollow.setFromRotation(state, params, target, quat.multiply(quat.create(), yaw(90), lookDown)); + settle(step); + expect(state.horizontal.value).toBeCloseTo(-90, 6); + expect(state.vertical.value).toBeCloseTo(30, 6); + expect(out.position[0]).toBeGreaterThan(0); + }); +}); diff --git a/test/core/body/threeRing.test.ts b/test/core/body/threeRing.test.ts new file mode 100644 index 0000000..a570c85 --- /dev/null +++ b/test/core/body/threeRing.test.ts @@ -0,0 +1,70 @@ +import { vec3, type Vec3 } from 'math'; +import { describe, expect, it } from 'vitest'; + +import * as threeRing from '../../../src/core/body/threeRing'; +import type { Orbits } from '../../../src/core/body/threeRing'; + +const rings = (): Orbits => ({ + top: { height: 5, radius: 2 }, + center: { height: 2.25, radius: 4 }, + bottom: { height: 0.1, radius: 2.5 }, +}); + +const at = (state: threeRing.ThreeRingState, settings: Orbits, t: number, curvature = 0.5): Vec3 => + threeRing.point(vec3.create(), state, settings, curvature, t); + +const expectVec3 = (actual: Vec3, expected: Vec3) => { + for (let i = 0; i < 3; i++) expect(actual[i]).toBeCloseTo(expected[i], 9); +}; + +describe('threeRing.point', () => { + it('passes through the bottom, center and top ring', () => { + const state = threeRing.createState(); + const settings = rings(); + expectVec3(at(state, settings, 0), [0, 0.1, 2.5]); + expectVec3(at(state, settings, 0.5), [0, 2.25, 4]); + expectVec3(at(state, settings, 1), [0, 5, 2]); + }); + + it('clamps t to the outer rings', () => { + const state = threeRing.createState(); + const settings = rings(); + expectVec3(at(state, settings, -1), [0, 0.1, 2.5]); + expectVec3(at(state, settings, 2), [0, 5, 2]); + }); + + it('turns smoothly through the center ring', () => { + const state = threeRing.createState(); + const settings = rings(); + const h = 1e-6; + const before = vec3.subtract(vec3.create(), at(state, settings, 0.5), at(state, settings, 0.5 - h)); + const after = vec3.subtract(vec3.create(), at(state, settings, 0.5 + h), at(state, settings, 0.5)); + expect(after[1] / h).toBeCloseTo(before[1] / h, 3); + expect(after[2] / h).toBeCloseTo(before[2] / h, 3); + }); + + it('bends between the rings with the curvature, keeping the rings in place', () => { + const state = threeRing.createState(); + const settings = rings(); + const loose = at(state, settings, 0.25, 0); + const taut = at(state, settings, 0.25, 1); + expect(vec3.distance(loose, taut)).toBeGreaterThan(1e-3); + expectVec3(at(state, settings, 0, 1), [0, 0.1, 2.5]); + expectVec3(at(state, settings, 0.5, 0), [0, 2.25, 4]); + }); + + it('limits the curvature to 0..1', () => { + const state = threeRing.createState(); + const settings = rings(); + expectVec3(at(state, settings, 0.25, 3), at(threeRing.createState(), settings, 0.25, 1)); + expectVec3(at(state, settings, 0.25, -2), at(threeRing.createState(), settings, 0.25, 0)); + }); + + it('rebuilds after the rings change', () => { + const state = threeRing.createState(); + const settings = rings(); + at(state, settings, 1); + settings.top.height = 8; + expectVec3(at(state, settings, 1), [0, 8, 2]); + }); +}); diff --git a/test/core/body/tracker.test.ts b/test/core/body/tracker.test.ts new file mode 100644 index 0000000..031a194 --- /dev/null +++ b/test/core/body/tracker.test.ts @@ -0,0 +1,138 @@ +import { quat, vec3, type Vec3 } from 'math'; +import { describe, expect, it } from 'vitest'; + +import * as tracker from '../../../src/core/body/tracker'; +import * as targetPose from '../../../src/core/TargetPose'; +import { BindingModes } from '../../../src/core/body/BindingModes'; + +import { yaw } from '../mathHelpers'; + +function setup(damping = 0) { + const state = tracker.createState(); + const params: tracker.TrackerParams = { + bindingMode: BindingModes.worldSpace, + damping, + rotationDamping: 0, + maxSpeed: Infinity, + }; + const target = targetPose.create(); + const point: Vec3 = [0, 0, 0]; + const orientation = quat.create(); + const track = (offset: Vec3, dt = 0.016, targetOffset: Vec3 = [0, 0, 0]) => + tracker.trackTarget(point, orientation, state, params, target, offset, targetOffset, dt); + return { state, params, target, point, orientation, track }; +} + +const expectVec3 = (actual: Vec3, expected: Vec3) => { + for (let i = 0; i < 3; i++) expect(actual[i]).toBeCloseTo(expected[i], 9); +}; + +describe('tracker.trackTarget', () => { + it('tracks the target position exactly without damping', () => { + const { target, point, track } = setup(); + vec3.set(target.position, 1, 2, 3); + track([0, 0, 10]); + expectVec3(point, [1, 2, 3]); + + vec3.set(target.position, -4, 0, 5); + track([0, 0, 10]); + expectVec3(point, [-4, 0, 5]); + }); + + it('snaps on the first call, then chases a moving target with damping', () => { + const { target, point, track } = setup(0.5); + vec3.set(target.position, 1, 0, 0); + track([0, 0, 10]); + expectVec3(point, [1, 0, 0]); + + vec3.set(target.position, 5, 0, 0); + track([0, 0, 10]); + expect(point[0]).toBeGreaterThan(1); + expect(point[0]).toBeLessThan(5); + + for (let i = 0; i < 600; i++) track([0, 0, 10]); + expectVec3(point, [5, 0, 0]); + }); + + it('turns the lagging point with the offset instead of damping the turn', () => { + const { target, point, track } = setup(1); + track([0, 0, 10]); + vec3.set(target.position, 4, 0, 0); + track([0, 0, 10]); + const lag = vec3.subtract(vec3.create(), point, target.position); + + const turn = yaw(90); + const offset = vec3.transformQuat(vec3.create(), [0, 0, 10], turn); + track(offset, 0); + expectVec3(vec3.subtract(vec3.create(), point, target.position), vec3.transformQuat(vec3.create(), lag, turn)); + }); + + it('turns the lagging point with a change of pitch', () => { + const { target, point, track } = setup(1); + track([0, 0, 10]); + vec3.set(target.position, 0, 0, 4); + track([0, 0, 10]); + const lag = vec3.subtract(vec3.create(), point, target.position); + + const pitch = quat.setAxisAngle(quat.create(), [1, 0, 0], -Math.PI / 6); + track(vec3.transformQuat(vec3.create(), [0, 0, 10], pitch), 0); + expectVec3(vec3.subtract(vec3.create(), point, target.position), vec3.transformQuat(vec3.create(), lag, pitch)); + }); + + it('keeps the camera on the orbit while the offset turns around a resting target', () => { + const { point, track } = setup(1); + track([0, 0, 10]); + for (let degrees = 5; degrees <= 180; degrees += 5) { + const offset = vec3.transformQuat(vec3.create(), [0, 0, 10], yaw(degrees)); + track(offset); + expectVec3(point, [0, 0, 0]); + } + }); + + it('places the target offset in the reference orientation', () => { + const { params, target, point, orientation, track } = setup(); + params.bindingMode = BindingModes.lockToTarget; + target.hasRotation = true; + quat.copy(target.rotation, yaw(90)); + track([0, 0, 10], 0.016, [1, 0, 0]); + expectVec3(point, [0, 0, -1]); + expect(quat.equals(orientation, target.rotation)).toBe(true); + + params.bindingMode = BindingModes.worldSpace; + track([0, 0, 10], 0.016, [1, 0, 0]); + expectVec3(point, [1, 0, 0]); + }); + + it('eases the reference orientation with rotationDamping', () => { + const { params, target, orientation, track } = setup(); + params.bindingMode = BindingModes.lockToTarget; + params.rotationDamping = 0.5; + target.hasRotation = true; + track([0, 0, 10]); + quat.copy(target.rotation, yaw(90)); + track([0, 0, 10]); + const turned = 2 * Math.acos(Math.min(1, Math.abs(quat.dot(orientation, quat.create())))); + expect(turned).toBeGreaterThan(0); + expect(turned).toBeLessThan(Math.PI / 2); + + for (let i = 0; i < 600; i++) track([0, 0, 10]); + expect(Math.abs(quat.dot(orientation, target.rotation))).toBeCloseTo(1, 9); + }); + + it('eases from a primed point instead of snapping', () => { + const { state, point, track } = setup(0.5); + tracker.prime(state, [-20, 0, 0], [0, 0, 10], quat.create()); + track([0, 0, 10]); + expect(point[0]).toBeGreaterThan(-20); + expect(point[0]).toBeLessThan(0); + }); + + it('snaps again after a reset', () => { + const { state, target, point, track } = setup(1); + track([0, 0, 10]); + vec3.set(target.position, 10, 0, 0); + tracker.reset(state); + track([0, 0, 10]); + expectVec3(point, [10, 0, 0]); + }); +}); diff --git a/test/golden/fixtures/body.follow.asymmetricDamping.maxSpeed.json b/test/golden/fixtures/body.follow.asymmetricDamping.maxSpeed.json index 15336e1..07b79cd 100644 --- a/test/golden/fixtures/body.follow.asymmetricDamping.maxSpeed.json +++ b/test/golden/fixtures/body.follow.asymmetricDamping.maxSpeed.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[1.72524176696,3.2139548082,16.2379299359,0,0,0,1,50,0.1,1000],[1.84651469253,3.22867461962,16.222463451,0,0,0,1,50,0.1,1000],[2.0736652254,3.2560143323,16.1895214905,0,0,0,1,50,0.1,1000],[2.68126713237,3.32761813357,16.0795894243,0,0,0,1,50,0.1,1000],[3.12382950908,3.37677164417,15.9795477719,0,0,0,1,50,0.1,1000],[4.02057490101,3.47304023261,15.7506279468,0,0,0,1,50,0.1,1000],[4.57161430403,3.53080075012,15.5858616744,0,0,0,1,50,0.1,1000],[5.5701989098,3.61845834888,15.2309431784,0,0,0,1,50,0.1,1000],[6.16182109271,3.66835172007,14.9898722806,0,0,0,1,50,0.1,1000],[7.14495969772,3.73175819018,14.5040507619,0,0,0,1,50,0.1,1000],[7.72480233029,3.76191498249,14.1963468661,0,0,0,1,50,0.1,1000],[8.63525454558,3.80026709883,13.592685718,0,0,0,1,50,0.1,1000],[9.19140890268,3.81859644109,13.2115208857,0,0,0,1,50,0.1,1000],[10.0726481566,3.84069012933,12.4794326107,0,0,0,1,50,0.1,1000],[10.6078533654,3.84857274699,12.0243277608,0,0,0,1,50,0.1,1000],[11.4433281743,3.83845433639,11.1688524597,0,0,0,1,50,0.1,1000],[11.9412977494,3.81965528316,10.6439476703,0,0,0,1,50,0.1,1000],[12.7029603963,3.77143661599,9.67379508473,0,0,0,1,50,0.1,1000],[13.1468830645,3.73575163775,9.08468313762,0,0,0,1,50,0.1,1000],[13.8098849939,3.65916559189,8.01089955318,0,0,0,1,50,0.1,1000],[14.1805897082,3.60977728905,7.36463971647,0,0,0,1,50,0.1,1000],[14.6944676148,3.51320425857,6.20120575582,0,0,0,1,50,0.1,1000],[14.9845657007,3.45317153573,5.50670204419,0,0,0,1,50,0.1,1000],[15.3499173414,3.34275493327,4.27097949478,0,0,0,1,50,0.1,1000],[15.5216522333,3.27673756171,3.53912855923,0,0,0,1,50,0.1,1000],[15.7371404552,3.1662269478,2.25181228487,0,0,0,1,50,0.1,1000],[15.8388303646,3.10101392444,1.49535831248,0,0,0,1,50,0.1,1000],[15.9607003326,2.99962032669,0.179956910724,0,0,0,1,50,0.1,1000],[15.9778772987,2.93890377078,-0.586907971784,0,0,0,1,50,0.1,1000],[15.9191785278,2.84608440724,-1.85238364779,0,0,0,1,50,0.1,1000],[15.8320390346,2.79332649757,-2.59892622356,0,0,0,1,50,0.1,1000],[15.5935730906,2.72023687906,-3.85063958974,0,0,0,1,50,0.1,1000],[15.3978861189,2.68165306814,-4.58809952766,0,0,0,1,50,0.1,1000],[14.9865464428,2.63423374795,-5.74106939809,0,0,0,1,50,0.1,1000],[14.7059159499,2.61216186907,-6.44203938535,0,0,0,1,50,0.1,1000],[14.1363308688,2.58559291006,-7.54867264119,0,0,0,1,50,0.1,1000],[13.7751975305,2.57419904313,-8.2188938017,0,0,0,1,50,0.1,1000],[13.0704559207,2.57380245137,-9.26382317966,0,0,0,1,50,0.1,1000],[12.9803115569,2.58593202425,-9.88657476679,0,0,0,1,50,0.1,1000],[13.4368256677,2.62308114594,-10.8408827009,0,0,0,1,50,0.1,1000],[13.872728743,2.65384934577,-11.3992117725,0,0,0,1,50,0.1,1000],[14.6586755989,2.71745020123,-12.2390431313,0,0,0,1,50,0.1,1000],[15.1328557486,2.75991819727,-12.7205794979,0,0,0,1,50,0.1,1000],[15.8108886358,2.8428474102,-13.4296664424,0,0,0,1,50,0.1,1000],[16.1505667527,2.89375001179,-13.8211382474,0,0,0,1,50,0.1,1000],[16.5502528943,2.9871942276,-14.3591695363,0,0,0,1,50,0.1,1000],[16.6054963825,3.04301557625,-14.6598201677,0,0,0,1,50,0.1,1000],[16.2318445623,3.13597388313,-15.0376874099,0,0,0,1,50,0.1,1000],[15.8278777951,3.19037584022,-15.2153384138,0,0,0,1,50,0.1,1000],[14.9656085583,3.27366164249,-15.4393420248,0,0,0,1,50,0.1,1000],[14.4188761918,3.32167373214,-15.5464924282,0,0,0,1,50,0.1,1000],[13.3910116336,3.38954254528,-15.6793037272,0,0,0,1,50,0.1,1000],[12.7698805438,3.42860239575,-15.7386177655,0,0,0,1,50,0.1,1000],[11.6698348554,3.47779191289,-15.7691399899,0,0,0,1,50,0.1,1000],[11.025519832,3.50069535677,-15.7290639833,0,0,0,1,50,0.1,1000],[9.96386624761,3.5286437625,-15.5754223534,0,0,0,1,50,0.1,1000],[9.33983258071,3.5410837621,-15.4390420018,0,0,0,1,50,0.1,1000],[8.35966248644,3.55048721645,-15.1428905332,0,0,0,1,50,0.1,1000],[7.75913190227,3.54507586865,-14.9380423387,0,0,0,1,50,0.1,1000],[6.8014485018,3.52001740013,-14.5172451295,0,0,0,1,50,0.1,1000],[6.40615928433,3.5053714607,-14.3379053805,0,0,0,1,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[1.72524176696,3.2139548082,16.2379299359,0,0,0,1,50,0.1,1000],[2.27887189761,3.25267544525,16.1441799483,0,0,0,1,50,0.1,1000],[2.70370125407,3.29006670862,16.0596395224,0,0,0,1,50,0.1,1000],[3.52280733404,3.37065141142,15.8673119496,0,0,0,1,50,0.1,1000],[4.06287967448,3.42344139835,15.7187768762,0,0,0,1,50,0.1,1000],[5.03361112959,3.5200673521,15.4090505527,0,0,0,1,50,0.1,1000],[5.6263501,3.57667438793,15.1898734733,0,0,0,1,50,0.1,1000],[6.63774681638,3.66241326878,14.7574184677,0,0,0,1,50,0.1,1000],[7.24198259586,3.71004401612,14.4638052976,0,0,0,1,50,0.1,1000],[8.24576262299,3.77344136095,13.9040629241,0,0,0,1,50,0.1,1000],[8.8355359666,3.80495161382,13.5355254796,0,0,0,1,50,0.1,1000],[9.79589011348,3.84475998748,12.849677343,0,0,0,1,50,0.1,1000],[10.3522958282,3.86117356717,12.4059835272,0,0,0,1,50,0.1,1000],[11.2452652003,3.86837886214,11.598151419,0,0,0,1,50,0.1,1000],[11.7557208395,3.8643402027,11.0825219179,0,0,0,1,50,0.1,1000],[12.5649292032,3.84143480365,10.1608504393,0,0,0,1,50,0.1,1000],[13.0218085503,3.81862523945,9.58015268348,0,0,0,1,50,0.1,1000],[13.7311434618,3.7654295221,8.55334677968,0,0,0,1,50,0.1,1000],[14.1188712366,3.72580276052,7.90954914285,0,0,0,1,50,0.1,1000],[14.7005460613,3.6432882274,6.78258171706,0,0,0,1,50,0.1,1000],[15.0086672053,3.58921343627,6.08428186476,0,0,0,1,50,0.1,1000],[15.4511130742,3.4861989497,4.87655383045,0,0,0,1,50,0.1,1000],[15.6737671363,3.4214910848,4.13615761441,0,0,0,1,50,0.1,1000],[15.9650993641,3.30460706987,2.86860060996,0,0,0,1,50,0.1,1000],[16.0951744663,3.23395437028,2.09887795857,0,0,0,1,50,0.1,1000],[16.2241697952,3.11994277745,0.794514643366,0,0,0,1,50,0.1,1000],[16.2556750305,3.05037386978,0.00974131593189,0,0,0,1,50,0.1,1000],[16.2181332207,2.93878366158,-1.30591371116,0,0,0,1,50,0.1,1000],[16.1495613664,2.87315908497,-2.09020971646,0,0,0,1,50,0.1,1000],[15.9435009786,2.77765561786,-3.39093193939,0,0,0,1,50,0.1,1000],[15.7745917739,2.72585147216,-4.15898180401,0,0,0,1,50,0.1,1000],[15.4054584222,2.64868839517,-5.41922462743,0,0,0,1,50,0.1,1000],[15.142039019,2.60636432501,-6.15642872089,0,0,0,1,50,0.1,1000],[14.6195864334,2.54705160205,-7.35269171157,0,0,0,1,50,0.1,1000],[14.2663602931,2.5228722362,-8.04496922945,0,0,0,1,50,0.1,1000],[13.5985897714,2.50246565053,-9.15408574923,0,0,0,1,50,0.1,1000],[13.1630248898,2.50123345744,-9.78890599369,0,0,0,1,50,0.1,1000],[12.381589933,2.51678062118,-10.7695018758,0,0,0,1,50,0.1,1000],[12.3250003292,2.47563884572,-11.1825340333,0,0,0,1,50,0.1,1000],[12.8061275639,2.41523134485,-11.7273604724,0,0,0,1,50,0.1,1000],[13.1743807108,2.40218563713,-12.0957240028,0,0,0,1,50,0.1,1000],[13.7632080098,2.411975561,-12.7264149519,0,0,0,1,50,0.1,1000],[14.0818194451,2.43369812298,-13.1179779383,0,0,0,1,50,0.1,1000],[14.4781581785,2.48933210057,-13.7414716363,0,0,0,1,50,0.1,1000],[14.6376631769,2.5338767513,-14.1055458972,0,0,0,1,50,0.1,1000],[14.7443673207,2.64734243035,-14.6480444297,0,0,0,1,50,0.1,1000],[14.7178606291,2.75153767285,-14.9427725378,0,0,0,1,50,0.1,1000],[14.529400976,2.94381874921,-15.3602363291,0,0,0,1,50,0.1,1000],[14.2654841845,3.05717681995,-15.6086805182,0,0,0,1,50,0.1,1000],[13.5940700582,3.24035361429,-15.9798118062,0,0,0,1,50,0.1,1000],[13.0736188484,3.32812635304,-16.1218591679,0,0,0,1,50,0.1,1000],[12.1028040011,3.43041778257,-16.2040983337,0,0,0,1,50,0.1,1000],[11.4928942476,3.47948440523,-16.1872111189,0,0,0,1,50,0.1,1000],[10.4357913032,3.53879422234,-16.0760969567,0,0,0,1,50,0.1,1000],[9.7962994883,3.56912330807,-15.9769297973,0,0,0,1,50,0.1,1000],[8.72069210343,3.59427823339,-15.7321687039,0,0,0,1,50,0.1,1000],[8.08186471127,3.60530743819,-15.5535288952,0,0,0,1,50,0.1,1000],[7.05145119174,3.60094737265,-15.1798287842,0,0,0,1,50,0.1,1000],[6.43945179954,3.59439624749,-14.9271650679,0,0,0,1,50,0.1,1000],[5.45067007869,3.56031394833,-14.4358658508,0,0,0,1,50,0.1,1000],[5.05379024347,3.54396311238,-14.2215510987,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.follow.lockToTarget.json b/test/golden/fixtures/body.follow.lockToTarget.json index 46e159a..34abe5b 100644 --- a/test/golden/fixtures/body.follow.lockToTarget.json +++ b/test/golden/fixtures/body.follow.lockToTarget.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,0,0,0,1,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,0,0,0,1,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,0,0,0,1,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,0,0,0,1,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,0,0,0,1,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,0,0,0,1,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,0,0,0,1,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,0,0,0,1,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,0,0,0,1,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,0,0,0,1,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,0,0,0,1,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,0,0,0,1,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,0,0,0,1,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,0,0,0,1,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,0,0,0,1,50,0.1,1000],[8.84259869379,3.64114351642,13.1180583299,0,0,0,1,50,0.1,1000],[9.3947965511,3.63767685629,12.7005727033,0,0,0,1,50,0.1,1000],[10.2631201754,3.62038439697,11.9642931392,0,0,0,1,50,0.1,1000],[10.7778221584,3.60281692785,11.4758694748,0,0,0,1,50,0.1,1000],[11.5738854441,3.56354638577,10.6273753576,0,0,0,1,50,0.1,1000],[12.037602117,3.53326941512,10.0720445667,0,0,0,1,50,0.1,1000],[12.7410006211,3.47524554438,9.11952253352,0,0,0,1,50,0.1,1000],[13.1419642456,3.43476971356,8.50333252542,0,0,0,1,50,0.1,1000],[13.734807458,3.36279962365,7.45826618617,0,0,0,1,50,0.1,1000],[14.0627164616,3.31546500876,6.78929885886,0,0,0,1,50,0.1,1000],[14.5295036028,3.23545815426,5.66644133913,0,0,0,1,50,0.1,1000],[14.7755892408,3.18513445318,4.95475003549,0,0,0,1,50,0.1,1000],[15.103490121,3.10361176577,3.77192660255,0,0,0,1,50,0.1,1000],[15.2607660663,3.05439437291,3.02934889011,0,0,0,1,50,0.1,1000],[15.4400988679,2.97799406264,1.80703531514,0,0,0,1,50,0.1,1000],[15.4700364844,2.93389990529,1.04686022749,0,0,0,1,50,0.1,1000],[15.4449307728,2.86888611336,-0.19247399314,0,0,0,1,50,0.1,1000],[15.4019781879,2.83355367827,-0.955976318948,0,0,0,1,50,0.1,1000],[15.2708151043,2.78533778752,-2.18872284558,0,0,0,1,50,0.1,1000],[15.1482106209,2.76173971649,-2.94087243828,0,0,0,1,50,0.1,1000],[14.8756183398,2.73443306761,-4.14325818429,0,0,0,1,50,0.1,1000],[14.6622945173,2.72461640146,-4.86957960264,0,0,0,1,50,0.1,1000],[14.2417143628,2.72064489493,-6.01865761095,0,0,0,1,50,0.1,1000],[14.1943797251,2.72552113541,-6.70547258939,0,0,0,1,50,0.1,1000],[14.9950931239,2.74534200032,-7.78002890721,0,0,0,1,50,0.1,1000],[15.7021006002,2.76455347907,-8.41497101822,0,0,0,1,50,0.1,1000],[16.8315892269,2.80651749345,-9.39627085046,0,0,0,1,50,0.1,1000],[17.4216599206,2.83840555649,-9.96868533944,0,0,0,1,50,0.1,1000],[18.1216126115,2.8988013766,-10.8410168825,0,0,0,1,50,0.1,1000],[18.3851902948,2.94049478982,-11.342230669,0,0,0,1,50,0.1,1000],[18.5491923525,3.01379604106,-12.0932371144,0,0,0,1,50,0.1,1000],[18.5040495666,3.06142584076,-12.5167002972,0,0,0,1,50,0.1,1000],[18.2255512665,3.14073905202,-13.1375097512,0,0,0,1,50,0.1,1000],[17.9471804938,3.18977099968,-13.4788172312,0,0,0,1,50,0.1,1000],[17.353652875,3.26745718715,-13.9639855532,0,0,0,1,50,0.1,1000],[16.91706698,3.31311740075,-14.2207876285,0,0,0,1,50,0.1,1000],[16.1182612198,3.38153565343,-14.568067427,0,0,0,1,50,0.1,1000],[15.5826677904,3.41929080756,-14.7398772805,0,0,0,1,50,0.1,1000],[14.6608815859,3.47159136589,-14.9498278371,0,0,0,1,50,0.1,1000],[14.0691511712,3.49763364109,-15.0377376694,0,0,0,1,50,0.1,1000],[13.0827348837,3.52851320346,-15.1132026143,0,0,0,1,50,0.1,1000],[12.4648538345,3.54019355239,-15.119531083,0,0,0,1,50,0.1,1000],[11.4543712878,3.54651977885,-15.0650326662,0,0,0,1,50,0.1,1000],[10.8311563838,3.54267296951,-14.9929412903,0,0,0,1,50,0.1,1000],[9.82487619389,3.52389146989,-14.8140635203,0,0,0,1,50,0.1,1000],[9.40925954476,3.51170673539,-14.7177652213,0,0,0,1,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,0,0,0,1,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,0,0,0,1,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,0,0,0,1,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,0,0,0,1,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,0,0,0,1,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,0,0,0,1,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,0,0,0,1,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,0,0,0,1,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,0,0,0,1,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,0,0,0,1,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,0,0,0,1,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,0,0,0,1,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,0,0,0,1,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,0,0,0,1,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,0,0,0,1,50,0.1,1000],[8.87580901604,3.57707574466,13.1269004424,0,0,0,1,50,0.1,1000],[9.4281195889,3.57669757997,12.7041654926,0,0,0,1,50,0.1,1000],[10.2941538206,3.56655823438,11.9586018407,0,0,0,1,50,0.1,1000],[10.8076726974,3.55065400753,11.4667703214,0,0,0,1,50,0.1,1000],[11.5993445495,3.5152057418,10.6130226632,0,0,0,1,50,0.1,1000],[12.059961016,3.49086687486,10.0557024613,0,0,0,1,50,0.1,1000],[12.7554673735,3.44631908065,9.10022423829,0,0,0,1,50,0.1,1000],[13.1519888097,3.4153447421,8.48385496219,0,0,0,1,50,0.1,1000],[13.7354274415,3.36033798991,7.43932222836,0,0,0,1,50,0.1,1000],[14.0586365105,3.32357716959,6.77213736597,0,0,0,1,50,0.1,1000],[14.5161046542,3.26125753602,5.65295938655,0,0,0,1,50,0.1,1000],[14.7580290173,3.22140180344,4.94451486637,0,0,0,1,50,0.1,1000],[15.0777810428,3.1568499565,3.76747557324,0,0,0,1,50,0.1,1000],[15.2318920186,3.11730408818,3.02889133892,0,0,0,1,50,0.1,1000],[15.4047902355,3.05618510887,1.81331979191,0,0,0,1,50,0.1,1000],[15.466349588,3.02044202091,1.05724320303,0,0,0,1,50,0.1,1000],[15.4864835209,2.96821315884,-0.175264024341,0,0,0,1,50,0.1,1000],[15.4529356622,2.9394624737,-0.934965431355,0,0,0,1,50,0.1,1000],[15.3182169161,2.90084346032,-2.16123575848,0,0,0,1,50,0.1,1000],[15.1895047638,2.8816915543,-2.91000742194,0,0,0,1,50,0.1,1000],[14.9020547121,2.8602642855,-4.10628596484,0,0,0,1,50,0.1,1000],[14.6807660839,2.8525125572,-4.82955686371,0,0,0,1,50,0.1,1000],[14.2469852392,2.85039806623,-5.97263988764,0,0,0,1,50,0.1,1000],[14.1941142553,2.8548395815,-6.65920465669,0,0,0,1,50,0.1,1000],[14.9856813677,2.87194363054,-7.77370379959,0,0,0,1,50,0.1,1000],[15.6886536175,2.88764692054,-8.45665253914,0,0,0,1,50,0.1,1000],[16.8104164056,2.92177783377,-9.54110397267,0,0,0,1,50,0.1,1000],[17.3979071911,2.94746405671,-10.1741080907,0,0,0,1,50,0.1,1000],[18.0952332671,2.9963854948,-11.1315038307,0,0,0,1,50,0.1,1000],[18.3605204934,3.03022459083,-11.6678476069,0,0,0,1,50,0.1,1000],[18.5308064163,3.0899578555,-12.4509017104,0,0,0,1,50,0.1,1000],[18.4926971369,3.12881774552,-12.8777301928,0,0,0,1,50,0.1,1000],[18.2289320355,3.19331195718,-13.48433787,0,0,0,1,50,0.1,1000],[17.9615613719,3.23300429082,-13.8073587478,0,0,0,1,50,0.1,1000],[17.3878062417,3.29500812369,-14.2528663532,0,0,0,1,50,0.1,1000],[16.9637963011,3.3309603642,-14.4824332025,0,0,0,1,50,0.1,1000],[16.1857603865,3.38318033999,-14.7834030705,0,0,0,1,50,0.1,1000],[15.6620583635,3.41111921262,-14.928361527,0,0,0,1,50,0.1,1000],[14.7587495563,3.44723697829,-15.0971553759,0,0,0,1,50,0.1,1000],[14.1766206581,3.46374185047,-15.1635490655,0,0,0,1,50,0.1,1000],[13.2043048407,3.47918955783,-15.2082180687,0,0,0,1,50,0.1,1000],[12.5928734014,3.48209575712,-15.1999139038,0,0,0,1,50,0.1,1000],[11.5911867071,3.47458754845,-15.1257014311,0,0,0,1,50,0.1,1000],[10.9710442713,3.46324036449,-15.0453635134,0,0,0,1,50,0.1,1000],[9.9682532412,3.43305556635,-14.8561700896,0,0,0,1,50,0.1,1000],[9.55263618518,3.41693003111,-14.757609751,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.follow.lockToTargetNoRoll.json b/test/golden/fixtures/body.follow.lockToTargetNoRoll.json index fc4a0d8..b6164d1 100644 --- a/test/golden/fixtures/body.follow.lockToTargetNoRoll.json +++ b/test/golden/fixtures/body.follow.lockToTargetNoRoll.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.742428096699,3.20833732542,16.2510300386,0,0,0,1,50,0.1,1000],[0.782834798564,3.21198719837,16.248299382,0,0,0,1,50,0.1,1000],[0.872586731131,3.22005717135,16.2408273931,0,0,0,1,50,0.1,1000],[1.16128559737,3.24568350525,16.2086882573,0,0,0,1,50,0.1,1000],[1.42829131686,3.26900375262,16.1718190918,0,0,0,1,50,0.1,1000],[1.99581269232,3.3172528102,16.0746093365,0,0,0,1,50,0.1,1000],[2.41676307368,3.35186933564,15.9882895127,0,0,0,1,50,0.1,1000],[3.19401899584,3.41277677065,15.7982512823,0,0,0,1,50,0.1,1000],[3.7184395334,3.45151508185,15.6485425057,0,0,0,1,50,0.1,1000],[4.62301803549,3.51313522572,15.348127687,0,0,0,1,50,0.1,1000],[5.20307935846,3.5488794682,15.127088894,0,0,0,1,50,0.1,1000],[6.16508638194,3.60058835389,14.7075671682,0,0,0,1,50,0.1,1000],[6.76285694861,3.62751157489,14.4120595494,0,0,0,1,50,0.1,1000],[7.72886907287,3.66122042842,13.8714754852,0,0,0,1,50,0.1,1000],[8.31598260071,3.67522236057,13.5019612357,0,0,0,1,50,0.1,1000],[9.24639632009,3.68578219658,12.8433931221,0,0,0,1,50,0.1,1000],[9.80185159721,3.68461218819,12.4030095632,0,0,0,1,50,0.1,1000],[10.6671964497,3.66987333223,11.6333057367,0,0,0,1,50,0.1,1000],[11.1752299148,3.65310020006,11.1272205137,0,0,0,1,50,0.1,1000],[11.9531508471,3.61377162274,10.2561387376,0,0,0,1,50,0.1,1000],[12.4016743297,3.58264569244,9.69111469213,0,0,0,1,50,0.1,1000],[13.0748732954,3.521990747,8.73073650844,0,0,0,1,50,0.1,1000],[13.4544723911,3.47920917656,8.11482820809,0,0,0,1,50,0.1,1000],[14.0094562932,3.40259042028,7.07913192664,0,0,0,1,50,0.1,1000],[14.3128126115,3.35197427079,6.42145054197,0,0,0,1,50,0.1,1000],[14.7392084793,3.26626646522,5.32595552653,0,0,0,1,50,0.1,1000],[14.9608022467,3.21236552501,4.63645775857,0,0,0,1,50,0.1,1000],[15.2510269744,3.12527036577,3.49788332854,0,0,0,1,50,0.1,1000],[15.3870041506,3.07292085269,2.78715831075,0,0,0,1,50,0.1,1000],[15.5361269501,2.99223071412,1.62306843662,0,0,0,1,50,0.1,1000],[15.5401368484,2.94609836161,0.902112432663,0,0,0,1,50,0.1,1000],[15.5086918888,2.87896597241,-0.26945934044,0,0,0,1,50,0.1,1000],[15.4618278403,2.84311132262,-0.989478081411,0,0,0,1,50,0.1,1000],[15.3275727578,2.79538634477,-2.15041215461,0,0,0,1,50,0.1,1000],[15.2059950408,2.77288967157,-2.85838794615,0,0,0,1,50,0.1,1000],[14.9408914097,2.75122980366,-3.99085037352,0,0,0,1,50,0.1,1000],[14.735864385,2.75174822628,-4.675960708,0,0,0,1,50,0.1,1000],[14.3345949591,2.75810839718,-5.76274229214,0,0,0,1,50,0.1,1000],[14.3024061308,2.7670519044,-6.4146431888,0,0,0,1,50,0.1,1000],[15.1321336737,2.79156823631,-7.43945156686,0,0,0,1,50,0.1,1000],[15.8591478689,2.81300562352,-8.04844173499,0,0,0,1,50,0.1,1000],[17.0233025646,2.85791854384,-8.99614222797,0,0,0,1,50,0.1,1000],[17.6353662276,2.89127677591,-9.55329669149,0,0,0,1,50,0.1,1000],[18.3705647861,2.95341858368,-10.410107759,0,0,0,1,50,0.1,1000],[18.654847261,2.99573009822,-10.9073869785,0,0,0,1,50,0.1,1000],[18.8492999495,3.06912589261,-11.6610427793,0,0,0,1,50,0.1,1000],[18.8203122725,3.11620307719,-12.0913858904,0,0,0,1,50,0.1,1000],[18.5624276331,3.19354869934,-12.7312798881,0,0,0,1,50,0.1,1000],[18.2927877907,3.24072136422,-13.0886898893,0,0,0,1,50,0.1,1000],[17.7059044894,3.31440582437,-13.6060096627,0,0,0,1,50,0.1,1000],[17.2684706684,3.35707747005,-13.885634753,0,0,0,1,50,0.1,1000],[16.4596102308,3.42000083485,-14.2734907264,0,0,0,1,50,0.1,1000],[15.9124243381,3.45410936118,-14.4717008135,0,0,0,1,50,0.1,1000],[14.9629221289,3.50036426383,-14.7252430433,0,0,0,1,50,0.1,1000],[14.3488512038,3.52276041793,-14.8396954453,0,0,0,1,50,0.1,1000],[13.3180437942,3.54817144403,-14.9241149145,0,0,0,1,50,0.1,1000],[12.6682775962,3.55690156293,-14.9185268616,0,0,0,1,50,0.1,1000],[11.5996164458,3.55939372102,-14.8749435758,0,0,0,1,50,0.1,1000],[10.9372780955,3.5538679499,-14.818878062,0,0,0,1,50,0.1,1000],[9.86352980434,3.53363633778,-14.6697953644,0,0,0,1,50,0.1,1000],[9.41880248749,3.5213289545,-14.5853435216,0,0,0,1,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.742428096699,3.20833732542,16.2510300386,0,0,0,1,50,0.1,1000],[0.782846990163,3.21198927396,16.2486998399,0,0,0,1,50,0.1,1000],[0.872646488309,3.2200681582,16.2424723632,0,0,0,1,50,0.1,1000],[1.16164622022,3.24573556932,16.2155747786,0,0,0,1,50,0.1,1000],[1.42905044389,3.26909633498,16.1838803837,0,0,0,1,50,0.1,1000],[1.99759899984,3.31743785432,16.0967447389,0,0,0,1,50,0.1,1000],[2.41946919868,3.35211401626,16.0170272245,0,0,0,1,50,0.1,1000],[3.19826960185,3.41311468703,15.835679993,0,0,0,1,50,0.1,1000],[3.72382431254,3.45189205437,15.6902889451,0,0,0,1,50,0.1,1000],[4.62965636733,3.51353493545,15.3928728182,0,0,0,1,50,0.1,1000],[5.21055495665,3.5492597048,15.1724587478,0,0,0,1,50,0.1,1000],[6.1727517063,3.60087195271,14.7500172885,0,0,0,1,50,0.1,1000],[6.77070182305,3.62770058134,14.4521239639,0,0,0,1,50,0.1,1000],[7.73547018897,3.66118807031,13.9048022663,0,0,0,1,50,0.1,1000],[8.32199800846,3.67503101367,13.5313570291,0,0,0,1,50,0.1,1000],[9.24974836622,3.68528346674,12.8647206078,0,0,0,1,50,0.1,1000],[9.80392965022,3.68392372144,12.4202028495,0,0,0,1,50,0.1,1000],[10.6663546954,3.66306597074,11.6442426204,0,0,0,1,50,0.1,1000],[11.1734608056,3.64091489158,11.135796077,0,0,0,1,50,0.1,1000],[11.9472644092,3.5981084547,10.2595658399,0,0,0,1,50,0.1,1000],[12.3937094266,3.56676877247,9.69225621576,0,0,0,1,50,0.1,1000],[13.0615037281,3.5073172883,8.72804150491,0,0,0,1,50,0.1,1000],[13.4386618375,3.46576859377,8.11089938193,0,0,0,1,50,0.1,1000],[13.9879496116,3.39139427043,7.073552413,0,0,0,1,50,0.1,1000],[14.2889546055,3.34217111318,6.41591291008,0,0,0,1,50,0.1,1000],[14.7099735422,3.25858692665,5.32104328031,0,0,0,1,50,0.1,1000],[14.9295967786,3.20587734275,4.63278922426,0,0,0,1,50,0.1,1000],[15.215201363,3.12051578943,3.4968972497,0,0,0,1,50,0.1,1000],[15.3498082365,3.06910212924,2.7884283741,0,0,0,1,50,0.1,1000],[15.4954243968,2.98975038361,1.62873380218,0,0,0,1,50,0.1,1000],[15.5429533404,2.94431938212,0.910809595863,0,0,0,1,50,0.1,1000],[15.5465423339,2.87816794603,-0.255056531465,0,0,0,1,50,0.1,1000],[15.5064776354,2.8428030915,-0.97152721601,0,0,0,1,50,0.1,1000],[15.3684754927,2.79572687169,-2.12587996626,0,0,0,1,50,0.1,1000],[15.2417991698,2.77352255955,-2.83006190779,0,0,0,1,50,0.1,1000],[14.9650168039,2.74954735303,-3.95551783829,0,0,0,1,50,0.1,1000],[14.7541350279,2.74233624327,-4.63686038139,0,0,0,1,50,0.1,1000],[14.3436186025,2.74329454633,-5.71665999415,0,0,0,1,50,0.1,1000],[14.3080969468,2.75150264302,-6.36747077483,0,0,0,1,50,0.1,1000],[15.1324780005,2.77699989693,-7.42719672222,0,0,0,1,50,0.1,1000],[15.8575627956,2.79971443963,-8.07936557956,0,0,0,1,50,0.1,1000],[17.0461344971,2.84700605235,-9.03199275597,0,0,0,1,50,0.1,1000],[17.6657858508,2.88178325877,-9.62342834292,0,0,0,1,50,0.1,1000],[18.4038977451,2.94591111998,-10.5552433172,0,0,0,1,50,0.1,1000],[18.6884034083,2.98922782194,-11.0935931012,0,0,0,1,50,0.1,1000],[18.881785762,3.06388079165,-11.8991301062,0,0,0,1,50,0.1,1000],[18.8535853947,3.11155801118,-12.3479398646,0,0,0,1,50,0.1,1000],[18.5986845524,3.18963503065,-12.9993401004,0,0,0,1,50,0.1,1000],[18.3327470173,3.23717341976,-13.3534994962,0,0,0,1,50,0.1,1000],[17.7537758397,3.31135142601,-13.8533061795,0,0,0,1,50,0.1,1000],[17.3223420351,3.35430879941,-14.1172847891,0,0,0,1,50,0.1,1000],[16.5243192502,3.4176875415,-14.4743680957,0,0,0,1,50,0.1,1000],[15.9840051162,3.45208692421,-14.6531153359,0,0,0,1,50,0.1,1000],[15.045986516,3.498841503,-14.874331514,0,0,0,1,50,0.1,1000],[14.4384595463,3.52155408338,-14.9709197912,0,0,0,1,50,0.1,1000],[13.4181974055,3.54750157765,-15.0600183571,0,0,0,1,50,0.1,1000],[12.7739408329,3.5565517803,-15.0759686211,0,0,0,1,50,0.1,1000],[11.7140832159,3.5595587767,-15.034910402,0,0,0,1,50,0.1,1000],[11.0559311166,3.55431532326,-14.9711795341,0,0,0,1,50,0.1,1000],[9.98899493909,3.53450187548,-14.8017297772,0,0,0,1,50,0.1,1000],[9.54614231669,3.52233349632,-14.7089772593,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.follow.lockToTargetOnAssign.json b/test/golden/fixtures/body.follow.lockToTargetOnAssign.json index 55a4f0c..c6c113a 100644 --- a/test/golden/fixtures/body.follow.lockToTargetOnAssign.json +++ b/test/golden/fixtures/body.follow.lockToTargetOnAssign.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,0,0,0,1,50,0.1,1000],[0.746598275757,3.21192714811,16.2492381629,0,0,0,1,50,0.1,1000],[0.793783638597,3.21996132868,16.2439475624,0,0,0,1,50,0.1,1000],[0.945452398364,3.24541764275,16.2223518773,0,0,0,1,50,0.1,1000],[1.08562782566,3.26853450829,16.1983383798,0,0,0,1,50,0.1,1000],[1.38331063676,3.31624034924,16.1366177651,0,0,0,1,50,0.1,1000],[1.60391049904,3.35037781201,16.0827638848,0,0,0,1,50,0.1,1000],[2.01077245141,3.41026188563,15.9658595092,0,0,0,1,50,0.1,1000],[2.28494296745,3.44822778261,15.8747038104,0,0,0,1,50,0.1,1000],[2.75712085873,3.50839747704,15.6932647119,0,0,0,1,50,0.1,1000],[3.05935891523,3.54315556313,15.560566311,0,0,0,1,50,0.1,1000],[3.55944678182,3.59318172618,15.3098736525,0,0,0,1,50,0.1,1000],[3.86933890036,3.61905722153,15.13388586,0,0,0,1,50,0.1,1000],[4.36834861736,3.651132294,14.8127434126,0,0,0,1,50,0.1,1000],[4.67033305866,3.66420914966,14.5936136257,0,0,0,1,50,0.1,1000],[5.14622431816,3.6734805712,14.2035392878,0,0,0,1,50,0.1,1000],[5.42840619113,3.67167952056,13.9429105409,0,0,0,1,50,0.1,1000],[5.86413702125,3.65623900408,13.4876346333,0,0,0,1,50,0.1,1000],[6.11718441934,3.63924759141,13.1884118422,0,0,0,1,50,0.1,1000],[6.49918291851,3.59993490363,12.6735929738,0,0,0,1,50,0.1,1000],[6.71556131553,3.56904219873,12.3398121262,0,0,0,1,50,0.1,1000],[7.03276344148,3.50911012948,11.77287173,0,0,0,1,50,0.1,1000],[7.20629898093,3.46696208184,11.4096151816,0,0,0,1,50,0.1,1000],[7.44965798377,3.39162064169,10.7996083017,0,0,0,1,50,0.1,1000],[7.57534784398,3.34190619311,10.412921971,0,0,0,1,50,0.1,1000],[7.73767186101,3.25776494781,9.77038362568,0,0,0,1,50,0.1,1000],[7.81165438292,3.20484702252,9.36716539486,0,0,0,1,50,0.1,1000],[7.87153939341,3.11928319661,8.70389359746,0,0,0,1,50,0.1,1000],[7.86783077152,3.06779441413,8.29173554229,0,0,0,1,50,0.1,1000],[7.83878685437,2.98828315953,7.62049368281,0,0,0,1,50,0.1,1000],[7.80130972408,2.94271091791,7.20747407651,0,0,0,1,50,0.1,1000],[7.70130338936,2.87616071501,6.54161668437,0,0,0,1,50,0.1,1000],[7.61406203153,2.8404495479,6.13605037106,0,0,0,1,50,0.1,1000],[7.42840452037,2.79258960626,5.48909510541,0,0,0,1,50,0.1,1000],[7.28712546621,2.76979022331,5.09926087836,0,0,0,1,50,0.1,1000],[7.01399104968,2.74465752227,4.4844422254,0,0,0,1,50,0.1,1000],[6.81976738122,2.73665128051,4.11831095271,0,0,0,1,50,0.1,1000],[6.463414017,2.73622163788,3.54815439737,0,0,0,1,50,0.1,1000],[6.47585187174,2.74354572733,3.21314055292,0,0,0,1,50,0.1,1000],[7.4062734155,2.76754503205,2.69908949054,0,0,0,1,50,0.1,1000],[8.21246048195,2.78933693199,2.40184228346,0,0,0,1,50,0.1,1000],[9.53324889103,2.83525512069,1.95395669935,0,0,0,1,50,0.1,1000],[10.2587174979,2.86932505585,1.70019793313,0,0,0,1,50,0.1,1000],[11.2055316398,2.93263748478,1.32692934201,0,0,0,1,50,0.1,1000],[11.6366509614,2.97566566436,1.12133704328,0,0,0,1,50,0.1,1000],[12.0961103521,3.05024639525,0.829373752111,0,0,0,1,50,0.1,1000],[12.2462408816,3.09808935388,0.675506248905,0,0,0,1,50,0.1,1000],[12.3045911914,3.17678134344,0.469679674131,0,0,0,1,50,0.1,1000],[12.2448263213,3.22486045883,0.369934944507,0,0,0,1,50,0.1,1000],[12.0225797904,3.30015131981,0.253180880473,0,0,0,1,50,0.1,1000],[11.8238061562,3.34388793959,0.208789214823,0,0,0,1,50,0.1,1000],[11.4243705192,3.40862858858,0.182163949838,0,0,0,1,50,0.1,1000],[11.1421395784,3.44388493365,0.193215453912,0,0,0,1,50,0.1,1000],[10.6423513164,3.49198285242,0.255970618825,0,0,0,1,50,0.1,1000],[10.3164766801,3.51546623456,0.32148001433,0,0,0,1,50,0.1,1000],[9.77025097881,3.54248542162,0.471198381084,0,0,0,1,50,0.1,1000],[9.42830651403,3.54658908267,0.589206510818,0,0,0,1,50,0.1,1000],[8.87279466311,3.54271522993,0.821993016522,0,0,0,1,50,0.1,1000],[8.53377907201,3.53615762632,0.989698139558,0,0,0,1,50,0.1,1000],[7.99470049182,3.51652824322,1.3004090013,0,0,0,1,50,0.1,1000],[7.7755977581,3.50487770355,1.44319193949,0,0,0,1,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,0,0,0,1,50,0.1,1000],[0.746598275757,3.21192714811,16.2492381629,0,0,0,1,50,0.1,1000],[0.793783638597,3.21996132868,16.2439475624,0,0,0,1,50,0.1,1000],[0.945452398364,3.24541764275,16.2223518773,0,0,0,1,50,0.1,1000],[1.08562782566,3.26853450829,16.1983383798,0,0,0,1,50,0.1,1000],[1.38331063676,3.31624034924,16.1366177651,0,0,0,1,50,0.1,1000],[1.60391049904,3.35037781201,16.0827638848,0,0,0,1,50,0.1,1000],[2.01077245141,3.41026188563,15.9658595092,0,0,0,1,50,0.1,1000],[2.28494296745,3.44822778261,15.8747038104,0,0,0,1,50,0.1,1000],[2.75712085873,3.50839747704,15.6932647119,0,0,0,1,50,0.1,1000],[3.05935891523,3.54315556313,15.560566311,0,0,0,1,50,0.1,1000],[3.55944678182,3.59318172618,15.3098736525,0,0,0,1,50,0.1,1000],[3.86933890036,3.61905722153,15.13388586,0,0,0,1,50,0.1,1000],[4.36834861736,3.651132294,14.8127434126,0,0,0,1,50,0.1,1000],[4.67033305866,3.66420914966,14.5936136257,0,0,0,1,50,0.1,1000],[5.14622431816,3.6734805712,14.2035392878,0,0,0,1,50,0.1,1000],[5.42840619113,3.67167952056,13.9429105409,0,0,0,1,50,0.1,1000],[5.86413702125,3.65623900408,13.4876346333,0,0,0,1,50,0.1,1000],[6.11718441934,3.63924759141,13.1884118422,0,0,0,1,50,0.1,1000],[6.49918291851,3.59993490363,12.6735929738,0,0,0,1,50,0.1,1000],[6.71556131553,3.56904219873,12.3398121262,0,0,0,1,50,0.1,1000],[7.03276344148,3.50911012948,11.77287173,0,0,0,1,50,0.1,1000],[7.20629898093,3.46696208184,11.4096151816,0,0,0,1,50,0.1,1000],[7.44965798377,3.39162064169,10.7996083017,0,0,0,1,50,0.1,1000],[7.57534784398,3.34190619311,10.412921971,0,0,0,1,50,0.1,1000],[7.73767186101,3.25776494781,9.77038362568,0,0,0,1,50,0.1,1000],[7.81165438292,3.20484702252,9.36716539486,0,0,0,1,50,0.1,1000],[7.88763975129,3.11928319661,8.70389359746,0,0,0,1,50,0.1,1000],[7.90724995257,3.06779441413,8.29173554229,0,0,0,1,50,0.1,1000],[7.89360233424,2.98828315953,7.62049368281,0,0,0,1,50,0.1,1000],[7.8574541255,2.94271091791,7.20747407651,0,0,0,1,50,0.1,1000],[7.75301480594,2.87616071501,6.54161668437,0,0,0,1,50,0.1,1000],[7.66106659351,2.8404495479,6.13605037106,0,0,0,1,50,0.1,1000],[7.46688619995,2.79258960626,5.48909510541,0,0,0,1,50,0.1,1000],[7.3204619654,2.76979022331,5.09926087836,0,0,0,1,50,0.1,1000],[7.03978893062,2.74465752227,4.4844422254,0,0,0,1,50,0.1,1000],[6.84154217728,2.73665128051,4.11831095271,0,0,0,1,50,0.1,1000],[6.47971709206,2.73622163788,3.54815439737,0,0,0,1,50,0.1,1000],[6.48939004207,2.74354572733,3.21314055292,0,0,0,1,50,0.1,1000],[7.41619166745,2.76754503205,2.69908949054,0,0,0,1,50,0.1,1000],[8.2206051294,2.78933693199,2.40184228346,0,0,0,1,50,0.1,1000],[9.53912464193,2.83525512069,1.95395669935,0,0,0,1,50,0.1,1000],[10.2635034228,2.86932505585,1.70019793313,0,0,0,1,50,0.1,1000],[11.208944946,2.93263748478,1.32692934201,0,0,0,1,50,0.1,1000],[11.63941401,2.97566566436,1.12133704328,0,0,0,1,50,0.1,1000],[12.0980635282,3.05024639525,0.829373752111,0,0,0,1,50,0.1,1000],[12.2478142844,3.09808935388,0.675506248905,0,0,0,1,50,0.1,1000],[12.3056955723,3.17678134344,0.469679674131,0,0,0,1,50,0.1,1000],[12.2457124786,3.22486045883,0.369934944507,0,0,0,1,50,0.1,1000],[12.0231982083,3.30015131981,0.253180880473,0,0,0,1,50,0.1,1000],[11.8245064353,3.34848847497,0.226168112371,0,0,0,1,50,0.1,1000],[11.4252244186,3.42004534238,0.225291668297,0,0,0,1,50,0.1,1000],[11.1429870708,3.45671336703,0.241675907071,0,0,0,1,50,0.1,1000],[10.6431100105,3.50471452326,0.304065543577,0,0,0,1,50,0.1,1000],[10.3171588465,3.52735178767,0.366378660366,0,0,0,1,50,0.1,1000],[9.77080265966,3.55250034973,0.509030588663,0,0,0,1,50,0.1,1000],[9.42878182297,3.56086048267,0.622393077986,0,0,0,1,50,0.1,1000],[8.87315999644,3.56258411851,0.848068760762,0,0,0,1,50,0.1,1000],[8.53408642102,3.55651349384,1.01186750252,0,0,0,1,50,0.1,1000],[7.99492961679,3.53528114323,1.31716425902,0,0,0,1,50,0.1,1000],[7.77579965068,3.52250994246,1.45802647272,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.follow.lockToTargetWithWorldUp.json b/test/golden/fixtures/body.follow.lockToTargetWithWorldUp.json index 74cd869..305f1c3 100644 --- a/test/golden/fixtures/body.follow.lockToTargetWithWorldUp.json +++ b/test/golden/fixtures/body.follow.lockToTargetWithWorldUp.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.738820273556,4.02197886084,15.9915250656,0,0,0,1,50,0.1,1000],[0.778625275088,4.02561707895,15.9888195798,0,0,0,1,50,0.1,1000],[0.867040533228,4.03365125953,15.9814252713,0,0,0,1,50,0.1,1000],[1.15144003636,4.05910757359,15.9496605441,0,0,0,1,50,0.1,1000],[1.41447046217,4.08222443913,15.9132465226,0,0,0,1,50,0.1,1000],[1.9735473872,4.12993028009,15.8172869178,0,0,0,1,50,0.1,1000],[2.38823900925,4.16406774285,15.7321046267,0,0,0,1,50,0.1,1000],[3.15395011098,4.22395181647,15.5446100856,0,0,0,1,50,0.1,1000],[3.6705891541,4.26191771345,15.3969223469,0,0,0,1,50,0.1,1000],[4.5617574686,4.32208740789,15.1005757985,0,0,0,1,50,0.1,1000],[5.13322465556,4.35684549397,14.8825291558,0,0,0,1,50,0.1,1000],[6.08097740104,4.40687165702,14.4686644903,0,0,0,1,50,0.1,1000],[6.6698827414,4.43274715237,14.1771194842,0,0,0,1,50,0.1,1000],[7.62153437552,4.46482222484,13.6437295984,0,0,0,1,50,0.1,1000],[8.19988671019,4.4778990805,13.2790932533,0,0,0,1,50,0.1,1000],[9.1163298593,4.48717050204,12.6291424073,0,0,0,1,50,0.1,1000],[9.66337479566,4.4853694514,12.1944728549,0,0,0,1,50,0.1,1000],[10.5154627355,4.46992893492,11.4346760254,0,0,0,1,50,0.1,1000],[11.0155986385,4.45293752225,10.9350595032,0,0,0,1,50,0.1,1000],[11.7811945422,4.41362483447,10.0750485415,0,0,0,1,50,0.1,1000],[12.222447875,4.38273212957,9.51717542273,0,0,0,1,50,0.1,1000],[12.8844196698,4.32280006032,8.56892308591,0,0,0,1,50,0.1,1000],[13.257470893,4.28065201268,7.96078567066,0,0,0,1,50,0.1,1000],[13.8024745149,4.20531057253,6.93817422654,0,0,0,1,50,0.1,1000],[14.1000962928,4.15559612395,6.2888258037,0,0,0,1,50,0.1,1000],[14.517907419,4.07145487865,5.20727859907,0,0,0,1,50,0.1,1000],[14.7346720385,4.01853695336,4.52661347864,0,0,0,1,50,0.1,1000],[15.0178557856,3.93297312745,3.40273952868,0,0,0,1,50,0.1,1000],[15.1499981366,3.88148434497,2.70127202356,0,0,0,1,50,0.1,1000],[15.2937597017,3.80197309037,1.55250073464,0,0,0,1,50,0.1,1000],[15.3391151579,3.75640084875,0.841135971246,0,0,0,1,50,0.1,1000],[15.3412246643,3.68985064585,-0.314659915187,0,0,0,1,50,0.1,1000],[15.2991895359,3.65413947874,-1.02485964572,0,0,0,1,50,0.1,1000],[15.1599156607,3.6062795371,-2.16974094661,0,0,0,1,50,0.1,1000],[15.0314005341,3.58348015415,-2.86778442558,0,0,0,1,50,0.1,1000],[14.7534197652,3.55834745311,-3.98410432861,0,0,0,1,50,0.1,1000],[14.5407832475,3.55034121135,-4.65928308614,0,0,0,1,50,0.1,1000],[14.1290551023,3.54991156872,-5.73001152935,0,0,0,1,50,0.1,1000],[14.0918686409,3.55723565817,-6.37208671522,0,0,0,1,50,0.1,1000],[14.916017161,3.58123496289,-7.38109108963,0,0,0,1,50,0.1,1000],[15.6410912856,3.60302686283,-7.98045265699,0,0,0,1,50,0.1,1000],[16.8043585966,3.64894505153,-8.91273484784,0,0,0,1,50,0.1,1000],[17.4171275467,3.68301498669,-9.46053569548,0,0,0,1,50,0.1,1000],[18.1552833842,3.74632741562,-10.3024331988,0,0,0,1,50,0.1,1000],[18.3928010369,3.7893555952,-10.7907045397,0,0,0,1,50,0.1,1000],[18.3567775932,3.8639363261,-11.5300668809,0,0,0,1,50,0.1,1000],[18.2762335046,3.91177928472,-11.9518216846,0,0,0,1,50,0.1,1000],[18.0141214741,3.99047127428,-12.5781717624,0,0,0,1,50,0.1,1000],[17.7690421112,4.03855038967,-12.9275007274,0,0,0,1,50,0.1,1000],[17.2411394728,4.11384125065,-13.4321850289,0,0,0,1,50,0.1,1000],[16.8443274345,4.15757787043,-13.7043452725,0,0,0,1,50,0.1,1000],[16.1003868945,4.22231851942,-14.0806694624,0,0,0,1,50,0.1,1000],[15.5905887561,4.25757486449,-14.2721615978,0,0,0,1,50,0.1,1000],[14.6958937441,4.30567278326,-14.5155015085,0,0,0,1,50,0.1,1000],[14.1118829155,4.3291561654,-14.6241276313,0,0,0,1,50,0.1,1000],[13.1242301951,4.35617535246,-14.7320024972,0,0,0,1,50,0.1,1000],[12.4979959569,4.36027901351,-14.7568969839,0,0,0,1,50,0.1,1000],[11.4633635398,4.35640516077,-14.7289931286,0,0,0,1,50,0.1,1000],[10.8198580733,4.34984755716,-14.6706204126,0,0,0,1,50,0.1,1000],[9.7739045341,4.33021817406,-14.5087593325,0,0,0,1,50,0.1,1000],[9.33991622626,4.3185676344,-14.4174865201,0,0,0,1,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.738820273556,4.02197886084,15.9915250656,0,0,0,1,50,0.1,1000],[0.778637016735,4.02561707895,15.9892075741,0,0,0,1,50,0.1,1000],[0.867097879116,4.03365125953,15.9830171279,0,0,0,1,50,0.1,1000],[1.15178352792,4.05910757359,15.9563039253,0,0,0,1,50,0.1,1000],[1.41519026608,4.08222443913,15.9248577057,0,0,0,1,50,0.1,1000],[1.97522200172,4.12993028009,15.8384898435,0,0,0,1,50,0.1,1000],[2.39076105079,4.16406774285,15.7595453151,0,0,0,1,50,0.1,1000],[3.1578449578,4.22395181647,15.5800819872,0,0,0,1,50,0.1,1000],[3.67547893365,4.26191771345,15.4362941288,0,0,0,1,50,0.1,1000],[4.56762062986,4.32208740789,15.1422832179,0,0,0,1,50,0.1,1000],[5.13972394469,4.35684549397,14.9244848554,0,0,0,1,50,0.1,1000],[6.08729791079,4.40687165702,14.507151677,0,0,0,1,50,0.1,1000],[6.67613768283,4.43274715237,14.212935665,0,0,0,1,50,0.1,1000],[7.62612117339,4.46482222484,13.6724220492,0,0,0,1,50,0.1,1000],[8.20361986047,4.4778990805,13.30367471,0,0,0,1,50,0.1,1000],[9.1169529952,4.48717050204,12.6454385706,0,0,0,1,50,0.1,1000],[9.66245339389,4.4853694514,12.2065567405,0,0,0,1,50,0.1,1000],[10.5102578786,4.46992893492,11.4392104985,0,0,0,1,50,0.1,1000],[11.0083444338,4.45293752225,10.9361662287,0,0,0,1,50,0.1,1000],[11.7688429928,4.41362483447,10.0704605736,0,0,0,1,50,0.1,1000],[12.2077590977,4.38273212957,9.5103942702,0,0,0,1,50,0.1,1000],[12.8642069083,4.32280006032,8.55879467814,0,0,0,1,50,0.1,1000],[13.2348569965,4.28065201268,7.94983839865,0,0,0,1,50,0.1,1000],[13.7743030041,4.20531057253,6.92631073943,0,0,0,1,50,0.1,1000],[14.0696829936,4.15559612395,6.27746945437,0,0,0,1,50,0.1,1000],[14.482293061,4.07145487865,5.1972835668,0,0,0,1,50,0.1,1000],[14.6971926341,4.01853695336,4.51829979497,0,0,0,1,50,0.1,1000],[14.9759087594,3.93297312745,3.39778160262,0,0,0,1,50,0.1,1000],[15.1067663202,3.88148434497,2.69896306634,0,0,0,1,50,0.1,1000],[15.2471409432,3.80197309037,1.55518733317,0,0,0,1,50,0.1,1000],[15.2919703637,3.75640084875,0.847202790768,0,0,0,1,50,0.1,1000],[15.2920711779,3.68985064585,-0.302354501944,0,0,0,1,50,0.1,1000],[15.2504101437,3.65413947874,-1.00869587336,0,0,0,1,50,0.1,1000],[15.1107341881,3.6062795371,-2.14651754141,0,0,0,1,50,0.1,1000],[14.9835870216,3.58348015415,-2.8404856658,0,0,0,1,50,0.1,1000],[14.7069547481,3.55834745311,-3.94935862171,0,0,0,1,50,0.1,1000],[14.4967191669,3.55034121135,-4.62050602297,0,0,0,1,50,0.1,1000],[14.0881411544,3.54991156872,-5.68383178118,0,0,0,1,50,0.1,1000],[14.0543501957,3.55723565817,-6.32456085498,0,0,0,1,50,0.1,1000],[14.8823918388,3.58123496289,-7.36806833312,0,0,0,1,50,0.1,1000],[15.6102457939,3.60302686283,-8.0103539897,0,0,0,1,50,0.1,1000],[16.8041618304,3.64894505153,-8.94701289049,0,0,0,1,50,0.1,1000],[17.4275678696,3.68301498669,-9.52885221785,0,0,0,1,50,0.1,1000],[18.1725508204,3.74632741562,-10.4453431119,0,0,0,1,50,0.1,1000],[18.4617653883,3.7893555952,-10.9744291345,0,0,0,1,50,0.1,1000],[18.6635455543,3.8639363261,-11.765243167,0,0,0,1,50,0.1,1000],[18.6409836395,3.91177928472,-12.2052025659,0,0,0,1,50,0.1,1000],[18.3959763674,3.99047127428,-12.8426273878,0,0,0,1,50,0.1,1000],[18.1365907592,4.03855038967,-13.1884496526,0,0,0,1,50,0.1,1000],[17.5689850812,4.11384125065,-13.67520973,0,0,0,1,50,0.1,1000],[17.1449994244,4.15757787043,-13.9314870055,0,0,0,1,50,0.1,1000],[16.3597761537,4.22231851942,-14.2766703984,0,0,0,1,50,0.1,1000],[15.8277729173,4.25757486449,-14.4484952034,0,0,0,1,50,0.1,1000],[14.9039104569,4.30567278326,-14.6592020731,0,0,0,1,50,0.1,1000],[14.3054927265,4.3291561654,-14.7497999181,0,0,0,1,50,0.1,1000],[13.3006066237,4.35617535246,-14.8300262477,0,0,0,1,50,0.1,1000],[12.6661535247,4.36576527763,-14.8410639795,0,0,0,1,50,0.1,1000],[11.6226891377,4.36937128791,-14.792988884,0,0,0,1,50,0.1,1000],[10.9748915655,4.36433475906,-14.7255428874,0,0,0,1,50,0.1,1000],[9.92510645107,4.34453562839,-14.5510926542,0,0,0,1,50,0.1,1000],[9.48949739743,4.33227288111,-14.4566361433,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.follow.worldSpace.json b/test/golden/fixtures/body.follow.worldSpace.json index fe38ca8..aa8219b 100644 --- a/test/golden/fixtures/body.follow.worldSpace.json +++ b/test/golden/fixtures/body.follow.worldSpace.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.627609317322,4.02197886084,15.9922980953,0,0,0,1,50,0.1,1000],[0.648860888759,4.02561707895,15.990273598,0,0,0,1,50,0.1,1000],[0.696046251599,4.03365125953,15.9849829975,0,0,0,1,50,0.1,1000],[0.847715011366,4.05910757359,15.9633873124,0,0,0,1,50,0.1,1000],[0.987890438666,4.08222443913,15.9393738149,0,0,0,1,50,0.1,1000],[1.28557324976,4.12993028009,15.8776532002,0,0,0,1,50,0.1,1000],[1.50617311205,4.16406774285,15.8237993199,0,0,0,1,50,0.1,1000],[1.91303506441,4.22395181647,15.7068949443,0,0,0,1,50,0.1,1000],[2.18720558046,4.26191771345,15.6157392455,0,0,0,1,50,0.1,1000],[2.65938347173,4.32208740789,15.434300147,0,0,0,1,50,0.1,1000],[2.96162152823,4.35684549397,15.3016017461,0,0,0,1,50,0.1,1000],[3.46170939482,4.40687165702,15.0509090876,0,0,0,1,50,0.1,1000],[3.77160151336,4.43274715237,14.874921295,0,0,0,1,50,0.1,1000],[4.27061123037,4.46482222484,14.5537788477,0,0,0,1,50,0.1,1000],[4.57259567166,4.4778990805,14.3346490608,0,0,0,1,50,0.1,1000],[5.04848693117,4.48717050204,13.9445747229,0,0,0,1,50,0.1,1000],[5.33066880414,4.4853694514,13.6839459759,0,0,0,1,50,0.1,1000],[5.76639963425,4.46992893492,13.2286700684,0,0,0,1,50,0.1,1000],[6.01944703235,4.45293752225,12.9294472772,0,0,0,1,50,0.1,1000],[6.40144553151,4.41362483447,12.4146284089,0,0,0,1,50,0.1,1000],[6.61782392853,4.38273212957,12.0808475612,0,0,0,1,50,0.1,1000],[6.93502605448,4.32280006032,11.5139071651,0,0,0,1,50,0.1,1000],[7.10856159393,4.28065201268,11.1506506166,0,0,0,1,50,0.1,1000],[7.35192059677,4.20531057253,10.5406437368,0,0,0,1,50,0.1,1000],[7.47761045699,4.15559612395,10.1539574061,0,0,0,1,50,0.1,1000],[7.63993447402,4.07145487865,9.51141906076,0,0,0,1,50,0.1,1000],[7.71391699593,4.01853695336,9.10820082994,0,0,0,1,50,0.1,1000],[7.77380200641,3.93297312745,8.44492903253,0,0,0,1,50,0.1,1000],[7.77009338452,3.88148434497,8.03277097736,0,0,0,1,50,0.1,1000],[7.74104946737,3.80197309037,7.36152911788,0,0,0,1,50,0.1,1000],[7.70357233708,3.75640084875,6.94850951159,0,0,0,1,50,0.1,1000],[7.60356600236,3.68985064585,6.28265211945,0,0,0,1,50,0.1,1000],[7.51632464453,3.65413947874,5.87708580613,0,0,0,1,50,0.1,1000],[7.33066713337,3.6062795371,5.23013054049,0,0,0,1,50,0.1,1000],[7.18938807921,3.58348015415,4.84029631343,0,0,0,1,50,0.1,1000],[6.91625366269,3.55834745311,4.22547766047,0,0,0,1,50,0.1,1000],[6.72202999422,3.55034121135,3.85934638779,0,0,0,1,50,0.1,1000],[6.36567663001,3.54991156872,3.28918983245,0,0,0,1,50,0.1,1000],[6.37811448475,3.55723565817,2.954175988,0,0,0,1,50,0.1,1000],[7.3085360285,3.58123496289,2.44012492561,0,0,0,1,50,0.1,1000],[8.11472309495,3.60302686283,2.14287771854,0,0,0,1,50,0.1,1000],[9.43551150403,3.64894505153,1.69499213442,0,0,0,1,50,0.1,1000],[10.1609801109,3.68301498669,1.44123336821,0,0,0,1,50,0.1,1000],[11.1077942528,3.74632741562,1.06796477708,0,0,0,1,50,0.1,1000],[11.5389135744,3.7893555952,0.862372478359,0,0,0,1,50,0.1,1000],[11.9983729651,3.8639363261,0.570409187187,0,0,0,1,50,0.1,1000],[12.1485034946,3.91177928472,0.416541683981,0,0,0,1,50,0.1,1000],[12.2068538044,3.99047127428,0.210715109206,0,0,0,1,50,0.1,1000],[12.1470889343,4.03855038967,0.110970379582,0,0,0,1,50,0.1,1000],[11.9248424034,4.11384125065,-0.00578368445128,0,0,0,1,50,0.1,1000],[11.7260687692,4.15757787043,-0.0501753501008,0,0,0,1,50,0.1,1000],[11.3266331322,4.22231851942,-0.0768006150865,0,0,0,1,50,0.1,1000],[11.0444021914,4.25757486449,-0.0657491110123,0,0,0,1,50,0.1,1000],[10.5446139294,4.30567278326,-0.00299394609887,0,0,0,1,50,0.1,1000],[10.2187392931,4.3291561654,0.0625154494061,0,0,0,1,50,0.1,1000],[9.67251359181,4.35617535246,0.21223381616,0,0,0,1,50,0.1,1000],[9.33056912703,4.36027901351,0.330241945893,0,0,0,1,50,0.1,1000],[8.77505727611,4.35640516077,0.563028451598,0,0,0,1,50,0.1,1000],[8.43604168502,4.34984755716,0.730733574634,0,0,0,1,50,0.1,1000],[7.89696310483,4.33021817406,1.04144443638,0,0,0,1,50,0.1,1000],[7.6778603711,4.3185676344,1.18422737456,0,0,0,1,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.627609317322,4.02197886084,15.9922980953,0,0,0,1,50,0.1,1000],[0.648860888759,4.02561707895,15.990273598,0,0,0,1,50,0.1,1000],[0.696046251599,4.03365125953,15.9849829975,0,0,0,1,50,0.1,1000],[0.847715011366,4.05910757359,15.9633873124,0,0,0,1,50,0.1,1000],[0.987890438666,4.08222443913,15.9393738149,0,0,0,1,50,0.1,1000],[1.28557324976,4.12993028009,15.8776532002,0,0,0,1,50,0.1,1000],[1.50617311205,4.16406774285,15.8237993199,0,0,0,1,50,0.1,1000],[1.91303506441,4.22395181647,15.7068949443,0,0,0,1,50,0.1,1000],[2.18720558046,4.26191771345,15.6157392455,0,0,0,1,50,0.1,1000],[2.65938347173,4.32208740789,15.434300147,0,0,0,1,50,0.1,1000],[2.96162152823,4.35684549397,15.3016017461,0,0,0,1,50,0.1,1000],[3.46170939482,4.40687165702,15.0509090876,0,0,0,1,50,0.1,1000],[3.77160151336,4.43274715237,14.874921295,0,0,0,1,50,0.1,1000],[4.27061123037,4.46482222484,14.5537788477,0,0,0,1,50,0.1,1000],[4.57259567166,4.4778990805,14.3346490608,0,0,0,1,50,0.1,1000],[5.04848693117,4.48717050204,13.9445747229,0,0,0,1,50,0.1,1000],[5.33066880414,4.4853694514,13.6839459759,0,0,0,1,50,0.1,1000],[5.76639963425,4.46992893492,13.2286700684,0,0,0,1,50,0.1,1000],[6.01944703235,4.45293752225,12.9294472772,0,0,0,1,50,0.1,1000],[6.40144553151,4.41362483447,12.4146284089,0,0,0,1,50,0.1,1000],[6.61782392853,4.38273212957,12.0808475612,0,0,0,1,50,0.1,1000],[6.93502605448,4.32280006032,11.5139071651,0,0,0,1,50,0.1,1000],[7.10856159393,4.28065201268,11.1506506166,0,0,0,1,50,0.1,1000],[7.35192059677,4.20531057253,10.5406437368,0,0,0,1,50,0.1,1000],[7.47761045699,4.15559612395,10.1539574061,0,0,0,1,50,0.1,1000],[7.63993447402,4.07145487865,9.51141906076,0,0,0,1,50,0.1,1000],[7.71391699593,4.01853695336,9.10820082994,0,0,0,1,50,0.1,1000],[7.77380200641,3.93297312745,8.44492903253,0,0,0,1,50,0.1,1000],[7.77009338452,3.88148434497,8.03277097736,0,0,0,1,50,0.1,1000],[7.74104946737,3.80197309037,7.36152911788,0,0,0,1,50,0.1,1000],[7.70357233708,3.75640084875,6.94850951159,0,0,0,1,50,0.1,1000],[7.60356600236,3.68985064585,6.28265211945,0,0,0,1,50,0.1,1000],[7.51632464453,3.65413947874,5.87708580613,0,0,0,1,50,0.1,1000],[7.33066713337,3.6062795371,5.23013054049,0,0,0,1,50,0.1,1000],[7.18938807921,3.58348015415,4.84029631343,0,0,0,1,50,0.1,1000],[6.91625366269,3.55834745311,4.22547766047,0,0,0,1,50,0.1,1000],[6.72202999422,3.55034121135,3.85934638779,0,0,0,1,50,0.1,1000],[6.36567663001,3.54991156872,3.28918983245,0,0,0,1,50,0.1,1000],[6.37811448475,3.55723565817,2.954175988,0,0,0,1,50,0.1,1000],[7.3085360285,3.58123496289,2.44012492561,0,0,0,1,50,0.1,1000],[8.11472309495,3.60302686283,2.14287771854,0,0,0,1,50,0.1,1000],[9.43551150403,3.64894505153,1.69499213442,0,0,0,1,50,0.1,1000],[10.1609801109,3.68301498669,1.44123336821,0,0,0,1,50,0.1,1000],[11.1077942528,3.74632741562,1.06796477708,0,0,0,1,50,0.1,1000],[11.5389135744,3.7893555952,0.862372478359,0,0,0,1,50,0.1,1000],[11.9983729651,3.8639363261,0.570409187187,0,0,0,1,50,0.1,1000],[12.1485034946,3.91177928472,0.416541683981,0,0,0,1,50,0.1,1000],[12.2068538044,3.99047127428,0.210715109206,0,0,0,1,50,0.1,1000],[12.1470889343,4.03855038967,0.110970379582,0,0,0,1,50,0.1,1000],[11.9248424034,4.11384125065,-0.00578368445128,0,0,0,1,50,0.1,1000],[11.7260687692,4.15757787043,-0.0501753501008,0,0,0,1,50,0.1,1000],[11.3266331322,4.22231851942,-0.0768006150865,0,0,0,1,50,0.1,1000],[11.0444021914,4.25757486449,-0.0657491110123,0,0,0,1,50,0.1,1000],[10.5446139294,4.28482855852,0.00482263818093,0,0,0,1,50,0.1,1000],[10.2187392931,4.3021330915,0.0726491021199,0,0,0,1,50,0.1,1000],[9.67251359181,4.32670607079,0.223284796786,0,0,0,1,50,0.1,1000],[9.33056912703,4.33741490968,0.340873333873,0,0,0,1,50,0.1,1000],[8.77505727611,4.3447393252,0.572265437611,0,0,0,1,50,0.1,1000],[8.43604168502,4.34245004629,0.738940341923,0,0,0,1,50,0.1,1000],[7.89696310483,4.32707859765,1.04799082291,0,0,0,1,50,0.1,1000],[7.6778603711,4.31653689055,1.19012837102,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.orbitFollow.lockToTarget.json b/test/golden/fixtures/body.orbitFollow.lockToTarget.json new file mode 100644 index 0000000..84785d8 --- /dev/null +++ b/test/golden/fixtures/body.orbitFollow.lockToTarget.json @@ -0,0 +1 @@ +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.744373173655,3.56096181679,17.831917398,0,0,0,1,50,0.1,1000],[1.39344826464,3.66155515388,17.7825545522,0,0,0,1,50,0.1,1000],[1.85381125229,3.81662474011,17.708037038,0,0,0,1,50,0.1,1000],[2.65924031618,4.2004625571,17.5115990088,0,0,0,1,50,0.1,1000],[3.14096819432,4.4828417355,17.3573112684,0,0,0,1,50,0.1,1000],[3.92428622005,4.98829223461,17.0466716238,0,0,0,1,50,0.1,1000],[4.35188614371,5.30208073929,16.8433411824,0,0,0,1,50,0.1,1000],[5.01831568926,5.80253700241,16.4820940842,0,0,0,1,50,0.1,1000],[5.37336900665,6.09324923608,16.2601331337,0,0,0,1,50,0.1,1000],[5.92204438573,6.53537281248,15.8789320048,0,0,0,1,50,0.1,1000],[6.21074935561,6.7831645061,15.6519751045,0,0,0,1,50,0.1,1000],[6.63382149958,7.15641054893,15.2713705292,0,0,0,1,50,0.1,1000],[6.86105300602,7.36377065323,15.0452309906,0,0,0,1,50,0.1,1000],[7.20161532783,7.67685154294,14.660540968,0,0,0,1,50,0.1,1000],[7.39256837958,7.85652350383,14.4345884267,0,0,0,1,50,0.1,1000],[7.63936695987,8.13071399285,14.0422588489,0,0,0,1,50,0.1,1000],[7.77910296109,8.29632645749,13.8063769296,0,0,0,1,50,0.1,1000],[7.94878602944,8.55816738762,13.3876439385,0,0,0,1,50,0.1,1000],[8.03960609344,8.72729189069,13.1418523282,0,0,0,1,50,0.1,1000],[8.11346528253,9.00329767303,12.7013707363,0,0,0,1,50,0.1,1000],[8.1336191838,9.17424030058,12.4499205084,0,0,0,1,50,0.1,1000],[8.06676087352,9.467503464,11.9912575573,0,0,0,1,50,0.1,1000],[7.9799532438,9.67105134784,11.7191312769,0,0,0,1,50,0.1,1000],[7.70296899845,10.0167189907,11.2271844674,0,0,0,1,50,0.1,1000],[7.47225566463,10.2441578514,10.9417858582,0,0,0,1,50,0.1,1000],[6.94301499549,10.5983388256,10.4080151739,0,0,0,1,50,0.1,1000],[6.57459802847,10.5642715048,9.81562352995,0,0,0,1,50,0.1,1000],[5.94601972321,10.1699327281,8.49548675308,0,0,0,1,50,0.1,1000],[5.55896035124,9.85427284562,7.66928885839,0,0,0,1,50,0.1,1000],[4.83434770643,9.37932411436,6.41178107104,0,0,0,1,50,0.1,1000],[4.34705719722,9.11011754273,5.7266851097,0,0,0,1,50,0.1,1000],[3.45180483518,8.71887312466,4.77276929713,0,0,0,1,50,0.1,1000],[2.867611718,8.51126649677,4.27056070389,0,0,0,1,50,0.1,1000],[1.82693148029,8.19886072847,3.58678672782,0,0,0,1,50,0.1,1000],[1.1933666419,7.98614092517,3.21944010524,0,0,0,1,50,0.1,1000],[0.107129754006,7.58455300227,2.69725273244,0,0,0,1,50,0.1,1000],[-0.520919713179,7.30947918021,2.42882659335,0,0,0,1,50,0.1,1000],[-1.54133091376,6.77459212551,2.03921899811,0,0,0,1,50,0.1,1000],[-1.62429783636,6.20274104981,1.34270459001,0,0,0,1,50,0.1,1000],[-1.01324310013,5.24940671239,0.464331735873,0,0,0,1,50,0.1,1000],[-0.475310243931,4.69504289868,0.112658979216,0,0,0,1,50,0.1,1000],[0.514593295929,3.8751703504,-0.201404776081,0,0,0,1,50,0.1,1000],[1.15517865228,3.42863405886,-0.257282582136,0,0,0,1,50,0.1,1000],[2.18082455843,2.79563935156,-0.179483909753,0,0,0,1,50,0.1,1000],[2.79060594307,2.46028712924,-0.0468646542906,0,0,0,1,50,0.1,1000],[3.7141731861,1.994644819,0.278683037578,0,0,0,1,50,0.1,1000],[4.18533346342,1.75764012119,0.611432542632,0,0,0,1,50,0.1,1000],[4.89508612415,1.41682351745,1.21502703456,0,0,0,1,50,0.1,1000],[5.27636781311,1.22994486767,1.59388996956,0,0,0,1,50,0.1,1000],[5.76822430687,0.961439396321,2.17081802744,0,0,0,1,50,0.1,1000],[6.02700905736,0.812472585062,2.47953398017,0,0,0,1,50,0.1,1000],[6.41926766701,0.597696041496,2.97155547929,0,0,0,1,50,0.1,1000],[6.71416612917,0.483620470982,3.25520328174,0,0,0,1,50,0.1,1000],[7.2280426117,0.323101857765,3.69923424566,0,0,0,1,50,0.1,1000],[7.61803584957,0.239741102588,3.93517687313,0,0,0,1,50,0.1,1000],[8.31487123735,0.126447067125,4.23858682964,0,0,0,1,50,0.1,1000],[8.82027667809,0.0657153219073,4.37564146635,0,0,0,1,50,0.1,1000],[9.69907855441,-0.0208069389381,4.49371397756,0,0,0,1,50,0.1,1000],[10.3074760963,-0.0702567762601,4.48679377859,0,0,0,1,50,0.1,1000],[11.3231780995,-0.143611046833,4.32690361822,0,0,0,1,50,0.1,1000],[11.7716599079,-0.172584911302,4.19226327846,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.orbitFollow.threeRing.json b/test/golden/fixtures/body.orbitFollow.threeRing.json new file mode 100644 index 0000000..92301dc --- /dev/null +++ b/test/golden/fixtures/body.orbitFollow.threeRing.json @@ -0,0 +1 @@ +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.627554830891,3.41211603368,18.032465731,0,0,0,1,50,0.1,1000],[0.639702102558,3.487147706,18.0335071123,0,0,0,1,50,0.1,1000],[0.665586763679,3.60346702057,18.0335056271,0,0,0,1,50,0.1,1000],[0.732120143449,3.90135159167,18.0250839601,0,0,0,1,50,0.1,1000],[0.781714932233,4.13347425802,18.0102518908,0,0,0,1,50,0.1,1000],[0.85220974546,4.56627961227,17.95943388,0,0,0,1,50,0.1,1000],[0.88273084387,4.85197205051,17.908403897,0,0,0,1,50,0.1,1000],[0.88599293193,5.33432387501,17.78191854,0,0,0,1,50,0.1,1000],[0.856809723133,5.63276266791,17.6755635385,0,0,0,1,50,0.1,1000],[0.735396912462,6.11429575694,17.4428003629,0,0,0,1,50,0.1,1000],[0.617169498578,6.4021032135,17.2616192839,0,0,0,1,50,0.1,1000],[0.33371037387,6.85341548754,16.8880730193,0,0,0,1,50,0.1,1000],[0.109864559147,7.11651489211,16.6085774622,0,0,0,1,50,0.1,1000],[-0.351681684058,7.51926193192,16.0521898602,0,0,0,1,50,0.1,1000],[-0.684249469026,7.7486689128,15.6462899427,0,0,0,1,50,0.1,1000],[-1.31709148651,8.09101443324,14.8590204093,0,0,0,1,50,0.1,1000],[-1.74692635202,8.2809896848,14.2964268117,0,0,0,1,50,0.1,1000],[-2.51970397445,8.55557209438,13.2301587564,0,0,0,1,50,0.1,1000],[-3.02000837105,8.70271687674,12.4830540499,0,0,0,1,50,0.1,1000],[-3.87650939758,8.90549902123,11.0985056064,0,0,0,1,50,0.1,1000],[-4.40582799504,9.00039718136,10.147572608,0,0,0,1,50,0.1,1000],[-5.26800532355,9.12250703599,8.42449804375,0,0,0,1,50,0.1,1000],[-5.77354662026,9.18179457401,7.26519449908,0,0,0,1,50,0.1,1000],[-6.5495350074,9.24177852892,5.21179217547,0,0,0,1,50,0.1,1000],[-6.97338488122,9.25652590133,3.85907345208,0,0,0,1,50,0.1,1000],[-7.5695541574,9.24083969894,1.51730720667,0,0,0,1,50,0.1,1000],[-7.85722095681,9.20863438382,0.00729864241662,0,0,0,1,50,0.1,1000],[-8.19472028554,9.1135263203,-2.54786616116,0,0,0,1,50,0.1,1000],[-8.31648696401,9.0104135634,-4.16341252781,0,0,0,1,50,0.1,1000],[-8.34751806067,8.82131929295,-6.83562107893,0,0,0,1,50,0.1,1000],[-8.25898347162,8.68788194037,-8.48630505532,0,0,0,1,50,0.1,1000],[-7.95449432005,8.43210855373,-11.1567777882,0,0,0,1,50,0.1,1000],[-7.66965083742,8.24944767614,-12.7740929104,0,0,0,1,50,0.1,1000],[-7.05018542771,7.89427856575,-15.3231519716,0,0,0,1,50,0.1,1000],[-6.55629237548,7.6256964349,-16.7985070593,0,0,0,1,50,0.1,1000],[-5.58506699573,7.09508290071,-18.9750038021,0,0,0,1,50,0.1,1000],[-4.91178278318,6.71815573514,-20.1616821471,0,0,0,1,50,0.1,1000],[-3.75579846965,6.03794094828,-21.8294940527,0,0,0,1,50,0.1,1000],[-2.77039259634,5.47330405309,-23.2641572174,0,0,0,1,50,0.1,1000],[-0.210090354637,4.52541965765,-25.2492885043,0,0,0,1,50,0.1,1000],[1.58007224271,3.9660157788,-26.1425720595,0,0,0,1,50,0.1,1000],[4.40002001455,3.10640023718,-27.1303328441,0,0,0,1,50,0.1,1000],[5.96102753305,2.61162181726,-27.5150809181,0,0,0,1,50,0.1,1000],[8.09956869175,1.85579602646,-27.8865111503,0,0,0,1,50,0.1,1000],[9.15518555185,1.42096006418,-28.0116702882,0,0,0,1,50,0.1,1000],[10.4478753771,0.75682132512,-28.115359629,0,0,0,1,50,0.1,1000],[10.9995761807,0.37639315772,-28.1467775603,0,0,0,1,50,0.1,1000],[11.5275622311,-0.198258872309,-28.1741109069,0,0,0,1,50,0.1,1000],[11.6467120737,-0.521548290086,-28.1869376216,0,0,0,1,50,0.1,1000],[11.4713902091,-0.996835865786,-28.2101876944,0,0,0,1,50,0.1,1000],[11.2241692725,-1.25486211812,-28.2198287237,0,0,0,1,50,0.1,1000],[10.5801389794,-1.61606105494,-28.2220875511,0,0,0,1,50,0.1,1000],[10.0392919587,-1.79996981442,-28.2086849216,0,0,0,1,50,0.1,1000],[8.92551876247,-2.03422508775,-28.1493619224,0,0,0,1,50,0.1,1000],[8.11216640339,-2.13724773182,-28.0752080141,0,0,0,1,50,0.1,1000],[6.58615412524,-2.23545547711,-27.8746848609,0,0,0,1,50,0.1,1000],[5.54162638755,-2.25393223947,-27.6867281474,0,0,0,1,50,0.1,1000],[3.67646258133,-2.2126532639,-27.2525935064,0,0,0,1,50,0.1,1000],[2.45012902374,-2.1456312991,-26.8908804166,0,0,0,1,50,0.1,1000],[0.335610745491,-1.96530718626,-26.1252052517,0,0,0,1,50,0.1,1000],[-0.571569670204,-1.86638382005,-25.7345416213,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/body.orbitFollow.worldSpace.json b/test/golden/fixtures/body.orbitFollow.worldSpace.json new file mode 100644 index 0000000..0cf822b --- /dev/null +++ b/test/golden/fixtures/body.orbitFollow.worldSpace.json @@ -0,0 +1 @@ +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.627557557914,4.0307092386,17.5299596224,0,0,0,1,50,0.1,1000],[0.640185128667,4.12268350796,17.5009972306,0,0,0,1,50,0.1,1000],[0.667326386228,4.26453761368,17.4543265821,0,0,0,1,50,0.1,1000],[0.74005449476,4.62575342448,17.3217100353,0,0,0,1,50,0.1,1000],[0.797821811859,4.90545250843,17.2045230423,0,0,0,1,50,0.1,1000],[0.89410889108,5.42373286518,16.9499389579,0,0,0,1,50,0.1,1000],[0.951119934958,5.76349461679,16.7551827027,0,0,0,1,50,0.1,1000],[1.02225968201,6.33380021408,16.3712046741,0,0,0,1,50,0.1,1000],[1.05326224289,6.68427945116,16.0969396636,0,0,0,1,50,0.1,1000],[1.06756121435,7.24695483143,15.5835331403,0,0,0,1,50,0.1,1000],[1.05832069548,7.58107589291,15.231041994,0,0,0,1,50,0.1,1000],[0.999588061635,8.10278185085,14.5915462581,0,0,0,1,50,0.1,1000],[0.943215745395,8.40495142375,14.1630707861,0,0,0,1,50,0.1,1000],[0.803371636916,8.86572602354,13.4010543771,0,0,0,1,50,0.1,1000],[0.695803700693,9.12645174191,12.8980562263,0,0,0,1,50,0.1,1000],[0.468621758099,9.5141281568,12.0142169595,0,0,0,1,50,0.1,1000],[0.305829907649,9.72791766172,11.4352011568,0,0,0,1,50,0.1,1000],[-0.0153357881417,10.0361472559,10.4233039702,0,0,0,1,50,0.1,1000],[-0.23719588435,10.2007865084,9.76123323444,0,0,0,1,50,0.1,1000],[-0.65651373675,10.428327149,8.60426444239,0,0,0,1,50,0.1,1000],[-0.944326954989,10.5353875345,7.84918268311,0,0,0,1,50,0.1,1000],[-1.46331656952,10.6771809398,6.52094873698,0,0,0,1,50,0.1,1000],[-1.79463252239,10.749756151,5.64195736848,0,0,0,1,50,0.1,1000],[-2.37069935603,10.8326864142,4.09865991994,0,0,0,1,50,0.1,1000],[-2.72976537497,10.8631444712,3.08013355905,0,0,0,1,50,0.1,1000],[-3.30294837205,10.8533337158,1.29507439544,0,0,0,1,50,0.1,1000],[-3.36089910039,10.5607961136,0.131290824324,0,0,0,1,50,0.1,1000],[-3.05506646383,9.74262253777,-1.73323000366,0,0,0,1,50,0.1,1000],[-2.7652382871,9.19441172986,-2.82742245433,0,0,0,1,50,0.1,1000],[-2.30003746712,8.37282936218,-4.53461244884,0,0,0,1,50,0.1,1000],[-2.03718070812,7.93321481885,-5.55342238764,0,0,0,1,50,0.1,1000],[-1.67636856418,7.32700639693,-7.19118149143,0,0,0,1,50,0.1,1000],[-1.47929308383,7.00832464832,-8.19545990477,0,0,0,1,50,0.1,1000],[-1.18039112823,6.54440602985,-9.82241054913,0,0,0,1,50,0.1,1000],[-0.978056514103,6.26554238154,-10.8005925015,0,0,0,1,50,0.1,1000],[-0.604046794045,5.79503045475,-12.3115278533,0,0,0,1,50,0.1,1000],[-0.34419260239,5.48870849516,-13.1786691456,0,0,0,1,50,0.1,1000],[0.10605802627,4.96297967812,-14.4620495659,0,0,0,1,50,0.1,1000],[0.660413510141,4.46047084594,-15.7301160333,0,0,0,1,50,0.1,1000],[2.55034619018,3.63589086296,-17.529653725,0,0,0,1,50,0.1,1000],[3.95776404534,3.17113391631,-18.348573607,0,0,0,1,50,0.1,1000],[6.21180606772,2.48917405566,-19.2604619288,0,0,0,1,50,0.1,1000],[7.46356598139,2.1116953674,-19.6166002621,0,0,0,1,50,0.1,1000],[9.16451942723,1.5520387615,-19.9568148603,0,0,0,1,50,0.1,1000],[9.99201081629,1.2365767019,-20.0660375433,0,0,0,1,50,0.1,1000],[10.9811285573,0.760211207623,-20.141182482,0,0,0,1,50,0.1,1000],[11.387243827,0.488848148905,-20.150758593,0,0,0,1,50,0.1,1000],[11.7471472559,0.0791298756338,-20.1336350447,0,0,0,1,50,0.1,1000],[11.8045326262,-0.151610843992,-20.1139216893,0,0,0,1,50,0.1,1000],[11.6239330714,-0.491864276023,-20.0785599614,0,0,0,1,50,0.1,1000],[11.403051643,-0.676896102828,-20.0504970753,0,0,0,1,50,0.1,1000],[10.8666788295,-0.936464408615,-19.9946289971,0,0,0,1,50,0.1,1000],[10.4347191324,-1.06849440172,-19.9510107133,0,0,0,1,50,0.1,1000],[9.57396030111,-1.23629969457,-19.8593082176,0,0,0,1,50,0.1,1000],[8.95926731817,-1.30938919594,-19.78064082,0,0,0,1,50,0.1,1000],[7.82768819127,-1.37729564623,-19.6069293152,0,0,0,1,50,0.1,1000],[7.06341182295,-1.3881216477,-19.4608845625,0,0,0,1,50,0.1,1000],[5.71359530659,-1.35291284433,-19.1466150326,0,0,0,1,50,0.1,1000],[4.83257975933,-1.30047817476,-18.8935592558,0,0,0,1,50,0.1,1000],[3.32130555168,-1.1621542474,-18.3709470298,0,0,0,1,50,0.1,1000],[2.67476287807,-1.08698585393,-18.1061753185,0,0,0,1,50,0.1,1000]]} diff --git a/test/golden/fixtures/core.blend.cut.json b/test/golden/fixtures/core.blend.cut.json index 57d0e2a..0c33316 100644 --- a/test/golden/fixtures/core.blend.cut.json +++ b/test/golden/fixtures/core.blend.cut.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[11.6287372244,3.50439713829,1.52781254696,-0.083194598335,0.888671512413,0.131400822222,0.431364608832,50,0.1,1000],[11.9005418523,3.49274545532,1.23639440317,-0.0861370506402,0.886889970743,0.132238763705,0.43418832052,50,0.1,1000],[12.3129612358,3.46152948586,0.731676306774,-0.0906866911945,0.883113234754,0.133335241052,0.44057763463,50,0.1,1000],[12.5477516381,3.43483298771,0.403387876293,-0.0934262108476,0.880311764434,0.133840639847,0.44543172726,50,0.1,1000],[12.8949534219,3.37967361865,-0.157364652936,-0.0975723259917,0.875112911699,0.134222403272,0.454578243473,50,0.1,1000],[13.0867981733,3.33926410186,-0.517589795881,-0.0999043205387,0.871630363632,0.134171621957,0.460735945846,50,0.1,1000],[13.3599537326,3.26451675542,-1.12556237485,-0.103101018128,0.865732374499,0.133488872263,0.471230683199,50,0.1,1000],[13.5038820181,3.2139957083,-1.51183199146,-0.104692128088,0.862066745461,0.13272417542,0.477770633197,50,0.1,1000],[13.6956804064,3.12651980144,-2.15669857933,-0.106610317131,0.856232734373,0.130993762506,0.488201166583,50,0.1,1000],[13.7876680408,3.07053877279,-2.56222789671,-0.107630714088,0.852735191992,0.129971944688,0.494333506165,50,0.1,1000],[13.8924119316,2.97833031965,-3.23230043613,-0.109077819617,0.847326446039,0.128524068886,0.503608465803,50,0.1,1000],[13.9294882607,2.9219601159,-3.64953295555,-0.10984613109,0.84422546695,0.127765181194,0.508815533285,50,0.1,1000],[13.9433086573,2.83329541842,-4.33200933957,-0.110874535403,0.839660716759,0.126763653269,0.516340676627,50,0.1,1000],[13.9236987285,2.78155477817,-4.75280070789,-0.111380927539,0.837176510316,0.126282087219,0.520367768029,50,0.1,1000],[13.8447780129,2.70427150306,-5.4341130345,-0.111982797047,0.833728675568,0.125726628223,0.525879419313,50,0.1,1000],[13.7680256654,2.66170450043,-5.84997238738,-0.11222680496,0.831980337096,0.125511691616,0.528640405381,50,0.1,1000],[13.596758489,2.60254630267,-6.51621574349,-0.112394434397,0.829771207748,0.125382517643,0.532096286568,50,0.1,1000],[13.463796363,2.57284106332,-6.91858647914,-0.112048376723,0.828924098501,0.125024430176,0.533571824647,50,0.1,1000],[13.2028473659,2.53688586097,-7.55599093094,-0.110593795629,0.828753320712,0.123588997638,0.534474232719,50,0.1,1000],[13.0159968221,2.52255763841,-7.93654429034,-0.109540980321,0.828951890926,0.122583718455,0.534614597752,50,0.1,1000],[12.6702407187,2.51277416776,-8.53194376957,-0.107286014113,0.829387163707,0.120581780602,0.534852015085,50,0.1,1000],[12.4331403143,2.51494147747,-8.88285648546,-0.105527864537,0.829715292506,0.119095960042,0.535025752174,50,0.1,1000],[12.0094933665,2.53191862736,-9.42411089548,-0.102125189939,0.830326357015,0.116352727786,0.535341600441,50,0.1,1000],[12.1603682358,2.55019712549,-9.73830331953,-0.0955422711275,0.852508575992,0.121679729724,0.499294347717,50,0.1,1000],[13.7535988455,2.59207936135,-10.214643466,-0.062211628631,0.92740882159,0.15196180774,0.336080644917,50,0.1,1000],[14.936386524,2.62460898986,-10.4859649933,-0.042049713625,0.95326682466,0.183049147997,0.236658386717,50,0.1,1000],[16.6256567867,2.68725328223,-10.8882486263,-0.0758114986093,0.952221642767,0.199181756975,0.218753714055,50,0.1,1000],[17.4268634209,2.73086173909,-11.1116087876,-0.0822287864,0.945597259053,0.194698955833,0.247338971771,50,0.1,1000],[18.1216126115,2.8988013766,-10.8410168825,-0.176307370341,0.828760648288,0.0744312008841,0.525862620223,50,0.1,1000],[18.3851902948,2.94049478982,-11.342230669,-0.162792122106,0.836543909236,0.0605030529147,0.519646411984,50,0.1,1000],[18.5491923525,3.01379604106,-12.0932371144,-0.146824922071,0.848695019234,0.0491782585209,0.50570812281,50,0.1,1000],[18.5040495666,3.06142584076,-12.5167002972,-0.138843405166,0.856253359592,0.0464802381212,0.495370851478,50,0.1,1000],[18.2255512665,3.14073905202,-13.1375097512,-0.127218537,0.868804106734,0.046476035455,0.476271819547,50,0.1,1000],[17.9471804938,3.18977099968,-13.4788172312,-0.120371700413,0.876666137047,0.0483501743176,0.463281122579,50,0.1,1000],[17.353652875,3.26745718715,-13.9639855532,-0.109262193677,0.889506454442,0.053485250701,0.440430889581,50,0.1,1000],[16.91706698,3.31311740075,-14.2207876285,-0.102239653654,0.897374968174,0.0575652000149,0.425383905976,50,0.1,1000],[16.1182612198,3.38153565343,-14.568067427,-0.0903957020749,0.909912403051,0.0651628488202,0.399552047866,50,0.1,1000],[15.5826677904,3.41929080756,-14.7398772805,-0.0827636222081,0.91740781247,0.0702160364383,0.382861328269,50,0.1,1000],[14.6608815859,3.47159136589,-14.9498278371,-0.0698321953497,0.929057911939,0.0786681329358,0.354663482214,50,0.1,1000],[14.0691511712,3.49763364109,-15.0377376694,-0.0615342089577,0.935853027478,0.0838633815503,0.33668915237,50,0.1,1000],[13.0827348837,3.52851320346,-15.1132026143,-0.0476265323035,0.946156261612,0.0920033053067,0.306684583645,50,0.1,1000],[12.4648538345,3.54019355239,-15.119531083,-0.0388365060212,0.952015719499,0.0967112477326,0.287758110553,50,0.1,1000],[11.4543712878,3.54651977885,-15.0650326662,-0.0243789132889,0.960672268425,0.103647598111,0.256459814925,50,0.1,1000],[10.8311563838,3.54267296951,-14.9929412903,-0.0154364976948,0.965461202364,0.107395170996,0.236881106288,50,0.1,1000],[9.82487619389,3.52389146989,-14.8140635203,-0.00108210088158,0.972329850456,0.112487992457,0.20474360191,50,0.1,1000],[9.40925954476,3.51170673539,-14.7177652213,0.00478172315879,0.974860530405,0.114217626734,0.191254843402,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[11.6180517536,3.51331530661,1.51178434074,-0.0830451501177,0.888860548001,0.131786459843,0.430886015382,50,0.1,1000],[11.8916540823,3.50147267883,1.22306274822,-0.0860445709646,0.887135772602,0.132684687914,0.43356801816,50,0.1,1000],[12.3066505811,3.46876599844,0.72221032464,-0.0906477220298,0.883418775056,0.133827699705,0.439823152143,50,0.1,1000],[12.5427412529,3.44094632112,0.395872298573,-0.0934111151135,0.880638034732,0.134340087059,0.444638905591,50,0.1,1000],[12.8915853193,3.38408918521,-0.162416806798,-0.0975848438418,0.875445938287,0.13470188093,0.453791814232,50,0.1,1000],[13.0841910703,3.34279635449,-0.521500450423,-0.0999305144062,0.87195369684,0.134626375494,0.459985197456,50,0.1,1000],[13.3582569344,3.26691325537,-1.12810757213,-0.103141695269,0.866024303715,0.133889434921,0.470571264835,50,0.1,1000],[13.5025894349,3.21585896879,-1.51377086626,-0.10473834122,0.862333245619,0.133087187154,0.477178220369,50,0.1,1000],[13.6948569251,3.12773950525,-2.1579338013,-0.106675536138,0.856449897867,0.131315064686,0.487719444168,50,0.1,1000],[13.7870475927,3.07147062753,-2.56315856887,-0.107711964767,0.852919928307,0.13027754153,0.493916481518,50,0.1,1000],[13.892022605,2.97892633845,-3.23288442603,-0.1091813822,0.847461873881,0.128807974933,0.503285509122,50,0.1,1000],[13.9291972702,2.9224101104,-3.64996944133,-0.109961321072,0.844333745616,0.128038035933,0.508542323938,50,0.1,1000],[13.9431281194,2.83357859927,-4.33228014647,-0.111005210325,0.839731231652,0.127022092539,0.51613437192,50,0.1,1000],[13.923564614,2.78176675852,-4.75300187961,-0.111519357678,0.837227661477,0.126533511766,0.520194719428,50,0.1,1000],[13.8446955324,2.70440330854,-5.43423675533,-0.112131265276,0.833754308384,0.125969205408,0.525749076925,50,0.1,1000],[13.7679646884,2.66180252989,-5.85006385289,-0.112380176751,0.831993470974,0.12575006316,0.52853049273,50,0.1,1000],[13.59672125,2.60260669438,-6.51627160206,-0.112554170482,0.829768409793,0.125615541807,0.532011917605,50,0.1,1000],[13.4637689395,2.57288575255,-6.91862761435,-0.112179315543,0.828929633234,0.12521237256,0.533491636362,50,0.1,1000],[13.2028307138,2.53691319072,-7.55601590912,-0.110700487869,0.828760892998,0.123737292081,0.534406087887,50,0.1,1000],[13.0159845985,2.52257778005,-7.93656262574,-0.109629922338,0.828961606028,0.122708197951,0.534552742034,50,0.1,1000],[12.6667999145,2.52766455249,-8.52966590567,-0.107375091812,0.829397129213,0.120710954128,0.534789544835,50,0.1,1000],[12.428787885,2.53378756322,-8.87996658336,-0.105670765978,0.829714760704,0.119287044446,0.534955798281,50,0.1,1000],[12.005219332,2.55043077847,-9.42126859195,-0.102408773521,0.830300147976,0.116690620805,0.53525452487,50,0.1,1000],[12.1565561132,2.566710006,-9.73576705584,-0.0958092656181,0.85243531133,0.122075986256,0.499271547555,50,0.1,1000],[13.7506878897,2.60468972388,-10.2127059188,-0.0623101191827,0.927293514087,0.152615976369,0.336084143537,50,0.1,1000],[14.9340031127,2.6349343543,-10.484378305,-0.0420774132291,0.953106104936,0.183899778112,0.236641322764,50,0.1,1000],[16.6239945012,2.69445487779,-10.8871417831,-0.076045635233,0.95203909777,0.20013985982,0.218592438548,50,0.1,1000],[17.4255542611,2.73653357237,-11.1107369947,-0.0825107649097,0.94542191524,0.195599192781,0.247205039678,50,0.1,1000],[18.0952332671,2.9963854948,-11.1315038307,-0.15151151356,0.845116726096,0.0978531899856,0.50323626036,50,0.1,1000],[18.3605204934,3.03022459083,-11.6678476069,-0.142552587946,0.851379470478,0.0794458682798,0.498517914354,50,0.1,1000],[18.5308064163,3.0899578555,-12.4509017104,-0.133535398756,0.860968033485,0.0617230287209,0.486921564856,50,0.1,1000],[18.4926971369,3.12881774552,-12.8777301928,-0.129775895667,0.866814098551,0.0554124352079,0.478247841062,50,0.1,1000],[18.2289320355,3.19331195718,-13.48433787,-0.124730107162,0.876604607828,0.0501297953414,0.462053855649,50,0.1,1000],[17.9615613719,3.23300429082,-13.8073587478,-0.121870431846,0.88280872559,0.0490504041352,0.450988258958,50,0.1,1000],[17.3878062417,3.29500812369,-14.2528663532,-0.116914363694,0.893165311089,0.0499684217028,0.431381403704,50,0.1,1000],[16.9637963011,3.3309603642,-14.4824332025,-0.113561507467,0.899678445852,0.0517797961636,0.418331603876,50,0.1,1000],[16.1857603865,3.38318033999,-14.7834030705,-0.107266182219,0.910347988712,0.0562902296091,0.395716964067,50,0.1,1000],[15.6620583635,3.41111921262,-14.928361527,-0.102852969819,0.91693396274,0.0597938876928,0.380891146613,50,0.1,1000],[14.7587495563,3.44723697829,-15.0971553759,-0.0946220576047,0.927479196001,0.0663151422105,0.355571805848,50,0.1,1000],[14.1766206581,3.46374185047,-15.1635490655,-0.088925554018,0.933841563612,0.070670502163,0.339172316143,50,0.1,1000],[13.2043048407,3.47918955783,-15.2082180687,-0.0785881800887,0.943777885345,0.077978045115,0.311490971882,50,0.1,1000],[12.5928734014,3.48209575712,-15.1999139038,-0.0716037802545,0.949620508699,0.0824902171063,0.293750152669,50,0.1,1000],[11.5911867071,3.47458754845,-15.1257014311,-0.0593076202291,0.958496601904,0.089544227439,0.264099794876,50,0.1,1000],[10.9710442713,3.46324036449,-15.0453635134,-0.0512144672729,0.963562843211,0.0936211903803,0.245272905632,50,0.1,1000],[9.9682532412,3.43305556635,-14.8561700896,-0.0373878157261,0.971011767135,0.0995552009755,0.21407256078,50,0.1,1000],[9.55263618518,3.41693003111,-14.757609751,-0.0314191710372,0.973825281601,0.101743962116,0.20081165997,50,0.1,1000]]} diff --git a/test/golden/fixtures/core.blend.cylindrical.json b/test/golden/fixtures/core.blend.cylindrical.json index 58a2d10..8f67fcd 100644 --- a/test/golden/fixtures/core.blend.cylindrical.json +++ b/test/golden/fixtures/core.blend.cylindrical.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[8.66665899865,3.64105334811,13.2420292356,-0.109534396407,0.0914133262475,0.0614647718162,0.987860264214,50,0.1,1000],[8.75780947499,3.6397540871,13.147157262,-0.109760128523,0.0973536989056,0.0627280543886,0.987188007772,50,0.1,1000],[9.12570123814,3.6332775023,12.7438397823,-0.110643417615,0.121618301867,0.0676546109756,0.984068024276,50,0.1,1000],[9.46998441816,3.62545019631,12.3360887451,-0.11146572033,0.145232248048,0.0721675948903,0.980446237978,50,0.1,1000],[10.1698804404,3.60362996698,11.4084432278,-0.113148387737,0.196880355864,0.0812376945392,0.970482356776,50,0.1,1000],[10.6582319237,3.58292862644,10.6718471151,-0.114325451858,0.236500992837,0.0875366254631,0.960902862233,50,0.1,1000],[11.4807018256,3.53466330832,9.22124300333,-0.116195227924,0.311936702641,0.0981261740094,0.937851489591,50,0.1,1000],[11.9752660201,3.49475546371,8.18260443252,-0.117139361112,0.36410445772,0.104435409882,0.918041153277,50,0.1,1000],[12.7041614699,3.41236303524,6.30330195537,-0.117936709991,0.45419951674,0.113421203978,0.875745032483,50,0.1,1000],[13.0868288699,3.35088241571,5.05212063623,-0.117975526621,0.510482655701,0.117829136348,0.843567144912,50,0.1,1000],[13.5712047093,3.23550016514,2.93238236851,-0.117336773854,0.597311400424,0.122772655529,0.783822714318,50,0.1,1000],[13.7793859225,3.15655920438,1.60444279994,-0.116616888113,0.64545063717,0.124494329769,0.744509998751,50,0.1,1000],[13.9703437747,3.02065980064,-0.518679902684,-0.115255303306,0.711462989984,0.125663169635,0.681722375121,50,0.1,1000],[14.0046115093,2.93537684557,-1.77410294081,-0.114466446887,0.744094970902,0.125756966854,0.646069107838,50,0.1,1000],[13.9443469245,2.80191324965,-3.66276718737,-0.113457934889,0.784341277816,0.125549537994,0.596802622677,50,0.1,1000],[13.8502591643,2.72686685286,-4.70334600274,-0.113034255441,0.802026133183,0.125407214635,0.57293138272,50,0.1,1000],[13.6325900391,2.62524066655,-6.12984050988,-0.112590818178,0.820582440017,0.125346958761,0.546128104686,50,0.1,1000],[13.4747828875,2.57917454765,-6.81184520115,-0.112091443686,0.82650651451,0.125019068315,0.53730133285,50,0.1,1000],[13.2028473659,2.53688586097,-7.55599093094,-0.110593795629,0.828753320712,0.123588997638,0.534474232719,50,0.1,1000],[13.0159968221,2.52255763841,-7.93654429034,-0.109540980321,0.828951890926,0.122583718455,0.534614597752,50,0.1,1000],[12.6702407187,2.51277416776,-8.53194376957,-0.107286014113,0.829387163707,0.120581780602,0.534852015085,50,0.1,1000],[12.4331403143,2.51494147747,-8.88285648546,-0.105527864537,0.829715292506,0.119095960042,0.535025752174,50,0.1,1000],[12.0094933665,2.53191862736,-9.42411089548,-0.102125189939,0.830326357015,0.116352727786,0.535341600441,50,0.1,1000],[12.1603682358,2.55019712549,-9.73830331953,-0.0955422711275,0.852508575992,0.121679729724,0.499294347717,50,0.1,1000],[13.7535988455,2.59207936135,-10.214643466,-0.062211628631,0.92740882159,0.15196180774,0.336080644917,50,0.1,1000],[14.936386524,2.62460898986,-10.4859649933,-0.042049713625,0.95326682466,0.183049147997,0.236658386717,50,0.1,1000],[16.6256567867,2.68725328223,-10.8882486263,-0.0758114986093,0.952221642767,0.199181756975,0.218753714055,50,0.1,1000],[17.4268634209,2.73086173909,-11.1116087876,-0.0822287864,0.945597259053,0.194698955833,0.247338971771,50,0.1,1000],[17.6509647401,2.74704266635,-11.1762344569,-0.084167497006,0.943107727646,0.191852080288,0.258179057618,50,0.1,1000],[17.6746853795,2.75096301506,-11.1830581542,-0.0858611292005,0.941562779679,0.189163303477,0.265150227294,50,0.1,1000],[17.7507651911,2.76579732552,-11.249245148,-0.0891476113783,0.937567075845,0.179621645411,0.284177314676,50,0.1,1000],[17.8098115041,2.78180653439,-11.3392439277,-0.0907177591869,0.93455658805,0.170645700951,0.298754609416,50,0.1,1000],[17.8864565462,2.8212953353,-11.5815602202,-0.0914254984698,0.929785862784,0.15290904443,0.322115587529,50,0.1,1000],[17.8971290945,2.85469397431,-11.7926968408,-0.0905551230613,0.927455071447,0.141382969196,0.334122307181,50,0.1,1000],[17.8056293488,2.92362301658,-12.2275825481,-0.0873037932078,0.925460449481,0.124127842497,0.347121423792,50,0.1,1000],[17.6589579918,2.97453861068,-12.5428951405,-0.084404521298,0.925531195665,0.115209566331,0.350705914494,50,0.1,1000],[17.2383545842,3.06802206463,-13.1017156945,-0.0785378432155,0.927789393857,0.104341557327,0.349501770015,50,0.1,1000],[16.8550018059,3.13028830146,-13.4563279848,-0.0742159246786,0.930370895413,0.099927772928,0.344842621628,50,0.1,1000],[16.024704839,3.23360216919,-14.0056755612,-0.0659145935121,0.936117486497,0.0962526009825,0.331775156757,50,0.1,1000],[15.3910714367,3.29568369566,-14.3063769989,-0.0598888093791,0.940381443062,0.0958658994596,0.320789341121,50,0.1,1000],[14.1958627594,3.38735188682,-14.6931159881,-0.0485041717156,0.948018769121,0.0976684239012,0.298945877533,50,0.1,1000],[13.3824827017,3.43511316531,-14.8541056956,-0.0404998714458,0.952932535942,0.0998923778555,0.283374055273,50,0.1,1000],[12.0039757224,3.49249905421,-14.9725727673,-0.0261647214705,0.96083394317,0.104562391754,0.255304224863,50,0.1,1000],[11.1598828913,3.513114913,-14.9587028943,-0.0167637511796,0.96546828421,0.10769461161,0.236625948411,50,0.1,1000],[9.8869864447,3.51904196402,-14.8131866563,-0.00140508193048,0.972314380796,0.112494007413,0.204811789061,50,0.1,1000],[9.41855817866,3.51102208976,-14.7179387246,0.00472921901273,0.97485759966,0.114216488933,0.191271766154,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.70099189406,3.57625779469,13.2541286947,-0.105474107517,0.0935341671146,0.0670670018245,0.987739130283,50,0.1,1000],[8.8127432812,3.57559924334,13.1831408414,-0.10532117853,0.100264509028,0.0681693256509,0.987019463143,50,0.1,1000],[9.26140327792,3.57159156708,12.8673104878,-0.104706459743,0.127442696861,0.0723450983134,0.983646838583,50,0.1,1000],[9.67978842277,3.56600562207,12.5315413806,-0.104131163922,0.153461168444,0.0759942986119,0.97970977185,50,0.1,1000],[10.526702392,3.5487253642,11.7241076288,-0.102981089199,0.209002317655,0.0827935472953,0.968946930956,50,0.1,1000],[11.1136737201,3.53127322713,11.0510793609,-0.102231505188,0.250423829959,0.0870762160224,0.958777532767,50,0.1,1000],[12.0895231461,3.48883250451,9.66799951418,-0.101160888244,0.326744306247,0.0934447446118,0.93502551448,50,0.1,1000],[12.6637751722,3.45277558434,8.64372293545,-0.100722434428,0.377847352639,0.0967541231055,0.915273188162,50,0.1,1000],[13.47903321,3.37689081514,6.7426029686,-0.100596033865,0.4637002427,0.100956927618,0.874454242174,50,0.1,1000],[13.881297919,3.31950031454,5.45415370893,-0.101088287397,0.516371034561,0.102980537055,0.84411913958,50,0.1,1000],[14.3367697804,3.21070756073,3.24888790627,-0.102821352672,0.597407340995,0.105875580067,0.78824019176,50,0.1,1000],[14.4911421747,3.13571182547,1.86125034285,-0.104305336112,0.64285994569,0.107707456362,0.75116615401,50,0.1,1000],[14.5477228927,3.00583922884,-0.354813705697,-0.106949373572,0.706739675943,0.111158936876,0.69045242609,50,0.1,1000],[14.4796009954,2.92394810216,-1.65916378921,-0.108488086846,0.739338500075,0.113616194433,0.654752073446,50,0.1,1000],[14.2439467577,2.79527376792,-3.60752289117,-0.110521701781,0.780833018061,0.11790055624,0.60347676855,50,0.1,1000],[14.0484874392,2.72264462872,-4.67245476521,-0.111416514992,0.799611853276,0.120449315017,0.577667038007,50,0.1,1000],[13.7002679454,2.62388295239,-6.1215780525,-0.112265480476,0.819739694417,0.123843855215,0.547801054048,50,0.1,1000],[13.4933683908,2.57883457332,-6.80981984708,-0.112103477159,0.826282870708,0.124740150337,0.537707469612,50,0.1,1000],[13.2028307138,2.53691319072,-7.55601590912,-0.110700487869,0.828760892998,0.123737292081,0.534406087887,50,0.1,1000],[13.0159845985,2.52257778005,-7.93656262574,-0.109629922338,0.828961606028,0.122708197951,0.534552742034,50,0.1,1000],[12.6667999145,2.52766455249,-8.52966590567,-0.107375091812,0.829397129213,0.120710954128,0.534789544835,50,0.1,1000],[12.428787885,2.53378756322,-8.87996658336,-0.105670765978,0.829714760704,0.119287044446,0.534955798281,50,0.1,1000],[12.005219332,2.55043077847,-9.42126859195,-0.102408773521,0.830300147976,0.116690620805,0.53525452487,50,0.1,1000],[12.1565561132,2.566710006,-9.73576705584,-0.0958092656181,0.85243531133,0.122075986256,0.499271547555,50,0.1,1000],[13.7506878897,2.60468972388,-10.2127059188,-0.0623101191827,0.927293514087,0.152615976369,0.336084143537,50,0.1,1000],[14.9340031127,2.6349343543,-10.484378305,-0.0420774132291,0.953106104936,0.183899778112,0.236641322764,50,0.1,1000],[16.6239945012,2.69445487779,-10.8871417831,-0.076045635233,0.95203909777,0.20013985982,0.218592438548,50,0.1,1000],[17.4255542611,2.73653357237,-11.1107369947,-0.0825107649097,0.94542191524,0.195599192781,0.247205039678,50,0.1,1000],[17.6465158312,2.75310373332,-11.1793703036,-0.084052312446,0.94308695567,0.192927305787,0.257490305641,50,0.1,1000],[17.6616978763,2.75849307329,-11.1933208894,-0.0850790306902,0.941858508426,0.190667839518,0.263267703328,50,0.1,1000],[17.7105611534,2.77635723815,-11.2729993898,-0.0872917441197,0.938670717169,0.182224601693,0.279413010929,50,0.1,1000],[17.7454841158,2.79415613964,-11.3685963277,-0.0886163130886,0.936217918464,0.174010320543,0.292170440919,50,0.1,1000],[17.7761806111,2.83559335354,-11.6093258005,-0.0900885256592,0.932137995055,0.157140895718,0.313543545002,50,0.1,1000],[17.7583501647,2.8692588573,-11.8108087888,-0.0904726661803,0.929952834332,0.145655203485,0.325249111128,50,0.1,1000],[17.6289564801,2.93647031567,-12.2155398891,-0.0902873776312,0.927630029592,0.12744202203,0.339277539281,50,0.1,1000],[17.4682236076,2.98486028091,-12.5054329852,-0.0897915111325,0.927192290971,0.117329788259,0.344217461613,50,0.1,1000],[17.0462823805,3.07143829541,-13.0182263821,-0.0883651360735,0.928309098226,0.103831042117,0.345908854427,50,0.1,1000],[16.6764976511,3.12786972852,-13.3469915651,-0.0870543645754,0.930125573597,0.0975406814925,0.343181832857,50,0.1,1000],[15.8911461933,3.21894947003,-13.8667744058,-0.0838462808963,0.934721297894,0.090751073556,0.333211853167,50,0.1,1000],[15.2959471368,3.27230075232,-14.1621526684,-0.0810243547032,0.938437656407,0.0885507586788,0.323926815994,50,0.1,1000],[14.1731499438,3.34786676369,-14.5634727196,-0.0746343058589,0.945524463671,0.0878041225916,0.304472732843,50,0.1,1000],[13.4041509885,3.38539193422,-14.7485373194,-0.0694667936474,0.950351531389,0.0887943841255,0.290037736709,50,0.1,1000],[12.0887580916,3.42577231018,-14.9207302064,-0.0589762398733,0.958466464144,0.0920982819283,0.263404150893,50,0.1,1000],[11.2727921387,3.43682246199,-14.943466155,-0.0513286261486,0.963428962717,0.0948343615467,0.245308886521,50,0.1,1000],[10.0264526748,3.42880475098,-14.8425203954,-0.0374971128278,0.970963215329,0.0997175877342,0.214198047854,50,0.1,1000],[9.5614179669,3.41633477424,-14.7558798099,-0.0314406322756,0.973817089955,0.10176537768,0.200837172503,50,0.1,1000]]} diff --git a/test/golden/fixtures/core.blend.damped.json b/test/golden/fixtures/core.blend.damped.json index 42cad9e..4a84eb3 100644 --- a/test/golden/fixtures/core.blend.damped.json +++ b/test/golden/fixtures/core.blend.damped.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[8.66520436172,3.64092838883,13.23063996,-0.109643970586,0.0914775420934,0.0614282124032,0.98784443802,50,0.1,1000],[8.73255540347,3.63784477922,12.9819951213,-0.111418278438,0.098004936227,0.0621098841367,0.986976880174,50,0.1,1000],[8.99537029604,3.62467815658,12.1014280965,-0.118034368464,0.12289160906,0.0649200053258,0.983234932858,50,0.1,1000],[9.23404441159,3.61070653771,11.3537202743,-0.124144449473,0.146322310097,0.0678874084965,0.979065491681,50,0.1,1000],[9.70754273777,3.57649514133,9.93403404336,-0.136811984343,0.197126501755,0.075288652837,0.967861168763,50,0.1,1000],[10.0333551576,3.54751851107,8.97915341302,-0.145763647071,0.236284336598,0.0817475186129,0.957204270086,50,0.1,1000],[10.5833397684,3.48704880039,7.36744519209,-0.160055717408,0.311479481641,0.0954415853371,0.931801268313,50,0.1,1000],[10.920836584,3.44180716906,6.36030872658,-0.167209300774,0.363468418884,0.105410122684,0.910395773411,50,0.1,1000],[11.4421267029,3.35685365912,4.73828310946,-0.173331869331,0.45135563508,0.121850103143,0.866825649205,50,0.1,1000],[11.7380623883,3.29864848209,3.75835925586,-0.173270372016,0.503930411552,0.130669573258,0.836036471166,50,0.1,1000],[12.162624774,3.19747946385,2.21678142282,-0.16793725144,0.580285020522,0.140715328054,0.78438866067,50,0.1,1000],[12.3855200957,3.13271011869,1.3022335853,-0.162650767758,0.620020747992,0.1440106321,0.753909767578,50,0.1,1000],[12.676933293,3.02695760036,-0.117545914292,-0.153090968771,0.672089033484,0.145537313162,0.709703020163,50,0.1,1000],[12.8120883135,2.96311117994,-0.950728803953,-0.147408984099,0.697324714413,0.144873662459,0.686309300535,50,0.1,1000],[12.956646505,2.86477634081,-2.23344261556,-0.139252150545,0.72929140853,0.142495409269,0.654551707927,50,0.1,1000],[13.0007156663,2.80885345113,-2.98068627074,-0.134993909775,0.744600256949,0.140706785448,0.638395412111,50,0.1,1000],[12.9993358176,2.72825102189,-4.12405427866,-0.12923324676,0.764134829115,0.137872940604,0.616755853733,50,0.1,1000],[12.9559334931,2.68580056612,-4.78619348657,-0.125988419595,0.77379677569,0.135986749962,0.605700480349,50,0.1,1000],[12.8180915909,2.63042607395,-5.79368746174,-0.120830016991,0.787108641565,0.132432915148,0.590187780586,50,0.1,1000],[12.6947023739,2.60507764119,-6.37370238795,-0.117983518551,0.793869700803,0.130285786578,0.582130914239,50,0.1,1000],[12.434379513,2.5791512903,-7.25070569765,-0.113447103922,0.802775127763,0.126727133645,0.571508602258,50,0.1,1000],[12.2403874895,2.57248554345,-7.75204975721,-0.110597483313,0.807251300602,0.124445572081,0.566239202061,50,0.1,1000],[11.873589797,2.57693486834,-8.50398439111,-0.105818707042,0.813245324535,0.120633524266,0.5593585578,50,0.1,1000],[12.0372814832,2.58856735298,-8.92982920659,-0.0991013059426,0.838758536851,0.125881412284,0.520400728344,50,0.1,1000],[13.6118071974,2.62128659867,-9.56140529562,-0.0668002166339,0.919771296933,0.157804457384,0.353066913807,50,0.1,1000],[14.7852573698,2.64908893085,-9.9144010125,-0.0471153749496,0.948051846693,0.190402406979,0.250449118269,50,0.1,1000],[16.474266897,2.70538385055,-10.4294845351,-0.0805251901415,0.947275644232,0.206471723748,0.231417317609,50,0.1,1000],[17.2829867895,2.74580190454,-10.711795942,-0.0866068603647,0.940700238469,0.200667905498,0.259450775265,50,0.1,1000],[17.5165105724,2.76265545338,-10.7985142747,-0.0895687629487,0.937386569316,0.196153094161,0.273510182664,50,0.1,1000],[17.5560834147,2.77050569378,-10.8301702384,-0.0927770847787,0.93437833725,0.190286230889,0.286567070252,50,0.1,1000],[17.6559105887,2.79676138104,-10.9866121501,-0.0974931295008,0.927921987745,0.17314267574,0.315400520287,50,0.1,1000],[17.7100702342,2.82202609118,-11.1527448979,-0.0989193697068,0.923991271571,0.159893297875,0.333000332811,50,0.1,1000],[17.7260777833,2.87721360164,-11.5192719967,-0.0984193077999,0.919311968722,0.138645907284,0.354903446602,50,0.1,1000],[17.6676518931,2.91891494445,-11.7902372628,-0.0967047366459,0.917926395322,0.127340483872,0.363102916333,50,0.1,1000],[17.4337078381,2.99587375717,-12.2704139419,-0.0923151882094,0.918302806355,0.113301048774,0.36791403101,50,0.1,1000],[17.1988825572,3.04708474926,-12.5752567318,-0.088813249152,0.920001137852,0.107343486189,0.366316105433,50,0.1,1000],[16.6736961056,3.13216498224,-13.0560425831,-0.0819700191053,0.924683405363,0.101601313852,0.357657222543,50,0.1,1000],[16.2684584338,3.18377366803,-13.3322443045,-0.0770324678255,0.928478426823,0.100084788281,0.349251836043,50,0.1,1000],[15.496597227,3.26228310038,-13.7290163261,-0.0678496608706,0.935625872324,0.100161218697,0.331614807911,50,0.1,1000],[14.9619149995,3.30579440883,-13.9354497081,-0.0614753155461,0.94040451691,0.101376180255,0.318720881383,50,0.1,1000],[14.0196601088,3.36556440476,-14.1985272243,-0.0500652583286,0.948389325524,0.104594688436,0.295145910173,50,0.1,1000],[13.4039730506,3.39471570552,-14.3139659015,-0.0424449715311,0.953283707728,0.107033250618,0.279271338011,50,0.1,1000],[12.3664153041,3.42788380505,-14.4215998978,-0.0293336487868,0.960928393331,0.111238932528,0.251757938959,50,0.1,1000],[11.7120508379,3.43929945651,-14.4390492032,-0.0209146107908,0.965350282497,0.113759251038,0.233923585687,50,0.1,1000],[10.6397685356,3.44278887623,-14.3878063942,-0.00698846835029,0.971908310423,0.117403168789,0.20386734265,50,0.1,1000],[10.1927688338,3.43891114235,-14.3382904294,-0.00117177519724,0.974384389939,0.118680483531,0.191019973864,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.69811533069,3.57620023969,13.2411038008,-0.105608807913,0.0935420887483,0.0670126607251,0.987727675337,50,0.1,1000],[8.76460396757,3.5746365078,12.9919704427,-0.107389533816,0.100018324723,0.0673027431713,0.986881028041,50,0.1,1000],[9.02474710864,3.56644313724,12.1101019848,-0.114060636891,0.124720467687,0.0687586138607,0.983212707949,50,0.1,1000],[9.26141804815,3.5563326673,11.3615661263,-0.120254451023,0.147989588422,0.0705939185835,0.979109006897,50,0.1,1000],[9.7315338254,3.52877784297,9.94069178739,-0.133195170669,0.19846205872,0.075878064203,0.968046681277,50,0.1,1000],[10.0552962901,3.50388315951,8.98518675047,-0.14243826916,0.237370018016,0.0809507229098,0.957503939671,50,0.1,1000],[10.6021301718,3.44971826916,7.37261001349,-0.157466268728,0.312092538619,0.092470701996,0.93233673682,50,0.1,1000],[10.9378209742,3.40809563814,6.3650058403,-0.165241500145,0.363769968406,0.101281049628,0.911103070844,50,0.1,1000],[11.4564314026,3.32850683351,4.74230190248,-0.17255645685,0.451198438067,0.116410991216,0.867809149415,50,0.1,1000],[11.7508729748,3.27328715246,3.76199961771,-0.173233650666,0.503564684165,0.124858854639,0.837151705223,50,0.1,1000],[12.1732673513,3.17644038371,2.21986334223,-0.168882380387,0.579739635021,0.134959999259,0.785599449962,50,0.1,1000],[12.3949778185,3.11402780737,1.30500295417,-0.164007662576,0.6194477823,0.13858318934,0.755103060021,50,0.1,1000],[12.6847013314,3.01162935251,-0.115233850348,-0.154808998331,0.671553363877,0.140873558447,0.710777668495,50,0.1,1000],[12.8189475643,2.94958359772,-0.948669020234,-0.149200365334,0.69683674199,0.140725698955,0.687280207521,50,0.1,1000],[12.9622276553,2.85377741182,-2.2317456933,-0.141008179997,0.728891086635,0.139148019763,0.655341365697,50,0.1,1000],[13.0056181435,2.79919552856,-2.97918598096,-0.136670276362,0.744251753929,0.13780475676,0.639077781923,50,0.1,1000],[13.0032943094,2.72045648534,-4.12283211434,-0.130737426204,0.763860593088,0.135598980798,0.617282460566,50,0.1,1000],[12.9593957934,2.67898467096,-4.78511966863,-0.127344397963,0.773576028069,0.134007367076,0.606139883751,50,0.1,1000],[12.8208697245,2.62495870186,-5.79282059389,-0.121969796124,0.786948363786,0.130871280241,0.590515325436,50,0.1,1000],[12.6971237667,2.60031304761,-6.37294451612,-0.118995071973,0.793740153108,0.128935442804,0.582402261139,50,0.1,1000],[12.4330809697,2.589351557,-7.24794396168,-0.114299513201,0.802681262931,0.125697210466,0.571698017053,50,0.1,1000],[12.2379423969,2.58705569683,-7.7487708393,-0.111418346647,0.807162931762,0.123637036473,0.566381352828,50,0.1,1000],[11.8708275118,2.59206434819,-8.50083117418,-0.106659612436,0.813150731641,0.120185601257,0.559432780553,50,0.1,1000],[12.0347632647,2.60221897522,-8.92701272724,-0.0998998232722,0.838625340104,0.125612474234,0.520527684722,50,0.1,1000],[13.6098953871,2.63174068369,-9.55922926468,-0.0674201518293,0.919621621408,0.158031108288,0.35323754809,50,0.1,1000],[14.783725483,2.65760421202,-9.91259959405,-0.0476100788777,0.947873339001,0.190956323358,0.25060944948,50,0.1,1000],[16.4732629869,2.71121617741,-10.4281990915,-0.0811315223427,0.947067449678,0.207180068041,0.231424590847,50,0.1,1000],[17.2822403468,2.75031646998,-10.7107660682,-0.0872068460815,0.940502099048,0.201327834489,0.25945687646,50,0.1,1000],[17.515288493,2.76878887961,-10.803771298,-0.0893197410542,0.937381457428,0.197154096804,0.272888712192,50,0.1,1000],[17.553973908,2.77976696031,-10.8487498837,-0.0912710861926,0.934773730526,0.191760088602,0.284773120156,50,0.1,1000],[17.6526525574,2.81140970077,-11.0379750417,-0.0942541311993,0.929284069233,0.175142060649,0.311243531681,50,0.1,1000],[17.7071901312,2.83923439308,-11.2265720005,-0.0953798839398,0.925934775422,0.161862855092,0.327639871728,50,0.1,1000],[17.726654352,2.89629216719,-11.6255797543,-0.0959326873789,0.921825658628,0.139809745851,0.348550727372,50,0.1,1000],[17.6725515236,2.93752883976,-11.9112678435,-0.0957409517644,0.920470170181,0.12754067805,0.356793653818,50,0.1,1000],[17.4492335138,3.01090378231,-12.4042728801,-0.0948086121965,0.920413491785,0.111392659074,0.362549316228,50,0.1,1000],[17.2228251073,3.05834124674,-12.7106694045,-0.0938928685945,0.921630564965,0.103923332629,0.361913210432,50,0.1,1000],[16.7138566913,3.13481078529,-13.1846413441,-0.0916037774124,0.925350437266,0.09566216309,0.355223967051,50,0.1,1000],[16.3192611587,3.17999845344,-13.4530867525,-0.0896050983251,0.928541447711,0.0926571911607,0.348132663165,50,0.1,1000],[15.5654925929,3.24630676018,-13.8327463626,-0.0851100910952,0.934796851583,0.0905994936593,0.332720378717,50,0.1,1000],[15.0412710231,3.28178982508,-14.0283058745,-0.0815183494753,0.939148254942,0.0907331085641,0.321127415442,50,0.1,1000],[14.1153209952,3.32757238285,-14.2732017756,-0.0742114010529,0.946660226879,0.0926413518961,0.299574135596,50,0.1,1000],[13.5080054718,3.34821859918,-14.3791878563,-0.0688201862749,0.951431086126,0.094572117953,0.284778483775,50,0.1,1000],[12.4825004685,3.36742169375,-14.472976935,-0.0586584168592,0.959105725028,0.0984142278327,0.258824338325,50,0.1,1000],[11.8333810194,3.37090068644,-14.4844240483,-0.0516042306918,0.963691856753,0.100996455888,0.241732754299,50,0.1,1000],[10.7678578517,3.36203261635,-14.4253427664,-0.0390494646592,0.970674620904,0.105115176129,0.212642233317,50,0.1,1000],[10.3222013092,3.35370972684,-14.3741853695,-0.0334720955456,0.973380844191,0.10672423122,0.200048217817,50,0.1,1000]]} diff --git a/test/golden/fixtures/core.blend.easeInOut.json b/test/golden/fixtures/core.blend.easeInOut.json index 7eef423..60ad2c4 100644 --- a/test/golden/fixtures/core.blend.easeInOut.json +++ b/test/golden/fixtures/core.blend.easeInOut.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[8.66188144728,3.64108147695,13.2437619654,-0.109550206257,0.091138504921,0.061392844791,0.987888376204,50,0.1,1000],[8.68019200505,3.64024311451,13.1761372301,-0.110023188472,0.0928842187964,0.0615715478835,0.987662069935,50,0.1,1000],[8.76488472941,3.63601271063,12.8913276746,-0.111981499681,0.100337717343,0.0623437006352,0.986663949478,50,0.1,1000],[8.85468781896,3.6308407216,12.6073255275,-0.113943242025,0.107954613179,0.0631668375514,0.985582411432,50,0.1,1000],[9.06416644724,3.61622340784,11.9709747777,-0.11843856417,0.125714072779,0.0652328098994,0.982808709228,50,0.1,1000],[9.23216029762,3.6021625183,11.4710099195,-0.122080466974,0.140374794874,0.0670814331612,0.980250660736,50,0.1,1000],[9.56288125925,3.56883356478,10.4887872124,-0.129447657661,0.171125044802,0.0713327972685,0.974100177087,50,0.1,1000],[9.79854658008,3.54078743545,9.78062209777,-0.134857852055,0.195017217689,0.0749310438237,0.968590203964,50,0.1,1000],[10.2211637355,3.48164727283,8.47394616011,-0.14471609725,0.243133949484,0.0827929641159,0.955556622549,50,0.1,1000],[10.4996953965,3.43647184053,7.57724338551,-0.15118324811,0.279231011274,0.0891035185764,0.944052027598,50,0.1,1000],[10.9648174641,3.34923134021,5.99004916528,-0.16098999923,0.348789503357,0.10181696162,0.917639040594,50,0.1,1000],[11.2512352964,3.28753878035,4.94007641448,-0.165524002,0.397957521172,0.110838939444,0.895514570293,50,0.1,1000],[11.6969177472,3.17682781599,3.14391967488,-0.16815649691,0.484393566773,0.125616998506,0.849297730306,50,0.1,1000],[11.9511210438,3.10373069683,1.99406140503,-0.166159146125,0.538573964483,0.133376232683,0.815193230771,50,0.1,1000],[12.3116446163,2.98134232521,0.0910312342426,-0.15765967308,0.620736403757,0.141363658902,0.754881487703,50,0.1,1000],[12.494085067,2.9060112637,-1.08618711605,-0.150439841175,0.664865033425,0.143025949397,0.717541580199,50,0.1,1000],[12.7094086909,2.78925508118,-2.96314671105,-0.138232458143,0.723264919386,0.141515236502,0.661629111919,50,0.1,1000],[12.7869581475,2.72338427651,-4.07670700078,-0.131131023126,0.751397002317,0.138723949594,0.631635073038,50,0.1,1000],[12.8121005949,2.6318825798,-5.76624680028,-0.121003375975,0.786374329358,0.132556683197,0.59110263311,50,0.1,1000],[12.7636318795,2.587374058,-6.70898959955,-0.116053562762,0.802056913383,0.128719256402,0.571548450523,50,0.1,1000],[12.5771920048,2.53896035582,-8.02648737417,-0.109605940358,0.819442114771,0.123053475959,0.548961747695,50,0.1,1000],[12.3983965804,2.52531380648,-8.67902835427,-0.106389716838,0.825914713658,0.120075814613,0.540488586983,50,0.1,1000],[12.0094847589,2.53192147851,-9.42405261825,-0.102125409795,0.830325339189,0.116353000999,0.535343077786,50,0.1,1000],[12.1603682358,2.55019712549,-9.73830331953,-0.0955422711275,0.852508575992,0.121679729724,0.499294347717,50,0.1,1000],[13.7535988455,2.59207936135,-10.214643466,-0.062211628631,0.92740882159,0.15196180774,0.336080644917,50,0.1,1000],[14.936386524,2.62460898986,-10.4859649933,-0.042049713625,0.95326682466,0.183049147997,0.236658386717,50,0.1,1000],[16.6256567867,2.68725328223,-10.8882486263,-0.0758114986093,0.952221642767,0.199181756975,0.218753714055,50,0.1,1000],[17.4268634209,2.73086173909,-11.1116087876,-0.0822287864,0.945597259053,0.194698955833,0.247338971771,50,0.1,1000],[17.6466430471,2.74655787866,-11.1778884898,-0.0838143541148,0.943405198237,0.192205511633,0.256941291508,50,0.1,1000],[17.6569485702,2.74910766829,-11.1826962181,-0.0848833730949,0.942498318089,0.190602795376,0.261079121658,50,0.1,1000],[17.688469593,2.75887857562,-11.2248094107,-0.0870565691486,0.940187050882,0.184864741031,0.27257015729,50,0.1,1000],[17.708944377,2.76955556699,-11.2809359579,-0.0882226022216,0.938461079384,0.179352663732,0.281673919543,50,0.1,1000],[17.718421416,2.79629520146,-11.4306664373,-0.0890903228119,0.935715410045,0.167974114185,0.297126711604,50,0.1,1000],[17.6941587461,2.81927611739,-11.5608422674,-0.0887531075122,0.934351474343,0.160116079491,0.305733624891,50,0.1,1000],[17.5760586095,2.86763093847,-11.83056511,-0.0866517699923,0.933164531373,0.147379645675,0.316187710364,50,0.1,1000],[17.4409469426,2.90412098994,-12.0289472871,-0.0844391629001,0.933232631416,0.140128914377,0.319860548965,50,0.1,1000],[17.0987234452,2.97289589429,-12.3905920997,-0.0795050059814,0.934790786148,0.13014980906,0.32078991156,50,0.1,1000],[16.8041063804,3.02012226966,-12.6302754653,-0.0756840435969,0.936625847314,0.12530175439,0.31828197881,50,0.1,1000],[16.1813887041,3.10157726254,-13.0281816915,-0.0682419493224,0.940878784754,0.119676343358,0.309463603017,50,0.1,1000],[15.7077291287,3.1529547796,-13.2693677373,-0.0628571882406,0.944159016462,0.117507930578,0.301338035719,50,0.1,1000],[14.7984494288,3.23404370331,-13.633637935,-0.0527582091929,0.950270482433,0.11582166866,0.284232163288,50,0.1,1000],[14.1576924241,3.28049540377,-13.8317897886,-0.0456625599735,0.954358851206,0.115688638423,0.271533152086,50,0.1,1000],[13.0058365534,3.34578074855,-14.0911701045,-0.0327721323937,0.961203769533,0.116492057692,0.247876786466,50,0.1,1000],[12.2395766873,3.37790741924,-14.2046455316,-0.0240473640406,0.96539225034,0.117350852321,0.231664206831,50,0.1,1000],[10.9345755757,3.4134449263,-14.2982828707,-0.00892101953201,0.971863902618,0.118879207727,0.203147001376,50,0.1,1000],[10.3782720149,3.42156407795,-14.3014387991,-0.00238510729812,0.974372467903,0.119444528711,0.190592784797,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.69484129954,3.57627075055,13.2542555109,-0.10551491943,0.0932057336473,0.0669983297717,0.987770477794,50,0.1,1000],[8.71291720259,3.57584582697,13.1864977907,-0.105989379073,0.0949377877294,0.0670709406153,0.987549774396,50,0.1,1000],[8.79674088508,3.57322913681,12.9012618082,-0.107959175199,0.102336594338,0.0674122178981,0.986573682412,50,0.1,1000],[8.88576881145,3.56954221423,12.6169299717,-0.109936976814,0.109902416621,0.0678182909498,0.985513064024,50,0.1,1000],[9.09367996547,3.55798313251,11.9799961552,-0.114480818104,0.127552630692,0.0689737249133,0.982785375329,50,0.1,1000],[9.26054265725,3.546150829,11.4796524674,-0.118173296459,0.142127291377,0.0701210910807,0.980264218278,50,0.1,1000],[9.58920109933,3.51690259304,10.4967856125,-0.125676794521,0.17269650493,0.0730184504385,0.974191750324,50,0.1,1000],[9.82347200933,3.49161925314,9.78820243741,-0.131222032426,0.196443069782,0.0756575660634,0.9687449774,50,0.1,1000],[10.2436648003,3.43728146466,8.48081154946,-0.141438155075,0.244250486978,0.0818015082235,0.955848032457,50,0.1,1000],[10.5206209831,3.39522422976,7.58364555552,-0.148244927859,0.280106384091,0.0869944940601,0.944455299609,50,0.1,1000],[10.9830991865,3.31321083329,5.99566957791,-0.15884921712,0.349204976875,0.0979465955315,0.918275162884,50,0.1,1000],[11.2678549655,3.25480081416,4.9452009823,-0.164035072051,0.398073486158,0.106037045583,0.896318101859,50,0.1,1000],[11.7108369859,3.14941828226,3.14823055659,-0.167896792627,0.484088050743,0.119839930061,0.850357464433,50,0.1,1000],[11.9633968133,3.07956151435,1.99787234959,-0.166648760527,0.538098100266,0.127447564489,0.816355157643,50,0.1,1000],[12.3213389554,2.96225974567,0.0940503911259,-0.159084575471,0.6201685069,0.135931645045,0.75604610228,50,0.1,1000],[12.5022647565,2.8899117936,-1.08363584042,-0.152175870937,0.664332466095,0.13824271469,0.718605476344,50,0.1,1000],[12.7153062967,2.7776485755,-2.96130432671,-0.140039365186,0.722862387784,0.138025535112,0.662425766545,50,0.1,1000],[12.7915815433,2.71428573837,-4.07526221735,-0.132746102391,0.751098930021,0.136008304639,0.632242525215,50,0.1,1000],[12.8149222459,2.62632965022,-5.76536604558,-0.122156353535,0.786211315732,0.130967716604,0.59143642897,50,0.1,1000],[12.7655311719,2.58363596654,-6.70839825279,-0.116888444551,0.801958417633,0.127692065164,0.571746905905,50,0.1,1000],[12.5745963358,2.55200045979,-8.02401861973,-0.110012987235,0.819412295986,0.122732397153,0.548996712664,50,0.1,1000],[12.3943879489,2.54338915459,-8.67606833199,-0.106662191423,0.825898910785,0.120090185721,0.540455838509,50,0.1,1000],[12.0052108202,2.55043341538,-9.42121029503,-0.102409030527,0.830299125971,0.11669084525,0.535256012122,50,0.1,1000],[12.1565561132,2.566710006,-9.73576705584,-0.0958092656181,0.85243531133,0.122075986256,0.499271547555,50,0.1,1000],[13.7506878897,2.60468972388,-10.2127059188,-0.0623101191827,0.927293514087,0.152615976369,0.336084143537,50,0.1,1000],[14.9340031127,2.6349343543,-10.484378305,-0.0420774132291,0.953106104936,0.183899778112,0.236641322764,50,0.1,1000],[16.6239945012,2.69445487779,-10.8871417831,-0.076045635233,0.95203909777,0.20013985982,0.218592438548,50,0.1,1000],[17.4255542611,2.73653357237,-11.1107369947,-0.0825107649097,0.94542191524,0.195599192781,0.247205039678,50,0.1,1000],[17.645289366,2.75232657857,-11.1787584412,-0.0838719662954,0.94328143149,0.193169974594,0.256653453495,50,0.1,1000],[17.6553265336,2.75583306445,-11.1876387123,-0.0845452162878,0.942480693563,0.19170247755,0.260446556446,50,0.1,1000],[17.6864149162,2.76760830477,-11.2416541082,-0.0859716972605,0.940472733611,0.186124171206,0.271067699102,50,0.1,1000],[17.7069683419,2.77949360264,-11.3074943353,-0.0868180735516,0.938981003166,0.180594224916,0.279576507822,50,0.1,1000],[17.7178005366,2.8075977709,-11.4744023553,-0.0877234021799,0.936592031697,0.168879638746,0.294244181742,50,0.1,1000],[17.6955334734,2.83081073122,-11.6146191452,-0.0878819865937,0.93537206095,0.160572366513,0.302609284622,50,0.1,1000],[17.5831147623,2.87808380651,-11.8974671895,-0.0874067729533,0.93421398214,0.146682834145,0.313190737064,50,0.1,1000],[17.4531235771,2.91287838152,-12.1014250771,-0.0867010368932,0.934161093789,0.138466894217,0.317258412431,50,0.1,1000],[17.1220667587,2.97684964631,-12.4670230634,-0.084883199976,0.935315337372,0.126611161464,0.319295593191,50,0.1,1000],[16.83573545,3.01989671439,-12.7065910142,-0.0833461438917,0.936816807999,0.120481190933,0.31766644642,50,0.1,1000],[16.2287550241,3.09230659135,-13.1000028245,-0.0799940919226,0.940459305892,0.112739293058,0.31052711801,50,0.1,1000],[15.76538301,3.1369990053,-13.3371411553,-0.0773067885335,0.943382826372,0.109328963087,0.303479292842,50,0.1,1000],[14.8738351932,3.20524370305,-13.6926097864,-0.0716422160813,0.949004780567,0.10587506636,0.288180134045,50,0.1,1000],[14.2434719396,3.24309964692,-13.8856352686,-0.0672373621029,0.952899439204,0.104878988803,0.276517980628,50,0.1,1000],[13.1080548085,3.29319191445,-14.136429846,-0.058391679919,0.959621886895,0.104723305053,0.254458788976,50,0.1,1000],[12.3502951582,3.31597898283,-14.246063898,-0.0518565526739,0.963881498862,0.105307313243,0.239068450186,50,0.1,1000],[11.0574325338,3.33624408119,-14.3342992868,-0.0395383719963,0.970669292103,0.106878535796,0.211695113532,50,0.1,1000],[10.5046345183,3.33855658562,-14.3364998782,-0.0338300790814,0.973383959906,0.107646583558,0.199477831841,50,0.1,1000]]} diff --git a/test/golden/fixtures/core.blend.ignoreTarget.json b/test/golden/fixtures/core.blend.ignoreTarget.json index a35ef51..6f7bf44 100644 --- a/test/golden/fixtures/core.blend.ignoreTarget.json +++ b/test/golden/fixtures/core.blend.ignoreTarget.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[8.66249200871,3.64105334811,13.2413508921,-0.109537141808,0.091604273427,0.0614493319588,0.987843232126,50,0.1,1000],[8.69086905156,3.6397540871,13.1365510996,-0.10982966402,0.100330903233,0.062486684297,0.986897446062,50,0.1,1000],[8.82050456589,3.6332775023,12.7007123315,-0.111092293215,0.134416575936,0.066561366564,0.982425707615,50,0.1,1000],[8.95625296399,3.62545019631,12.2716977783,-0.112311971518,0.165837880891,0.0703048517949,0.977210850395,50,0.1,1000],[9.26810993583,3.60362996698,11.3252860796,-0.114780803124,0.229868248053,0.0777997720554,0.963292868882,50,0.1,1000],[9.51416917791,3.58292862644,10.5939128507,-0.116446832875,0.275382064339,0.0829694295444,0.950642376246,50,0.1,1000],[9.98923608489,3.53466330832,9.18466830813,-0.118995227798,0.355121606039,0.0915587195342,0.922684009595,50,0.1,1000],[10.3204811396,3.49475546371,8.18996393743,-0.120282458183,0.406038020487,0.0966549420117,0.900734743616,50,0.1,1000],[10.8990308619,3.41236303524,6.3999412599,-0.121582410272,0.488081433671,0.10406204327,0.858000770844,50,0.1,1000],[11.2687313549,3.35088241571,5.20568532876,-0.121914067009,0.536792390289,0.108064054636,0.827836366735,50,0.1,1000],[11.862519925,3.23550016514,3.16215547145,-0.12169033151,0.610291628129,0.113548410357,0.77449490015,50,0.1,1000],[12.2108001499,3.15655920438,1.86258994579,-0.121119501276,0.65126736208,0.116293828699,0.740038265839,50,0.1,1000],[12.7181152023,3.02065980064,-0.254598209788,-0.119615021711,0.709370571411,0.119770558687,0.684208047503,50,0.1,1000],[12.9818965639,2.93537684557,-1.53152866806,-0.118437557519,0.73965690184,0.121370703255,0.651267506421,50,0.1,1000],[13.3044907989,2.80191324965,-3.48701253377,-0.116349279242,0.779408931407,0.123247486815,0.603153894008,50,0.1,1000],[13.4282357834,2.72686685286,-4.5793589561,-0.115096615797,0.798102587689,0.124046423059,0.578271141838,50,0.1,1000],[13.48890154,2.62524066655,-6.08434188005,-0.113369491015,0.818953938644,0.124943805011,0.548498724224,50,0.1,1000],[13.4353211888,2.57917454765,-6.79902613004,-0.112317566774,0.826018505249,0.124910654388,0.53802929437,50,0.1,1000],[13.2028473659,2.53688586097,-7.55599093094,-0.110593795629,0.828753320712,0.123588997638,0.534474232719,50,0.1,1000],[13.0159968221,2.52255763841,-7.93654429034,-0.109540980321,0.828951890926,0.122583718455,0.534614597752,50,0.1,1000],[12.6702407187,2.51277416776,-8.53194376957,-0.107286014113,0.829387163707,0.120581780602,0.534852015085,50,0.1,1000],[12.4331403143,2.51494147747,-8.88285648546,-0.105527864537,0.829715292506,0.119095960042,0.535025752174,50,0.1,1000],[12.0094933665,2.53191862736,-9.42411089548,-0.102125189939,0.830326357015,0.116352727786,0.535341600441,50,0.1,1000],[12.1603682358,2.55019712549,-9.73830331953,-0.0955422711275,0.852508575992,0.121679729724,0.499294347717,50,0.1,1000],[13.7535988455,2.59207936135,-10.214643466,-0.062211628631,0.92740882159,0.15196180774,0.336080644917,50,0.1,1000],[14.936386524,2.62460898986,-10.4859649933,-0.042049713625,0.95326682466,0.183049147997,0.236658386717,50,0.1,1000],[16.6256567867,2.68725328223,-10.8882486263,-0.0758114986093,0.952221642767,0.199181756975,0.218753714055,50,0.1,1000],[17.4268634209,2.73086173909,-11.1116087876,-0.0822287864,0.945597259053,0.194698955833,0.247338971771,50,0.1,1000],[17.6481554887,2.74704266635,-11.1768157923,-0.0841139398445,0.943257469709,0.191740639543,0.257731872513,50,0.1,1000],[17.6640082978,2.75096301506,-11.1842427784,-0.0855427691946,0.942210872136,0.189341419449,0.262813496512,50,0.1,1000],[17.7118305875,2.76579732552,-11.2483795262,-0.0883613080317,0.939796655646,0.182429313383,0.27512555479,50,0.1,1000],[17.7423181346,2.78180653439,-11.3328059495,-0.0900721973712,0.938031964379,0.17662651851,0.284228967601,50,0.1,1000],[17.7552294882,2.8212953353,-11.554551103,-0.0922632889125,0.935061007022,0.165550069608,0.299568978899,50,0.1,1000],[17.7183466323,2.85469397431,-11.7441931477,-0.0929942220812,0.933368323963,0.158152319467,0.308485802477,50,0.1,1000],[17.5449126822,2.92362301658,-12.1293314979,-0.0927242771165,0.931298498079,0.146085735972,0.32053747621,50,0.1,1000],[17.3507496217,2.97453861068,-12.4063202366,-0.0914524761844,0.930672607221,0.138991865982,0.325831557648,50,0.1,1000],[16.8704842331,3.06802206463,-12.8974808306,-0.0872803659852,0.931111341031,0.128676419568,0.329933610541,50,0.1,1000],[16.4670030524,3.13028830146,-13.2125018649,-0.0832900995041,0.932416545665,0.123281661306,0.329338392358,50,0.1,1000],[15.6388558424,3.23360216919,-13.7138451586,-0.0744192904776,0.936317056595,0.116393006057,0.322838670042,50,0.1,1000],[15.029206359,3.29568369566,-14.0016363844,-0.0674929855279,0.939759693739,0.113342342536,0.315356826971,50,0.1,1000],[13.9052055437,3.38735188682,-14.4039362961,-0.0541104112104,0.946723922374,0.110301884549,0.297690061083,50,0.1,1000],[13.1498188033,3.43511316531,-14.5984786443,-0.0447469359037,0.951606494489,0.109503306219,0.283640295621,50,0.1,1000],[11.8718849012,3.49249905421,-14.8029572681,-0.0283652362977,0.959888255306,0.109705815584,0.25646556245,50,0.1,1000],[11.0838194366,3.513114913,-14.8515252567,-0.0179594787633,0.964876612478,0.110590665777,0.237613729524,50,0.1,1000],[9.87360106559,3.51904196402,-14.7914165347,-0.00159546892549,0.972201742415,0.112995125072,0.205069081616,50,0.1,1000],[9.41661932501,3.51102208976,-14.714603166,0.00470285514895,0.974840992092,0.114288981225,0.19131375293,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.69544287902,3.57625779469,13.2518389795,-0.105503024772,0.0936712245592,0.0670598375146,0.987723540089,50,0.1,1000],[8.72345628161,3.57559924334,13.1468331088,-0.105815000378,0.102381501913,0.0680690158224,0.986756212469,50,0.1,1000],[8.85176241661,3.57159156708,12.7103423478,-0.10716223503,0.136407104149,0.0720298009576,0.98220215083,50,0.1,1000],[8.98634138603,3.56600562207,12.2808313945,-0.108468785897,0.167772718591,0.0756597914245,0.976914752342,50,0.1,1000],[9.29587290189,3.5487253642,11.3335582103,-0.111137194537,0.231679823842,0.0828929029023,0.962861230845,50,0.1,1000],[9.54028431972,3.53127322713,10.6016369946,-0.112963067163,0.277095460761,0.0878501934722,0.950126199296,50,0.1,1000],[10.0124100727,3.48883250451,9.19148281889,-0.115827092086,0.356639976069,0.0960115098669,0.922048698379,50,0.1,1000],[10.3417134925,3.45277558434,8.19620339794,-0.117340660477,0.407417224169,0.10079613275,0.900045840206,50,0.1,1000],[10.9169813821,3.37689081514,6.40522624581,-0.119056761352,0.489213338472,0.107645228098,0.857267928891,50,0.1,1000],[11.2846174605,3.31950031454,5.21037239347,-0.119669292756,0.537765820605,0.111282095395,0.827105481668,50,0.1,1000],[11.8750764533,3.21070756073,3.1658733981,-0.119919912621,0.611015230248,0.116157851136,0.773813256918,50,0.1,1000],[12.2213610655,3.13571182547,1.86572209853,-0.119643627086,0.651848693832,0.1185305097,0.73941138828,50,0.1,1000],[12.7256247569,3.00583922884,-0.252370139545,-0.118600653329,0.709750488343,0.121430746661,0.683697815627,50,0.1,1000],[12.9876875167,2.92394810216,-1.52981426514,-0.117687729395,0.739933738848,0.122704526715,0.650838889117,50,0.1,1000],[13.3078537398,2.79527376792,-3.48602868193,-0.115977302191,0.779554422575,0.124120147283,0.602858488087,50,0.1,1000],[13.4303727858,2.72264462872,-4.57874554047,-0.114916970721,0.798188270501,0.124686627491,0.578050879767,50,0.1,1000],[13.4895856785,2.62388295239,-6.08416700808,-0.11341959817,0.818973349559,0.125308566152,0.548376158045,50,0.1,1000],[13.4354894293,2.57883457332,-6.79900475136,-0.11241888756,0.826029889769,0.125134503256,0.537938631279,50,0.1,1000],[13.2028307138,2.53691319072,-7.55601590912,-0.110700487869,0.828760892998,0.123737292081,0.534406087887,50,0.1,1000],[13.0159845985,2.52257778005,-7.93656262574,-0.109629922338,0.828961606028,0.122708197951,0.534552742034,50,0.1,1000],[12.6667999145,2.52766455249,-8.52966590567,-0.107375091812,0.829397129213,0.120710954128,0.534789544835,50,0.1,1000],[12.428787885,2.53378756322,-8.87996658336,-0.105670765978,0.829714760704,0.119287044446,0.534955798281,50,0.1,1000],[12.005219332,2.55043077847,-9.42126859195,-0.102408773521,0.830300147976,0.116690620805,0.53525452487,50,0.1,1000],[12.1565561132,2.566710006,-9.73576705584,-0.0958092656181,0.85243531133,0.122075986256,0.499271547555,50,0.1,1000],[13.7506878897,2.60468972388,-10.2127059188,-0.0623101191827,0.927293514087,0.152615976369,0.336084143537,50,0.1,1000],[14.9340031127,2.6349343543,-10.484378305,-0.0420774132291,0.953106104936,0.183899778112,0.236641322764,50,0.1,1000],[16.6239945012,2.69445487779,-10.8871417831,-0.076045635233,0.95203909777,0.20013985982,0.218592438548,50,0.1,1000],[17.4255542611,2.73653357237,-11.1107369947,-0.0825107649097,0.94542191524,0.195599192781,0.247205039678,50,0.1,1000],[17.6467221186,2.75310373332,-11.1786079688,-0.0841555832099,0.943139013662,0.192797981276,0.257362734557,50,0.1,1000],[17.6621628313,2.75849307329,-11.1922939577,-0.0852277412717,0.942196055253,0.190667503744,0.262009023888,50,0.1,1000],[17.7093326617,2.77635723815,-11.2744744633,-0.0875502409018,0.940054059761,0.184108942943,0.273381084153,50,0.1,1000],[17.7399485346,2.79415613964,-11.3734034396,-0.0892009142664,0.93849362978,0.178341239647,0.281899460796,50,0.1,1000],[17.7548990532,2.83559335354,-11.6202858042,-0.0919439697648,0.935838055977,0.166875805227,0.29648930004,50,0.1,1000],[17.7209646966,2.8692588573,-11.8242364469,-0.0935265834227,0.93427857474,0.158915019509,0.305159531311,50,0.1,1000],[17.5557635567,2.93647031567,-12.2273197052,-0.0955203711109,0.932239394645,0.14542350804,0.317265776729,50,0.1,1000],[17.3688752521,2.98486028091,-12.5113673717,-0.0962176294822,0.931490360812,0.137161600038,0.32288476422,50,0.1,1000],[16.904106471,3.07143829541,-13.0062470479,-0.0960370101361,0.931484431099,0.124619495056,0.327999434079,50,0.1,1000],[16.5118137604,3.12786972852,-13.3197747141,-0.0949557376248,0.932397283373,0.117727409145,0.328266615706,50,0.1,1000],[15.7042416801,3.21894947003,-13.8126077679,-0.0912437013806,0.935550197859,0.108404509816,0.323525696809,50,0.1,1000],[15.1074885067,3.27230075232,-14.0934428913,-0.0876614296591,0.938545721644,0.103952498339,0.317240098698,50,0.1,1000],[14.0046359534,3.34786676369,-14.4816733484,-0.0795743960186,0.944918260028,0.0989770002516,0.301663638486,50,0.1,1000],[13.2607469856,3.38539193422,-14.6681237911,-0.0732396562967,0.949597636028,0.0972843161558,0.288852980296,50,0.1,1000],[11.9993899045,3.42577231018,-14.8594793227,-0.0609651707672,0.957848393038,0.0966093535981,0.263583642711,50,0.1,1000],[11.2184744871,3.43682246199,-14.9019734469,-0.0524250216518,0.963022395465,0.0973551584275,0.245685685512,50,0.1,1000],[10.0160771133,3.42880475098,-14.8332556965,-0.0376774187977,0.970881366703,0.100146636695,0.21433719943,50,0.1,1000],[9.55986674077,3.41633477424,-14.7544113647,-0.0314660540851,0.973804799756,0.101826939156,0.200861578889,50,0.1,1000]]} diff --git a/test/golden/fixtures/core.blend.spherical.json b/test/golden/fixtures/core.blend.spherical.json index efd506d..186040b 100644 --- a/test/golden/fixtures/core.blend.spherical.json +++ b/test/golden/fixtures/core.blend.spherical.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[8.80169271292,3.6394739711,13.1008258612,-0.109892155483,0.100424092355,0.0633954431969,0.986823050815,50,0.1,1000],[9.23517697922,3.63365883605,12.6194393105,-0.111021473342,0.13035735383,0.0694659770614,0.982779563682,50,0.1,1000],[9.9297868802,3.62041561047,11.7502126249,-0.112806047982,0.181925867939,0.0788924388467,0.973629168219,50,0.1,1000],[10.348828523,3.60874464163,11.1595488733,-0.113889413225,0.215502815026,0.0844436512537,0.966155788698,50,0.1,1000],[11.0053922682,3.58199138795,10.1129648045,-0.115568647839,0.272535382484,0.092987215447,0.950642798687,50,0.1,1000],[11.3917956941,3.55979150377,9.41369832295,-0.116512185848,0.309070410008,0.0979286378802,0.938781323893,50,0.1,1000],[11.9803832292,3.51306460345,8.19317812378,-0.117721708809,0.369968836033,0.105294949345,0.915520416638,50,0.1,1000],[12.3156124892,3.47724799567,7.38891021028,-0.118191353887,0.408147840146,0.109347881575,0.89860402027,50,0.1,1000],[12.8061718879,3.4072625826,6.0027982974,-0.118375957053,0.470194025109,0.114953947865,0.867000750527,50,0.1,1000],[13.0718790703,3.35693353102,5.10025026827,-0.118260936608,0.507962666892,0.117793711772,0.845052022886,50,0.1,1000],[13.435100861,3.2641682099,3.56207691649,-0.117778502805,0.567343811712,0.12138532529,0.805924826763,50,0.1,1000],[13.6136756912,3.20079840766,2.57121127521,-0.117324071136,0.602269896056,0.122977118881,0.779988886375,50,0.1,1000],[13.8219288517,3.08952500308,0.899804420536,-0.116409878241,0.655334483786,0.12465489808,0.735830558616,50,0.1,1000],[13.8971011685,3.01682757149,-0.166167847069,-0.115784288005,0.685526139471,0.12520961505,0.707792669539,50,0.1,1000],[13.9254482026,2.89467787452,-1.94678872885,-0.114754150574,0.730046936226,0.125560662989,0.66188932288,50,0.1,1000],[13.8829268169,2.81820689002,-3.07155242563,-0.114147495182,0.75470906238,0.125557242761,0.633734928259,50,0.1,1000],[13.7101653225,2.6953145273,-4.93254997193,-0.11323537725,0.790293654537,0.125460327659,0.588959587002,50,0.1,1000],[13.5382691831,2.62182061158,-6.0970026099,-0.112411557573,0.809779129942,0.125078625753,0.562118083514,50,0.1,1000],[13.2028473659,2.53688586097,-7.55599093094,-0.110593795629,0.828753320712,0.123588997638,0.534474232719,50,0.1,1000],[13.0159968221,2.52255763841,-7.93654429034,-0.109540980321,0.828951890926,0.122583718455,0.534614597752,50,0.1,1000],[12.6702407187,2.51277416776,-8.53194376957,-0.107286014113,0.829387163707,0.120581780602,0.534852015085,50,0.1,1000],[12.4331403143,2.51494147747,-8.88285648546,-0.105527864537,0.829715292506,0.119095960042,0.535025752174,50,0.1,1000],[12.0094933665,2.53191862736,-9.42411089548,-0.102125189939,0.830326357015,0.116352727786,0.535341600441,50,0.1,1000],[12.1603682358,2.55019712549,-9.73830331953,-0.0955422711275,0.852508575992,0.121679729724,0.499294347717,50,0.1,1000],[13.7535988455,2.59207936135,-10.214643466,-0.062211628631,0.92740882159,0.15196180774,0.336080644917,50,0.1,1000],[14.936386524,2.62460898986,-10.4859649933,-0.042049713625,0.95326682466,0.183049147997,0.236658386717,50,0.1,1000],[16.6256567867,2.68725328223,-10.8882486263,-0.0758114986093,0.952221642767,0.199181756975,0.218753714055,50,0.1,1000],[17.4268634209,2.73086173909,-11.1116087876,-0.0822287864,0.945597259053,0.194698955833,0.247338971771,50,0.1,1000],[17.6869941409,2.75509553188,-11.1575307019,-0.08911532309,0.939139659183,0.187272719295,0.273868742918,50,0.1,1000],[17.7525460585,2.76635901497,-11.1919364511,-0.0926985243181,0.935239059419,0.179756079942,0.290555738284,50,0.1,1000],[17.873981829,2.79297819888,-11.335566119,-0.0960038866178,0.929248000372,0.163942913385,0.316866105334,50,0.1,1000],[17.9355962596,2.81486137864,-11.4732639589,-0.0964296458636,0.926204753916,0.15340608191,0.330624638004,50,0.1,1000],[17.9773043741,2.85941910537,-11.7655666053,-0.0949039858586,0.922928371676,0.137182977239,0.346954298112,50,0.1,1000],[17.9521739797,2.89232499225,-11.9820862459,-0.0928987031725,0.922070781294,0.128384669796,0.353090189321,50,0.1,1000],[17.8055845876,2.95375580288,-12.3789551277,-0.0883955383538,0.922594976261,0.116700892145,0.356911249964,50,0.1,1000],[17.6413557932,2.99596659721,-12.6444409246,-0.084998469131,0.924009634924,0.111158383806,0.355844444277,50,0.1,1000],[17.2415603893,3.06979954731,-13.0931169607,-0.0786015169443,0.927839569437,0.104776832912,0.349223925591,50,0.1,1000],[16.9085200636,3.11759371145,-13.3723773973,-0.0741033727316,0.930990037915,0.102310182755,0.342489220206,50,0.1,1000],[16.2208195737,3.19640985568,-13.8113598079,-0.0658270695559,0.93709542105,0.100399695272,0.327778690506,50,0.1,1000],[15.704553876,3.24450626764,-14.0637054127,-0.0600534808606,0.941315256423,0.100323071396,0.316629829309,50,0.1,1000],[14.7152527185,3.31891152983,-14.4223325765,-0.0494721511816,0.948630020503,0.10164962946,0.295501173074,50,0.1,1000],[14.0128024315,3.36120974695,-14.6012506051,-0.0421343560926,0.953284968971,0.103167674758,0.280764839067,50,0.1,1000],[12.7258902072,3.42122810118,-14.7991780377,-0.0288229150625,0.960823665041,0.106423817812,0.254285460196,50,0.1,1000],[11.8453963077,3.45175892551,-14.8521161871,-0.0197206111678,0.965330517224,0.108730512008,0.23648629087,50,0.1,1000],[10.2844765739,3.48846475437,-14.7994268057,-0.00350835616557,0.972179761963,0.112629377686,0.205350493423,50,0.1,1000],[9.58964455749,3.49864515059,-14.7197798289,0.00375676429401,0.974797229558,0.114217131819,0.191600351689,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.8674698976,3.57575787045,13.1490846538,-0.10525560025,0.103745443449,0.0687487905383,0.986626446726,50,0.1,1000],[9.40074136768,3.57337328788,12.7726766469,-0.104528183359,0.137195345846,0.073839325233,0.982241849043,50,0.1,1000],[10.2498323713,3.5654537853,12.0382287697,-0.103356684388,0.193239822317,0.081122482674,0.972314203161,50,0.1,1000],[10.75744569,3.55689386525,11.5099051042,-0.102708402131,0.22874103915,0.0850404307746,0.9643114882,50,0.1,1000],[11.5430110471,3.53495503291,10.5331860052,-0.101856097501,0.287419938016,0.0905191094126,0.948061920691,50,0.1,1000],[11.9981625374,3.51561831221,9.8592351162,-0.10148543538,0.324037795238,0.0933838710126,0.935937853865,50,0.1,1000],[12.6777517287,3.4734221511,8.65410713063,-0.101116869325,0.383623547839,0.0972622048849,0.912769640042,50,0.1,1000],[13.0551409842,3.44035246688,7.84530991864,-0.101027224612,0.420209626891,0.0992125708981,0.896311461006,50,0.1,1000],[13.5893673652,3.37477144773,6.43275311208,-0.101096064156,0.478743701684,0.101761055516,0.866157457677,50,0.1,1000],[13.8659266063,3.32713488577,5.50411598095,-0.101418579547,0.514021715139,0.103081017085,0.845500001186,50,0.1,1000],[14.2195408288,3.23870336575,3.91166637551,-0.102439822505,0.569356951527,0.105050817415,0.808890023596,50,0.1,1000],[14.3750614068,3.17798647738,2.88202171424,-0.103337245866,0.602050868072,0.106260057997,0.78457948351,50,0.1,1000],[14.5179413814,3.07098137333,1.14304931327,-0.105126672707,0.652323793731,0.108423551163,0.742742475136,50,0.1,1000],[14.5356674583,3.00089358795,0.0345619354434,-0.106353390148,0.681443122226,0.109961813099,0.715704287563,50,0.1,1000],[14.4437505305,2.8829358264,-1.81261973344,-0.108382620892,0.72536575694,0.11294400051,0.670329306309,50,0.1,1000],[14.3109241131,2.80902350918,-2.97506115492,-0.109561921487,0.750333842935,0.115126457095,0.641670638555,50,0.1,1000],[13.9670275724,2.69023470451,-4.88828609466,-0.111176772001,0.78733337035,0.119314956509,0.594566926809,50,0.1,1000],[13.6753417884,2.61924191512,-6.07780406621,-0.111557054125,0.808146579583,0.121893918743,0.565328225155,50,0.1,1000],[13.2028307138,2.53691319072,-7.55601590912,-0.110700487869,0.828760892998,0.123737292081,0.534406087887,50,0.1,1000],[13.0159845985,2.52257778005,-7.93656262574,-0.109629922338,0.828961606028,0.122708197951,0.534552742034,50,0.1,1000],[12.6667999145,2.52766455249,-8.52966590567,-0.107375091812,0.829397129213,0.120710954128,0.534789544835,50,0.1,1000],[12.428787885,2.53378756322,-8.87996658336,-0.105670765978,0.829714760704,0.119287044446,0.534955798281,50,0.1,1000],[12.005219332,2.55043077847,-9.42126859195,-0.102408773521,0.830300147976,0.116690620805,0.53525452487,50,0.1,1000],[12.1565561132,2.566710006,-9.73576705584,-0.0958092656181,0.85243531133,0.122075986256,0.499271547555,50,0.1,1000],[13.7506878897,2.60468972388,-10.2127059188,-0.0623101191827,0.927293514087,0.152615976369,0.336084143537,50,0.1,1000],[14.9340031127,2.6349343543,-10.484378305,-0.0420774132291,0.953106104936,0.183899778112,0.236641322764,50,0.1,1000],[16.6239945012,2.69445487779,-10.8871417831,-0.076045635233,0.95203909777,0.20013985982,0.218592438548,50,0.1,1000],[17.4255542611,2.73653357237,-11.1107369947,-0.0825107649097,0.94542191524,0.195599192781,0.247205039678,50,0.1,1000],[17.666571615,2.76473643135,-11.1808942681,-0.0869431364433,0.939931605911,0.189401619946,0.270363632164,50,0.1,1000],[17.71166223,2.77879975873,-11.2305170212,-0.0892526131951,0.936827809637,0.182892562701,0.284495934308,50,0.1,1000],[17.7940259794,2.80870355063,-11.3893928999,-0.0919074003445,0.931963816061,0.168442782059,0.307609337452,50,0.1,1000],[17.8305994249,2.83176472207,-11.5288252571,-0.0928145357405,0.929362485625,0.158380385943,0.320291251233,50,0.1,1000],[17.8343560661,2.87670686935,-11.810332704,-0.0932009462794,0.926270807824,0.142146371156,0.336348603911,50,0.1,1000],[17.7895065435,2.9088722382,-12.0118446659,-0.0929266045602,0.925198444475,0.132849205046,0.343108690104,50,0.1,1000],[17.6199677339,2.9673165573,-12.3725678554,-0.0917948804565,0.924952217676,0.119710159911,0.348864690893,50,0.1,1000],[17.4482685828,3.00661846021,-12.6104613791,-0.0907496665881,0.925716730037,0.112960725328,0.3493607137,50,0.1,1000],[17.0490860509,3.07374471304,-13.0092903527,-0.0884079053219,0.928357384827,0.10433695652,0.345615983162,50,0.1,1000],[16.7243416564,3.11633739745,-13.257954447,-0.0865380500822,0.93078070934,0.1003991868,0.340702862182,50,0.1,1000],[16.0636812354,3.18467966191,-13.6516139034,-0.082579360624,0.935814450375,0.0961230552197,0.32892601284,50,0.1,1000],[15.5714176786,3.22539626789,-13.8826233642,-0.0794891262592,0.93950793278,0.0946647559584,0.319444685399,50,0.1,1000],[14.6324035881,3.28597326557,-14.2212548494,-0.07314127583,0.946225494163,0.0939656606819,0.300795815427,50,0.1,1000],[13.9656882913,3.31912985483,-14.4010163244,-0.0683120446909,0.950714868819,0.0944096030084,0.287335221678,50,0.1,1000],[12.7422705068,3.36288479303,-14.6249580781,-0.0587417199226,0.958305357407,0.09622072966,0.262567750285,50,0.1,1000],[11.9006613644,3.38322011619,-14.7131313284,-0.0516890263927,0.96306370873,0.0978372619619,0.245488100833,50,0.1,1000],[10.3981007286,3.40258329675,-14.7509587319,-0.0382227195895,0.970630234061,0.100871875776,0.215036827337,50,0.1,1000],[9.72282241652,3.40580437936,-14.7233224493,-0.0318416257844,0.973661486759,0.102188623503,0.201312953625,50,0.1,1000]]} diff --git a/test/golden/fixtures/extension.groupFraming.json b/test/golden/fixtures/extension.groupFraming.json index b89953d..7f76492 100644 --- a/test/golden/fixtures/extension.groupFraming.json +++ b/test/golden/fixtures/extension.groupFraming.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.946896616399,2.94393661983,16.5924068965,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[1.56592921613,1.83549400679,16.7642696896,-0.0549165848514,0.0111698037227,0.0147176431089,0.998319986364,50,0.1,1000],[1.92088602737,1.05049665029,16.764781986,-0.00308580183761,0.0116462257203,0.0204793924201,0.999717679017,50,0.1,1000],[2.1939798456,0.547585624323,16.6408220688,0.0296125836767,-0.0067285540665,0.0281709450989,0.999141741346,50,0.1,1000],[2.3720159111,0.0901909416022,16.5034167875,0.0594494940727,-0.0176588708477,0.0329231359265,0.99753194889,50,0.1,1000],[2.63963134225,-0.121736082322,16.2733573682,0.0727641149839,-0.0351058314059,0.039281306491,0.995956797824,50,0.1,1000],[2.77890253835,-0.44519740319,16.0650343374,0.0937235554204,-0.0476811142088,0.0427762508344,0.993535403935,50,0.1,1000],[3.09543770385,-0.496066994183,15.7850519643,0.0964105607438,-0.0593364329981,0.0459479966665,0.992508424699,50,0.1,1000],[3.19813667384,-0.729544750189,15.5423200053,0.111270311485,-0.0724938590488,0.0472139911719,0.990017372181,50,0.1,1000],[3.54270100949,-0.66306656564,15.2515538285,0.106120834393,-0.0784397801703,0.0463931527609,0.990168291136,50,0.1,1000],[3.59311693344,-0.809512644021,14.9842169237,0.115172510425,-0.0924205563333,0.0448812758408,0.98801791719,50,0.1,1000],[3.94956256533,-0.637315337226,14.6512311676,0.103750312932,-0.0935039911798,0.040193294412,0.989382320079,50,0.1,1000],[3.94487328245,-0.691612260908,14.3366135358,0.107354761158,-0.108475670164,0.0358259119774,0.987635807507,50,0.1,1000],[4.3042452849,-0.431219508019,13.9463335665,0.0910332521352,-0.10544419075,0.0280304271144,0.989852900586,50,0.1,1000],[4.24371379953,-0.404922848494,13.5943099672,0.0899641506231,-0.121426623742,0.0211643882571,0.988288467665,50,0.1,1000],[4.59842512848,-0.0848020449152,13.1509371364,0.0702042418491,-0.114828530638,0.0114287221706,0.990835585396,50,0.1,1000],[4.48619469545,0.00342063569905,12.763906044,0.0656111631008,-0.131715165804,0.00280316795614,0.989109919384,50,0.1,1000],[4.82925341438,0.351204802057,12.2740580612,0.0439765051569,-0.12194072115,-0.00748157566784,0.991534443953,50,0.1,1000],[4.66201209123,0.474335983226,11.8034604792,0.0374655155171,-0.140106130066,-0.0168912071863,0.989283222634,50,0.1,1000],[4.94459398108,0.814326297596,11.1736445876,0.0159402640091,-0.130158694928,-0.0267101165224,0.991005142163,50,0.1,1000],[4.68323939451,0.950549957597,10.6505999933,0.00890573975719,-0.152257173937,-0.0361486422395,0.987639466834,50,0.1,1000],[4.92145424515,1.28407724844,10.0055742326,-0.0129185744195,-0.14039681703,-0.044125792571,0.989027177904,50,0.1,1000],[4.60471898772,1.43070101184,9.4764668004,-0.0205830023876,-0.163231292724,-0.0520753141819,0.984997485652,50,0.1,1000],[4.80168538534,1.74817839875,8.85755484971,-0.04199360423,-0.148347878082,-0.0570405603131,0.986395366347,50,0.1,1000],[4.43401793714,1.88769830561,8.34460549568,-0.0491807674471,-0.170894841638,-0.0624288000583,0.982078841101,50,0.1,1000],[4.57762935778,2.18307639808,7.79517163184,-0.0691011226649,-0.152899688907,-0.0638092916946,0.983755606984,50,0.1,1000],[4.15840204219,2.30146894892,7.32248739232,-0.0747879827603,-0.174350508456,-0.0660001744472,0.979618617018,50,0.1,1000],[4.25283538873,2.56670536591,6.83727766107,-0.0922857205694,-0.153467371597,-0.0638075607946,0.981763569715,50,0.1,1000],[3.79383392204,2.64700273721,6.39835060749,-0.0957101436422,-0.173191773831,-0.062674318511,0.978220889002,50,0.1,1000],[3.85178877533,2.86614676841,5.95178138829,-0.110060810531,-0.149744189707,-0.0573976353057,0.980902037461,50,0.1,1000],[3.36615080886,2.89022048119,5.54058189009,-0.110593824039,-0.167461550114,-0.0532506622157,0.978207545612,50,0.1,1000],[3.39770986322,3.04547031972,5.11521979295,-0.121174424534,-0.141808268235,-0.045695315474,0.981386321508,50,0.1,1000],[2.89631145357,2.99877968089,4.73078354265,-0.118272928826,-0.157564760471,-0.0391313248655,0.979619109644,50,0.1,1000],[2.90729271018,3.07636445922,4.31876812023,-0.124535911371,-0.130086761169,-0.0302833999974,0.983184192831,50,0.1,1000],[2.39865371372,2.95131645144,3.96204771903,-0.117774899664,-0.14414682253,-0.0220474653292,0.982275254619,50,0.1,1000],[2.38962839225,2.9471140325,3.56968250678,-0.11928690423,-0.115209217406,-0.0129765908769,0.986067481866,50,0.1,1000],[1.8746313851,2.74971122066,3.2615281081,-0.108443641008,-0.127930295346,-0.00386963426517,0.985829012653,50,0.1,1000],[1.83652625775,2.6768867333,2.93910402393,-0.104984017808,-0.0979348350365,0.00434276631899,0.989630367598,50,0.1,1000],[9.76567962182,2.10148620787,1.12931632638,-0.0867619468197,-0.341921899884,0.0415790097704,0.934790332058,50,0.1,1000],[11.6782526111,2.24475339182,2.3496253718,-0.0817575551475,-0.172359471588,0.0322278476811,0.981106151527,50,0.1,1000],[12.1931515704,1.99499821325,2.45773585046,-0.0643415814861,-0.119362833608,0.0326914569734,0.990224188498,50,0.1,1000],[12.5606068927,1.8162918671,2.33234746177,-0.0517937186748,-0.0627864556135,0.0323880021521,0.996155755399,50,0.1,1000],[12.157976971,1.47356619265,2.16937750866,-0.0316166141551,-0.0662408731874,0.0382222385747,0.996569915714,50,0.1,1000],[12.1188550605,1.23748851226,1.97244799895,-0.0160100437605,-0.0331594493999,0.0377896697543,0.998607065003,50,0.1,1000],[11.6124220235,0.895296115728,1.82951412986,0.00473091130664,-0.0428621490221,0.0427245192191,0.998155834585,50,0.1,1000],[11.517024121,0.656132463579,1.67380806903,0.0214037622303,-0.0119197931086,0.038670160706,0.998951658573,50,0.1,1000],[11.0329729424,0.355260150236,1.57084995535,0.040580257604,-0.0201737683172,0.0410568819054,0.998128545936,50,0.1,1000],[10.9335193979,0.148863405219,1.46379890249,0.0559345800964,0.0118241808556,0.0326895046978,0.997829097481,50,0.1,1000],[10.473896969,-0.0809658469322,1.40787032596,0.0714866620443,0.00517936994759,0.0323949143445,0.996901901293,50,0.1,1000],[10.3723340634,-0.223730189829,1.35466016172,0.0830138200025,0.0381733073368,0.0201765299555,0.995612581246,50,0.1,1000],[9.93342153507,-0.363922302727,1.3567763168,0.0933068926044,0.0326764155497,0.0175983537447,0.994945412374,50,0.1,1000],[9.8322076169,-0.420341893024,1.36857844066,0.0987762650072,0.0661960547963,0.00267794403065,0.992901888616,50,0.1,1000],[9.41774910906,-0.465089955112,1.43754048541,0.10283960104,0.0615278605915,-0.00147700964204,0.992792101737,50,0.1,1000],[9.32493042038,-0.422089567242,1.52298433,0.100554215387,0.0949723649445,-0.017451209361,0.99023459592,50,0.1,1000],[8.94290216757,-0.3771339542,1.6589461054,0.0981725582224,0.0908824463257,-0.0223064790297,0.990759784587,50,0.1,1000],[8.80713743528,-0.233387893799,1.8321942183,0.0875477538612,0.118818884062,-0.036635745533,0.988370014586,50,0.1,1000],[8.47426344779,-0.114073891633,2.02355356225,0.0792594423606,0.115718018242,-0.0414892647882,0.989245127336,50,0.1,1000],[8.43562964212,0.130808088182,2.24507595074,0.0592707244748,0.14743494577,-0.0541950646175,0.985805666933,50,0.1,1000],[8.16312548469,0.298742301382,2.47200219321,0.0464759030022,0.145796067179,-0.0583518877937,0.986498126925,50,0.1,1000],[8.15904277813,0.624375888456,2.73001926077,0.0183639776673,0.175912970723,-0.0670023982833,0.981951154427,50,0.1,1000],[7.94189357729,0.73585976838,2.92356572901,0.00966271799326,0.169726687539,-0.0687572780421,0.983042176173,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.946896616399,2.94393661983,16.5924068965,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.966669186724,2.83991865949,16.5753977167,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[1.0384156375,2.77615032154,16.5308923254,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.28225440955,2.68361599816,16.4190854471,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.50898882555,2.63589784318,16.3303663432,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.98464544036,2.57783894869,16.1675440891,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.33166008969,2.55492936043,16.0596064452,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[2.96284534003,2.53760584112,15.8691769196,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.38441476464,2.5377921361,15.7371272867,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.10705051505,2.55302377543,15.4897773385,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.56909323666,2.57013162987,15.3121330232,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.33431119623,2.60811626086,14.9775904175,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[5.80977599644,2.63654397452,14.7406764229,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[6.57813124491,2.68916676703,14.3058291673,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.04540573026,2.72444328601,14.0066573943,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[7.78640325914,2.7852834128,13.4732901532,-0.105639044978,0.0992933224018,0.0685679515232,0.987056059364,50,0.1,1000],[8.22955167682,2.82387623932,13.1160229852,-0.106054363424,0.118515261913,0.0731398568098,0.984559376594,50,0.1,1000],[8.92187534313,2.88784069971,12.4940802598,-0.106561280604,0.150193266901,0.0795202482851,0.979675051314,50,0.1,1000],[9.33113849107,2.92390739863,12.039336504,-0.106525354167,0.169951778652,0.0828258226008,0.97617038726,50,0.1,1000],[9.96633738014,2.98353723119,11.2588689102,-0.1063018872,0.202220527245,0.0869652807053,0.969661697238,50,0.1,1000],[10.3401466261,3.02281965011,10.7602152716,-0.106178019912,0.222205988313,0.0888776177453,0.965117348258,50,0.1,1000],[10.9176556986,3.08934563356,9.92566820173,-0.106039649491,0.254667423486,0.0907508532956,0.956903536819,50,0.1,1000],[11.255622233,3.12980885638,9.39452999057,-0.105904915138,0.274701588951,0.091235741484,0.951314472429,50,0.1,1000],[11.7727915872,3.19405041005,8.50607318685,-0.105751756369,0.307138784966,0.0908136231079,0.9414006685,50,0.1,1000],[12.0716484983,3.23064051413,7.94048240951,-0.105626857079,0.327116149251,0.0899064005852,0.934748538965,50,0.1,1000],[12.5210173161,3.2853594109,6.99456589993,-0.105564566254,0.359391705531,0.087338871109,0.923074019751,50,0.1,1000],[12.7750058689,3.31419354706,6.39288681034,-0.105543347211,0.379238642619,0.0851807640611,0.915304807831,50,0.1,1000],[13.1457087187,3.35398743549,5.38855299791,-0.105736195601,0.411241496145,0.0807752954983,0.901762518863,50,0.1,1000],[13.3472861234,3.37230397092,4.7514482875,-0.105922209783,0.430886232069,0.0775968666647,0.892802479147,50,0.1,1000],[13.6260417248,3.39362269506,3.69206858259,-0.106519979445,0.462489415206,0.0717891044556,0.877270402603,50,0.1,1000],[13.766479733,3.39985951954,3.02312622105,-0.106994100726,0.481841222497,0.0678912816162,0.867047906746,50,0.1,1000],[13.9386714126,3.40122004778,1.91710176381,-0.108093522029,0.512877222874,0.061213967543,0.849426627161,50,0.1,1000],[14.0088427888,3.3951825768,1.22314803025,-0.108896004473,0.531817277365,0.0569485680677,0.837895521112,50,0.1,1000],[14.0600225095,3.3774458007,0.0842429704478,-0.110517946994,0.562072652872,0.0499996717884,0.818144332687,50,0.1,1000],[14.0514688736,3.36045123297,-0.624587854892,-0.111636816623,0.580456427882,0.0457490777854,0.805304028542,50,0.1,1000],[13.969260879,3.3269559923,-1.77741678968,-0.113710366455,0.609683899595,0.0391571942342,0.783468065255,50,0.1,1000],[13.8754297597,3.30182566762,-2.48800037621,-0.115072863676,0.627353181084,0.0353113051691,0.769375937989,50,0.1,1000],[13.6515249379,3.25819119172,-3.63150091927,-0.117424307366,0.655296767713,0.0296946650712,0.745597683158,50,0.1,1000],[8.49799001721,8.97039859631,-2.46633066798,-0.36696632353,-0.493878824757,-0.188032619099,0.765547619686,50,0.1,1000],[12.6769798827,11.7445403209,-5.91313547208,-0.56269383406,-0.455841598182,-0.33608411903,0.602188966533,50,0.1,1000],[17.8092618116,10.950684865,-8.58444035128,-0.326237908335,0.728801594587,0.432467592724,0.418794513021,50,0.1,1000],[21.4354474859,7.12435579021,-10.38544661,-0.212732123609,0.815224261713,0.214377194089,0.494162792361,50,0.1,1000],[21.7183882285,5.6646102771,-10.7290185837,-0.179019119926,0.831236255641,0.151346630694,0.504076025403,50,0.1,1000],[21.210768168,4.31017833506,-11.0040409226,-0.15151151356,0.845116726096,0.0978531899856,0.50323626036,50,0.1,1000],[20.6555571447,3.80790616314,-11.0923986925,-0.142552587946,0.851379470478,0.0794458682798,0.498517914354,50,0.1,1000],[19.687630388,3.29900967343,-11.2294303084,-0.133535398756,0.860968033485,0.0617230287209,0.486921564856,50,0.1,1000],[19.1498441676,3.11587814004,-11.3510256284,-0.129775895667,0.866814098551,0.0554124352079,0.478247841062,50,0.1,1000],[18.4059178813,2.95661947358,-11.6345087617,-0.124730107162,0.876604607828,0.0501297953414,0.462053855649,50,0.1,1000],[18.0075070127,2.91621081723,-11.8531746469,-0.121870431846,0.88280872559,0.0490504041352,0.450988258958,50,0.1,1000],[17.4081787525,2.91127517927,-12.2542855776,-0.116914363694,0.893165311089,0.0499684217028,0.431381403704,50,0.1,1000],[17.0421637767,2.9336329165,-12.5142488189,-0.113561507467,0.899678445852,0.0517797961636,0.418331603876,50,0.1,1000],[16.4210780303,2.99608514092,-12.9293104893,-0.107266182219,0.910347988712,0.0562902296091,0.395716964067,50,0.1,1000],[16.0091322941,3.0452477507,-13.1694247742,-0.102852969819,0.91693396274,0.0597938876928,0.380891146613,50,0.1,1000],[15.286113495,3.13462966896,-13.5143805797,-0.0946220576047,0.927479196001,0.0663151422105,0.355571805848,50,0.1,1000],[14.8046464392,3.1929734546,-13.6932363369,-0.088925554018,0.933841563612,0.070670502163,0.339172316143,50,0.1,1000],[13.972975732,3.28823464239,-13.9180418527,-0.0785881800887,0.943777885345,0.077978045115,0.311490971882,50,0.1,1000],[13.4317967104,3.3459369141,-14.0140279211,-0.0716037802545,0.949620508699,0.0824902171063,0.293750152669,50,0.1,1000],[12.5207239527,3.4346305078,-14.0964739375,-0.0593076202291,0.958496601904,0.089544227439,0.264099794876,50,0.1,1000],[11.9424709906,3.48556638965,-14.1022581178,-0.0512144672729,0.963562843211,0.0936211903803,0.245272905632,50,0.1,1000],[10.9908685686,3.55972742662,-14.0385049997,-0.0373878157261,0.971011767135,0.0995552009755,0.21407256078,50,0.1,1000],[10.5909056795,3.58744810086,-13.986106265,-0.0314191710372,0.973825281601,0.101743962116,0.20081165997,50,0.1,1000]]} diff --git a/test/golden/fixtures/extension.groupFraming.rigid.horizontal.average.json b/test/golden/fixtures/extension.groupFraming.rigid.horizontal.average.json index 0de4810..33e4a00 100644 --- a/test/golden/fixtures/extension.groupFraming.rigid.horizontal.average.json +++ b/test/golden/fixtures/extension.groupFraming.rigid.horizontal.average.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[1.84458035004,2.97785649555,16.1425329391,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[6.12192996794,1.81717762803,15.4805996984,-0.0502479323565,0.225666000577,0.0469377049626,0.971775104296,50,0.1,1000],[9.12999650506,0.407057391504,13.5641380715,0.041281839766,0.400011224818,0.0383448009103,0.914776751983,50,0.1,1000],[10.6895186396,-0.693781308953,11.9408123645,0.107121328888,0.486309240997,0.0124232046043,0.867106687211,50,0.1,1000],[11.4353277019,-1.5757708094,10.4823223858,0.154963490061,0.548755742857,-0.0210040826243,0.821226083331,50,0.1,1000],[11.7731793223,-2.09379503741,9.94911911755,0.188826715638,0.553514612921,-0.0355360259081,0.810372282107,50,0.1,1000],[11.9310562534,-2.56428518795,9.29521324875,0.217923297211,0.568006067833,-0.0551564814723,0.791729945113,50,0.1,1000],[12.0025731589,-2.71692098128,9.35267399066,0.239719486358,0.537829765199,-0.0493076048438,0.806748084368,50,0.1,1000],[12.0688702006,-2.96496541252,8.99219732502,0.260869306049,0.53562196663,-0.0573749623009,0.801102008315,50,0.1,1000],[12.1283752411,-2.88060608246,9.18639208263,0.268954395241,0.494964726522,-0.0391556506611,0.825312236551,50,0.1,1000],[12.2278244958,-3.01243831706,8.88388153092,0.282795263749,0.48972047097,-0.041972908412,0.823674070293,50,0.1,1000],[12.3456151973,-2.78045938813,9.0453173782,0.274905663772,0.451886128915,-0.0211574927455,0.84839740866,50,0.1,1000],[12.4883999895,-2.8508964572,8.76126840196,0.281821497467,0.447418449637,-0.022580170369,0.84845949249,50,0.1,1000],[12.6514066328,-2.51826167125,8.85943603921,0.259777736281,0.416676677597,-0.00472337755812,0.871133608457,50,0.1,1000],[12.8044515029,-2.53823885635,8.61319329352,0.260053568039,0.412208704911,-0.0059560787597,0.873167023239,50,0.1,1000],[12.9703179296,-2.12132954803,8.64450264796,0.227242373527,0.38816330833,0.00707662853554,0.893106976274,50,0.1,1000],[13.0924994509,-2.080098931,8.45037380729,0.220937633888,0.382102253195,0.0056442373404,0.897302943615,50,0.1,1000],[13.2222369619,-1.59221695323,8.40054629096,0.181224382058,0.363275072093,0.013432344241,0.913788004666,50,0.1,1000],[13.2777910886,-1.48100287095,8.252047897,0.169008198252,0.354519382604,0.0112810060758,0.919578694394,50,0.1,1000],[13.3500755792,-0.95181558434,8.0987784949,0.126747602227,0.339820845527,0.0138832147063,0.931806897712,50,0.1,1000],[13.3155352548,-0.780403718805,7.97327873839,0.110531069289,0.327987514822,0.0103441405281,0.93813648879,50,0.1,1000],[13.330592207,-0.257443270699,7.70228813256,0.0702227540703,0.317110448812,0.00835676103598,0.945748324138,50,0.1,1000],[13.1994858458,-0.0570144504666,7.57553158419,0.0529681774992,0.30254011197,0.0030752108201,0.951658760218,50,0.1,1000],[13.1729036947,0.409507692682,7.192478558,0.0183137623755,0.295859035567,-0.00210061249395,0.95505372865,50,0.1,1000],[12.953480973,0.598651603746,7.05184820933,0.00307875464114,0.279462061189,-0.00872762102863,0.960112132127,50,0.1,1000],[12.9031334091,0.973780456483,6.57971231138,-0.0238825496051,0.277623826029,-0.0151097018129,0.960274092099,50,0.1,1000],[12.6097231651,1.11807021992,6.42630010331,-0.0349184599832,0.260536045491,-0.0220334754534,0.964580839594,50,0.1,1000],[12.545640691,1.38842284873,5.89313843995,-0.0538891758702,0.263980447816,-0.0278028195197,0.962620009724,50,0.1,1000],[12.1910929707,1.46823308017,5.7351614888,-0.059736705385,0.247176700254,-0.0338886235257,0.966533375563,50,0.1,1000],[12.1137888872,1.63673237729,5.16441753958,-0.071535698344,0.255871048122,-0.0380106533628,0.963310874446,50,0.1,1000],[11.7070239292,1.64480023534,5.01059364994,-0.0721073896114,0.239940352257,-0.0425189036465,0.967171801985,50,0.1,1000],[11.6110724212,1.72268682007,4.41848028197,-0.0779467752323,0.253417989113,-0.0448197849401,0.963169149165,50,0.1,1000],[11.1578603104,1.66002135559,4.27502857188,-0.0736318329091,0.238551720734,-0.0475130181682,0.967168001343,50,0.1,1000],[11.0358263067,1.66177674132,3.67204549009,-0.0746981588791,0.256110427702,-0.0483934552065,0.962541275674,50,0.1,1000],[10.5401460784,1.53489746999,3.54236438052,-0.0660911613192,0.242208048831,-0.0493990534356,0.966709342562,50,0.1,1000],[10.385023219,1.47643790478,2.93572583458,-0.0634376563078,0.263100820436,-0.0495158259648,0.961406160281,50,0.1,1000],[9.85011363555,1.29626063852,2.82133334656,-0.0512426228078,0.249894268424,-0.0491496520367,0.965666277718,50,0.1,1000],[9.65663335668,1.19477475038,2.2171798728,-0.0458414616106,0.273450602968,-0.0492083675972,0.959532107171,50,0.1,1000],[14.3932258164,1.01034618317,3.01085925903,-0.0229763786793,-0.135904997006,0.0261805470346,0.990109335765,50,0.1,1000],[18.3416053754,0.8939612017,2.86911684335,-0.013360773398,0.125566812435,-0.0173111902054,0.991844134954,50,0.1,1000],[19.5425926889,0.627192886537,2.21184719349,-0.00272878116884,0.218165625333,-0.034905745094,0.975283498597,50,0.1,1000],[20.0757286139,0.477188767321,1.35789974988,0.0015625207702,0.290229364288,-0.0458840701478,0.955855180841,50,0.1,1000],[19.6332870876,0.221278900543,1.21280568298,0.0177755674469,0.28901131666,-0.0462021566906,0.956044898925,50,0.1,1000],[19.3132528861,0.0853390664418,0.665892919219,0.0259418231139,0.315983383934,-0.0491801843917,0.947134009712,50,0.1,1000],[18.6515422808,-0.150072552839,0.626197340969,0.0431271385874,0.303127782772,-0.0472626262489,0.950799580032,50,0.1,1000],[18.2939749028,-0.24779398556,0.0733508814215,0.0494715727013,0.332788444286,-0.0522092012749,0.940254547528,50,0.1,1000],[17.6300986896,-0.445086194941,0.0559460198978,0.0651452627619,0.320385971531,-0.0509708208275,0.943668850503,50,0.1,1000],[17.2537549824,-0.498459498182,-0.44816362892,0.0688340353817,0.351999298535,-0.0577168027687,0.931679741157,50,0.1,1000],[16.5958758039,-0.651073362546,-0.411811330486,0.082265738556,0.339211360885,-0.0571884988712,0.935359543974,50,0.1,1000],[16.2191122625,-0.657571976384,-0.842448005091,0.0824414678939,0.372523991617,-0.0652820050455,0.922045302498,50,0.1,1000],[15.58505837,-0.762716812246,-0.742651162702,0.0928582918609,0.359613064628,-0.0655628729973,0.926151872571,50,0.1,1000],[15.2265108091,-0.722575367796,-1.0928466233,0.0888119234122,0.394681922156,-0.0742870356907,0.911493312598,50,0.1,1000],[14.6308971038,-0.781238151851,-0.927238547506,0.0956816660398,0.381942737062,-0.0753120622038,0.916129280002,50,0.1,1000],[14.3050224586,-0.696127182341,-1.19880363381,0.0869712054151,0.418702170725,-0.0836399441549,0.90007158682,50,0.1,1000],[13.7589682684,-0.711736984226,-0.969741061925,0.0900383088433,0.406332701662,-0.0851686401892,0.90528069748,50,0.1,1000],[13.4763681798,-0.583870437005,-1.17018763818,0.0765177811221,0.444585529403,-0.0918756926264,0.887720447732,50,0.1,1000],[12.9880820747,-0.561719160147,-0.883661545885,0.0758211334555,0.432692369829,-0.0935609601199,0.893462263084,50,0.1,1000],[12.7556276331,-0.394170107556,-1.02422319821,0.0576962852105,0.472149207024,-0.097395828837,0.874219833626,50,0.1,1000],[12.330687001,-0.341808388906,-0.688657856607,0.0536251795694,0.4607674646,-0.0988967638794,0.880361922039,50,0.1,1000],[12.1514776021,-0.139885273194,-0.782390281177,0.0315642825697,0.501079763744,-0.0987901726153,0.859164284772,50,0.1,1000],[11.8423442933,-0.106223409517,-0.429509323778,0.0290653938278,0.4850698959,-0.100129857643,0.868237531198,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[1.84458035004,2.97785649555,16.1425329391,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[1.8395401521,2.88539446237,16.1177609679,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[1.90493043976,2.82762422141,16.0649803055,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[2.15737211219,2.74529647637,15.9421135289,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[2.40007199467,2.70523097442,15.8532923609,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[2.91720764,2.66096640006,15.6998475695,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[3.29839218875,2.64666938686,15.6011716013,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.9966131749,2.64370892019,15.4341691796,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[4.46543729026,2.65337663094,15.324331271,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[5.2736576202,2.68558299801,15.1292517133,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[5.79414811949,2.71424316383,14.9942841931,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[6.66482548145,2.77248057396,14.743429867,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[7.21252536248,2.81395869726,14.5643180116,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[8.11053605864,2.88753811075,14.2254383933,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[8.66509267053,2.93482007303,13.9822984386,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[9.55740766187,3.01185529108,13.5247335526,-0.105639044978,0.0992933224018,0.0685679515232,0.987056059364,50,0.1,1000],[10.0977864708,3.05735838323,13.2004322592,-0.106054363424,0.118515261913,0.0731398568098,0.984559376594,50,0.1,1000],[10.9484767355,3.12544896034,12.6006801175,-0.106561280604,0.150193266901,0.0795202482851,0.979675051314,50,0.1,1000],[11.4520204068,3.15769159993,12.1847510857,-0.106525354167,0.169951778652,0.0828258226008,0.97617038726,50,0.1,1000],[12.2230056094,3.19807235214,11.4321346605,-0.1063018872,0.202220527245,0.0869652807053,0.969661697238,50,0.1,1000],[12.664084962,3.2167700436,10.9198297517,-0.106178019912,0.222205988313,0.0888776177453,0.965117348258,50,0.1,1000],[13.3128872996,3.23412285062,10.0128820542,-0.106039649491,0.254667423486,0.0907508532956,0.956903536819,50,0.1,1000],[13.6669926894,3.23429985166,9.40938489849,-0.105904915138,0.274701588951,0.091235741484,0.951314472429,50,0.1,1000],[14.1562366327,3.21724228319,8.3643860121,-0.105751756369,0.307138784966,0.0908136231079,0.9414006685,50,0.1,1000],[14.4014733245,3.19442839186,7.68341529657,-0.105626857079,0.327116149251,0.0899064005852,0.934748538965,50,0.1,1000],[14.6983976696,3.13909792417,6.52837108766,-0.105564566254,0.359391705531,0.087338871109,0.923074019751,50,0.1,1000],[14.816574743,3.092770227,5.79046645842,-0.105543347211,0.379238642619,0.0851807640611,0.915304807831,50,0.1,1000],[14.8957448978,3.00086392554,4.56350727831,-0.105736195601,0.411241496145,0.0807752954983,0.901762518863,50,0.1,1000],[14.8739381643,2.93349963952,3.79480349177,-0.105922209783,0.430886232069,0.0775968666647,0.892802479147,50,0.1,1000],[14.719628826,2.81095709234,2.54187828763,-0.106519979445,0.462489415206,0.0717891044556,0.877270402603,50,0.1,1000],[14.5515883586,2.72728385483,1.77249349352,-0.106994100726,0.481841222497,0.0678912816162,0.867047906746,50,0.1,1000],[14.159933219,2.58308757747,0.54443406534,-0.108093522029,0.512877222874,0.061213967543,0.849426627161,50,0.1,1000],[13.8473098493,2.48931989198,-0.193562522949,-0.108896004473,0.531817277365,0.0569485680677,0.837895521112,50,0.1,1000],[13.2352668025,2.33607815683,-1.34196857803,-0.110517946994,0.562072652872,0.0499996717884,0.818144332687,50,0.1,1000],[12.8077966539,2.24386484291,-2.01113083299,-0.111636816623,0.580456427882,0.0457490777854,0.805304028542,50,0.1,1000],[12.0537235061,2.10483237129,-3.02191182254,-0.113710366455,0.609683899595,0.0391571942342,0.783468065255,50,0.1,1000],[11.5590385821,2.02588184034,-3.59758944745,-0.115072863676,0.627353181084,0.0353113051691,0.769375937989,50,0.1,1000],[10.7168975343,1.9110682166,-4.45170182808,-0.117424307366,0.655296767713,0.0296946650712,0.745597683158,50,0.1,1000],[13.2460525122,4.89372411241,-3.94182524041,-0.36696632353,-0.493878824757,-0.188032619099,0.765547619686,50,0.1,1000],[15.2132312256,6.1497467761,-5.86879251317,-0.56269383406,-0.455841598182,-0.33608411903,0.602188966533,50,0.1,1000],[17.5991860484,5.68187153265,-7.26611330846,-0.326237908335,0.728801594587,0.432467592724,0.418794513021,50,0.1,1000],[19.0674127256,3.77683167356,-8.24614710183,-0.212732123609,0.815224261713,0.214377194089,0.494162792361,50,0.1,1000],[19.0261229251,3.07828833151,-8.47715620333,-0.179019119926,0.831236255641,0.151346630694,0.504076025403,50,0.1,1000],[18.5349126718,2.46238312829,-8.73097384904,-0.15151151356,0.845116726096,0.0978531899856,0.50323626036,50,0.1,1000],[18.1332971593,2.24842451501,-8.85369815436,-0.142552587946,0.851379470478,0.0794458682798,0.498517914354,50,0.1,1000],[17.4152472126,2.03628885334,-9.02243445425,-0.133535398756,0.860968033485,0.0617230287209,0.486921564856,50,0.1,1000],[16.9518700772,1.95531983432,-9.10748020091,-0.129775895667,0.866814098551,0.0554124352079,0.478247841062,50,0.1,1000],[16.182961273,1.87208800265,-9.21711644038,-0.124730107162,0.876604607828,0.0501297953414,0.462053855649,50,0.1,1000],[15.7034555841,1.84055868438,-9.26621953647,-0.121870431846,0.88280872559,0.0490504041352,0.450988258958,50,0.1,1000],[14.9226181523,1.81032355427,-9.31549840379,-0.116914363694,0.893165311089,0.0499684217028,0.431381403704,50,0.1,1000],[14.4412673711,1.80068928654,-9.32654950644,-0.113561507467,0.899678445852,0.0517797961636,0.418331603876,50,0.1,1000],[13.664352587,1.79464783056,-9.31177992829,-0.107266182219,0.910347988712,0.0562902296091,0.395716964067,50,0.1,1000],[13.188711395,1.79497320859,-9.28213670569,-0.102852969819,0.91693396274,0.0597938876928,0.380891146613,50,0.1,1000],[12.4261331893,1.79923972179,-9.19908199295,-0.0946220576047,0.927479196001,0.0663151422105,0.355571805848,50,0.1,1000],[11.9621639053,1.80316536284,-9.12605753227,-0.088925554018,0.933841563612,0.070670502163,0.339172316143,50,0.1,1000],[11.2232657881,1.80974233444,-8.97066249158,-0.0785881800887,0.943777885345,0.077978045115,0.311490971882,50,0.1,1000],[10.7767775968,1.81335648618,-8.85193755555,-0.0716037802545,0.949620508699,0.0824902171063,0.293750152669,50,0.1,1000],[10.0711106456,1.81713821996,-8.62105705032,-0.0593076202291,0.958496601904,0.089544227439,0.264099794876,50,0.1,1000],[9.64817249973,1.81790504213,-8.45512270981,-0.0512144672729,0.963562843211,0.0936211903803,0.245272905632,50,0.1,1000],[8.98580125062,1.81566912968,-8.14726128506,-0.0373878157261,0.971011767135,0.0995552009755,0.21407256078,50,0.1,1000],[8.71875204366,1.81346762042,-8.00507563642,-0.0314191710372,0.973825281601,0.101743962116,0.20081165997,50,0.1,1000]]} diff --git a/test/golden/fixtures/extension.lens.json b/test/golden/fixtures/extension.lens.json index 004596b..4ae1849 100644 --- a/test/golden/fixtures/extension.lens.json +++ b/test/golden/fixtures/extension.lens.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,35,0.2,500],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,35,0.2,500],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,35,0.2,500],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,35,0.2,500],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,35,0.2,500],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,35,0.2,500],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,35,0.2,500],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,35,0.2,500],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,35,0.2,500],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,35,0.2,500],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,35,0.2,500],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,35,0.2,500],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,35,0.2,500],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,35,0.2,500],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,35,0.2,500],[8.84259869379,3.64114351642,13.1180583299,-0.109795199157,0.0970496190652,0.0615563316853,0.987287801865,35,0.2,500],[9.3947965511,3.63767685629,12.7005727033,-0.110662477238,0.11573665983,0.0617636525318,0.98516196279,35,0.2,500],[10.2631201754,3.62038439697,11.9642931392,-0.112144492888,0.146608575304,0.0611389491671,0.980913639041,35,0.2,500],[10.7778221584,3.60281692785,11.4758694748,-0.113105668991,0.165869294045,0.0601566351579,0.977791217071,35,0.2,500],[11.5738854441,3.56354638577,10.6273753576,-0.114758635317,0.19744470172,0.0576760362823,0.971863941209,35,0.2,500],[12.037602117,3.53326941512,10.0720445667,-0.115837437861,0.217029322177,0.05561872664,0.96767066637,35,0.2,500],[12.7410006211,3.47524554438,9.11952253352,-0.117698858411,0.24899007721,0.0515461238931,0.959944746999,35,0.2,500],[13.1419642456,3.43476971356,8.50333252542,-0.118912722796,0.26874408683,0.0486180262405,0.954606027467,35,0.2,500],[13.734807458,3.36279962365,7.45826618617,-0.120996599503,0.300887177784,0.0433371056847,0.944959588779,35,0.2,500],[14.0627164616,3.31546500876,6.78929885886,-0.122343077924,0.320706154094,0.0397994320991,0.938400628311,35,0.2,500],[14.5295036028,3.23545815426,5.66644133913,-0.124626781598,0.352881307333,0.0337595497365,0.92671637573,35.6133083707,0.2,486.61252423],[14.7755892408,3.18513445318,4.95475003549,-0.126080181126,0.37267836013,0.0298987234349,0.918869247584,37.2066699108,0.2,455.755613273],[15.103490121,3.10361176577,3.77192660255,-0.128504518801,0.404743915867,0.0235697166287,0.90504884933,40.9300349514,0.2,395.383970028],[15.2607660663,3.05439437291,3.02934889011,-0.130018101358,0.424427460744,0.0196748151283,0.895862447888,43.5334963396,0.2,360.003915554],[15.4400988679,2.97799406264,1.80703531514,-0.132491883465,0.456222118398,0.0135201665772,0.879843443231,47.7849365509,0.2,311.616346517],[15.4700364844,2.93389990529,1.04686022749,-0.13432739023,0.474856274438,0.0098734109599,0.869695456247,50.2803328174,0.2,287.913647234],[15.4449307728,2.86888611336,-0.19247399314,-0.13718290336,0.505227825083,0.0044470700059,0.852001126382,53.9736290873,0.2,258.511276763],[15.4019781879,2.83355367827,-0.955976318948,-0.13867311605,0.524306811213,0.00139650144982,0.840160808646,55.9991472954,0.2,245.071939226],[15.2708151043,2.78533778752,-2.18872284558,-0.140796784067,0.555270820199,-0.00298969272732,0.819659468053,58.8614746325,0.2,229.147490239],[15.1482106209,2.76173971649,-2.94087243828,-0.141935286674,0.574158020392,-0.00531447059334,0.806330390361,60.375522852,0.2,222.13174854],[14.8756183398,2.73443306761,-4.14325818429,-0.143524117924,0.604293511693,-0.00833167626383,0.783684096094,62.4582469636,0.2,214.037164649],[14.6622945173,2.72461640146,-4.86957960264,-0.144308797797,0.622475132716,-0.00968769412869,0.76915916988,63.5354394565,0.2,210.551565646],[14.2417143628,2.72064489493,-6.01865761095,-0.145227414991,0.651278425296,-0.0109422682874,0.744731950063,64.9913497145,0.2,206.599402008],[14.1943797251,2.72552113541,-6.70547258939,-0.393503521094,-0.476888879172,-0.124685137633,0.776006180557,65.7329016771,0.2,204.923868313],[14.9950931239,2.74534200032,-7.78002890721,-0.648259301734,-0.327606714845,-0.196439193025,0.658669387133,66.7227891611,0.2,203.047242483],[15.7021006002,2.76455347907,-8.41497101822,-0.420503885102,0.677176184632,0.360590694658,0.484337948655,67.221402657,0.2,202.260578319],[16.8315892269,2.80651749345,-9.39627085046,-0.253413068516,0.794336930619,0.175084821762,0.523599047506,67.880875129,0.2,201.38750393],[17.4216599206,2.83840555649,-9.96868533944,-0.212065956501,0.812650520011,0.119334206983,0.529515353379,68.2102655091,0.2,201.024642251],[18.1216126115,2.8988013766,-10.8410168825,-0.176307370341,0.828760648288,0.0744312008841,0.525862620223,68.6428236428,0.2,200.624750429],[18.3851902948,2.94049478982,-11.342230669,-0.162792122106,0.836543909236,0.0605030529147,0.519646411984,68.8574501631,0.2,200.459663636],[18.5491923525,3.01379604106,-12.0932371144,-0.146824922071,0.848695019234,0.0491782585209,0.50570812281,69.137703499,0.2,200.278746881],[18.5040495666,3.06142584076,-12.5167002972,-0.138843405166,0.856253359592,0.0464802381212,0.495370851478,69.2760197009,0.2,200.204462693],[18.2255512665,3.14073905202,-13.1375097512,-0.127218537,0.868804106734,0.046476035455,0.476271819547,69.4557955103,0.2,200.123426435],[17.9471804938,3.18977099968,-13.4788172312,-0.120371700413,0.876666137047,0.0483501743176,0.463281122579,69.5441334233,0.2,200.090300999],[17.353652875,3.26745718715,-13.9639855532,-0.109262193677,0.889506454442,0.053485250701,0.440430889581,69.65850993,0.2,200.054301397],[16.91706698,3.31311740075,-14.2207876285,-0.102239653654,0.897374968174,0.0575652000149,0.425383905976,69.714505859,0.2,200.039640531],[16.1182612198,3.38153565343,-14.568067427,-0.0903957020749,0.909912403051,0.0651628488202,0.399552047866,69.7867725969,0.2,200.023758488],[15.5826677904,3.41929080756,-14.7398772805,-0.0827636222081,0.91740781247,0.0702160364383,0.382861328269,69.8220423123,0.2,200.01731098],[14.6608815859,3.47159136589,-14.9498278371,-0.0698321953497,0.929057911939,0.0786681329358,0.354663482214,69.867434419,0.2,200.010345503],[14.0691511712,3.49763364109,-15.0377376694,-0.0615342089577,0.935853027478,0.0838633815503,0.33668915237,69.8895285769,0.2,200.00752548],[13.0827348837,3.52851320346,-15.1132026143,-0.0476265323035,0.946156261612,0.0920033053067,0.306684583645,69.9178956758,0.2,200.004486104],[12.4648538345,3.54019355239,-15.119531083,-0.0388365060212,0.952015719499,0.0967112477326,0.287758110553,69.9316708838,0.2,200.003258503],[11.4543712878,3.54651977885,-15.0650326662,-0.0243789132889,0.960672268425,0.103647598111,0.256459814925,69.9493201442,0.2,200.001938144],[10.8311563838,3.54267296951,-14.9929412903,-0.0154364976948,0.965461202364,0.107395170996,0.236881106288,69.9578731804,0.2,200.001405959],[9.82487619389,3.52389146989,-14.8140635203,-0.00108210088158,0.972329850456,0.112487992457,0.20474360191,69.9688114291,0.2,200.000834602],[9.40925954476,3.51170673539,-14.7177652213,0.00478172315879,0.974860530405,0.114217626734,0.191254843402,69.9724919525,0.2,200.00067137]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,35,0.2,500],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,35,0.2,500],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,35,0.2,500],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,35,0.2,500],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,35,0.2,500],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,35,0.2,500],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,35,0.2,500],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,35,0.2,500],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,35,0.2,500],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,35,0.2,500],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,35,0.2,500],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,35,0.2,500],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,35,0.2,500],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,35,0.2,500],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,35,0.2,500],[8.87580901604,3.57707574466,13.1269004424,-0.105639044978,0.0992933224018,0.0685679515232,0.987056059364,35,0.2,500],[9.4281195889,3.57669757997,12.7041654926,-0.106054363424,0.118515261913,0.0731398568098,0.984559376594,35,0.2,500],[10.2941538206,3.56655823438,11.9586018407,-0.106561280604,0.150193266901,0.0795202482851,0.979675051314,35,0.2,500],[10.8076726974,3.55065400753,11.4667703214,-0.106525354167,0.169951778652,0.0828258226008,0.97617038726,35,0.2,500],[11.5993445495,3.5152057418,10.6130226632,-0.1063018872,0.202220527245,0.0869652807053,0.969661697238,35,0.2,500],[12.059961016,3.49086687486,10.0557024613,-0.106178019912,0.222205988313,0.0888776177453,0.965117348258,35,0.2,500],[12.7554673735,3.44631908065,9.10022423829,-0.106039649491,0.254667423486,0.0907508532956,0.956903536819,35,0.2,500],[13.1519888097,3.4153447421,8.48385496219,-0.105904915138,0.274701588951,0.091235741484,0.951314472429,35,0.2,500],[13.7354274415,3.36033798991,7.43932222836,-0.105751756369,0.307138784966,0.0908136231079,0.9414006685,35,0.2,500],[14.0586365105,3.32357716959,6.77213736597,-0.105626857079,0.327116149251,0.0899064005852,0.934748538965,35,0.2,500],[14.5161046542,3.26125753602,5.65295938655,-0.105564566254,0.359391705531,0.087338871109,0.923074019751,35.6133083707,0.2,486.61252423],[14.7580290173,3.22140180344,4.94451486637,-0.105543347211,0.379238642619,0.0851807640611,0.915304807831,37.2066699108,0.2,455.755613273],[15.0777810428,3.1568499565,3.76747557324,-0.105736195601,0.411241496145,0.0807752954983,0.901762518863,40.9300349514,0.2,395.383970028],[15.2318920186,3.11730408818,3.02889133892,-0.105922209783,0.430886232069,0.0775968666647,0.892802479147,43.5334963396,0.2,360.003915554],[15.4047902355,3.05618510887,1.81331979191,-0.106519979445,0.462489415206,0.0717891044556,0.877270402603,47.7849365509,0.2,311.616346517],[15.466349588,3.02044202091,1.05724320303,-0.106994100726,0.481841222497,0.0678912816162,0.867047906746,50.2803328174,0.2,287.913647234],[15.4864835209,2.96821315884,-0.175264024341,-0.108093522029,0.512877222874,0.061213967543,0.849426627161,53.9736290873,0.2,258.511276763],[15.4529356622,2.9394624737,-0.934965431355,-0.108896004473,0.531817277365,0.0569485680677,0.837895521112,55.9991472954,0.2,245.071939226],[15.3182169161,2.90084346032,-2.16123575848,-0.110517946994,0.562072652872,0.0499996717884,0.818144332687,58.8614746325,0.2,229.147490239],[15.1895047638,2.8816915543,-2.91000742194,-0.111636816623,0.580456427882,0.0457490777854,0.805304028542,60.375522852,0.2,222.13174854],[14.9020547121,2.8602642855,-4.10628596484,-0.113710366455,0.609683899595,0.0391571942342,0.783468065255,62.4582469636,0.2,214.037164649],[14.6807660839,2.8525125572,-4.82955686371,-0.115072863676,0.627353181084,0.0353113051691,0.769375937989,63.5354394565,0.2,210.551565646],[14.2469852392,2.85039806623,-5.97263988764,-0.117424307366,0.655296767713,0.0296946650712,0.745597683158,64.9913497145,0.2,206.599402008],[14.1941142553,2.8548395815,-6.65920465669,-0.36696632353,-0.493878824757,-0.188032619099,0.765547619686,65.7329016771,0.2,204.923868313],[14.9856813677,2.87194363054,-7.77370379959,-0.56269383406,-0.455841598182,-0.33608411903,0.602188966533,66.7227891611,0.2,203.047242483],[15.6886536175,2.88764692054,-8.45665253914,-0.326237908335,0.728801594587,0.432467592724,0.418794513021,67.221402657,0.2,202.260578319],[16.8104164056,2.92177783377,-9.54110397267,-0.212732123609,0.815224261713,0.214377194089,0.494162792361,67.880875129,0.2,201.38750393],[17.3979071911,2.94746405671,-10.1741080907,-0.179019119926,0.831236255641,0.151346630694,0.504076025403,68.2102655091,0.2,201.024642251],[18.0952332671,2.9963854948,-11.1315038307,-0.15151151356,0.845116726096,0.0978531899856,0.50323626036,68.6428236428,0.2,200.624750429],[18.3605204934,3.03022459083,-11.6678476069,-0.142552587946,0.851379470478,0.0794458682798,0.498517914354,68.8574501631,0.2,200.459663636],[18.5308064163,3.0899578555,-12.4509017104,-0.133535398756,0.860968033485,0.0617230287209,0.486921564856,69.137703499,0.2,200.278746881],[18.4926971369,3.12881774552,-12.8777301928,-0.129775895667,0.866814098551,0.0554124352079,0.478247841062,69.2760197009,0.2,200.204462693],[18.2289320355,3.19331195718,-13.48433787,-0.124730107162,0.876604607828,0.0501297953414,0.462053855649,69.4557955103,0.2,200.123426435],[17.9615613719,3.23300429082,-13.8073587478,-0.121870431846,0.88280872559,0.0490504041352,0.450988258958,69.5441334233,0.2,200.090300999],[17.3878062417,3.29500812369,-14.2528663532,-0.116914363694,0.893165311089,0.0499684217028,0.431381403704,69.65850993,0.2,200.054301397],[16.9637963011,3.3309603642,-14.4824332025,-0.113561507467,0.899678445852,0.0517797961636,0.418331603876,69.714505859,0.2,200.039640531],[16.1857603865,3.38318033999,-14.7834030705,-0.107266182219,0.910347988712,0.0562902296091,0.395716964067,69.7867725969,0.2,200.023758488],[15.6620583635,3.41111921262,-14.928361527,-0.102852969819,0.91693396274,0.0597938876928,0.380891146613,69.8220423123,0.2,200.01731098],[14.7587495563,3.44723697829,-15.0971553759,-0.0946220576047,0.927479196001,0.0663151422105,0.355571805848,69.867434419,0.2,200.010345503],[14.1766206581,3.46374185047,-15.1635490655,-0.088925554018,0.933841563612,0.070670502163,0.339172316143,69.8895285769,0.2,200.00752548],[13.2043048407,3.47918955783,-15.2082180687,-0.0785881800887,0.943777885345,0.077978045115,0.311490971882,69.9178956758,0.2,200.004486104],[12.5928734014,3.48209575712,-15.1999139038,-0.0716037802545,0.949620508699,0.0824902171063,0.293750152669,69.9316708838,0.2,200.003258503],[11.5911867071,3.47458754845,-15.1257014311,-0.0593076202291,0.958496601904,0.089544227439,0.264099794876,69.9493201442,0.2,200.001938144],[10.9710442713,3.46324036449,-15.0453635134,-0.0512144672729,0.963562843211,0.0936211903803,0.245272905632,69.9578731804,0.2,200.001405959],[9.9682532412,3.43305556635,-14.8561700896,-0.0373878157261,0.971011767135,0.0995552009755,0.21407256078,69.9688114291,0.2,200.000834602],[9.55263618518,3.41693003111,-14.757609751,-0.0314191710372,0.973825281601,0.101743962116,0.20081165997,69.9724919525,0.2,200.00067137]]} diff --git a/test/golden/fixtures/groups.clearShot.json b/test/golden/fixtures/groups.clearShot.json index 71f913f..f3b990e 100644 --- a/test/golden/fixtures/groups.clearShot.json +++ b/test/golden/fixtures/groups.clearShot.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[7.35196035355,3.62463763935,14.0816835821,-0.10767713881,0.0496940414242,0.0588282434207,0.991198957728,50,0.1,1000],[7.92570601283,3.6352728188,13.7371811672,-0.10845494613,0.0674003612585,0.0602276801125,0.989983506181,50,0.1,1000],[7.99757660135,3.75595664728,13.3954843024,-0.117557651714,0.0636966375539,0.0563726210965,0.989416527292,50,0.1,1000],[7.26310198199,4.06855439447,13.0946461594,-0.139877294159,0.0215667919845,0.0413897800808,0.989068300052,50,0.1,1000],[5.78055588948,4.80289879896,12.2778753168,-0.18390410789,-0.0778261158794,-0.00662045367415,0.979835978305,50,0.1,1000],[4.99206991092,5.28615950859,11.6392347204,-0.204042436811,-0.137375762048,-0.0430897298435,0.968317024101,50,0.1,1000],[4.30608754123,5.92425636919,10.5691533982,-0.222466194747,-0.197155277043,-0.0882401191977,0.950711454803,50,0.1,1000],[4.35247220642,6.13130833482,10.0334042721,-0.229313468872,-0.203556044061,-0.0996296642967,0.946601394417,50,0.1,1000],[5.01243307731,6.13811454113,9.52734813111,-0.236292505399,-0.174108309147,-0.0944304197766,0.951280739003,50,0.1,1000],[5.44256979174,6.12315955755,9.21460663306,-0.240423080661,-0.153105706063,-0.0895403611573,0.954325892335,50,0.1,1000],[6.11227157294,6.10714978809,8.65221624458,-0.247421042888,-0.118603533775,-0.0814023658486,0.95816996621,50,0.1,1000],[6.50480505012,6.10263761455,8.27346484442,-0.251852570507,-0.0970861733642,-0.0762433196713,0.959860153291,50,0.1,1000],[7.10347979973,6.10468329468,7.60790292608,-0.259207828479,-0.0618445447721,-0.0676396196804,0.961463174431,50,0.1,1000],[7.44636358971,6.11181797497,7.16867247469,-0.263777685003,-0.0399258523825,-0.0621786554692,0.961748966212,50,0.1,1000],[7.9552045488,6.1333256848,6.41140113256,-0.271228323465,-0.00412448475585,-0.0530638177396,0.961042359328,50,0.1,1000],[8.23745250538,6.15263872813,5.92025871909,-0.275776558912,0.0180857319442,-0.0472772931919,0.959888042119,50,0.1,1000],[8.63994807449,6.19392757197,5.08761463456,-0.283065154052,0.0542676908807,-0.0376175568177,0.956824986979,50,0.1,1000],[8.85235846514,6.22529481775,4.55604331079,-0.287434367628,0.0766568947936,-0.031487010882,0.954208453606,50,0.1,1000],[9.13552434214,6.28565977094,3.66882030393,-0.294306133314,0.113031352956,-0.0212543697893,0.948765547913,50,0.1,1000],[9.27144658895,6.32835486407,3.11081173753,-0.298339402458,0.135478829,-0.0147635808787,0.944680435128,50,0.1,1000],[9.42702032354,6.40616061215,2.19333558678,-0.304537758803,0.171840691399,-0.00393287132692,0.936862883653,50,0.1,1000],[9.48302879456,6.45890910219,1.62466018905,-0.30807551766,0.194213189649,0.00293249309438,0.931322775878,50,0.1,1000],[9.50839586464,6.55165718317,0.703359723264,-0.313337209276,0.230334728768,0.0143811063241,0.921172562437,50,0.1,1000],[9.48472963696,6.61265996552,0.140555881698,-0.316214796971,0.252484170591,0.0216298132606,0.914216657558,50,0.1,1000],[8.778863727,6.27366252117,-0.621406462733,-0.326346016376,0.244842122147,0.0242910566817,0.91266672854,50,0.1,1000],[7.48554121414,5.60485409413,-1.70589954858,-0.371304306143,0.0232862012351,-0.00634326844165,0.928197515628,50,0.1,1000],[5.06770773913,4.12913626801,-4.10215472172,-0.268929395692,-0.445775597391,-0.0447944080979,0.85261630169,50,0.1,1000],[3.91655346638,3.18018221266,-5.64076079256,-0.177766822108,-0.59781792243,-0.00406182094988,0.781662452846,50,0.1,1000],[3.10618762585,1.97530155123,-7.58012602322,-0.111599790545,-0.684626131105,0.0450880690242,0.71888776133,50,0.1,1000],[3.30981636717,1.6474579045,-8.0918468916,-0.0976413324087,-0.697626319847,0.0558264882177,0.707578328721,50,0.1,1000],[4.14654623103,1.65132360919,-8.03789968232,-0.0947684851908,-0.690002272934,0.0546767931505,0.715490213666,50,0.1,1000],[4.53631529734,1.67339781442,-7.96179946857,-0.0931681389155,-0.683486320992,0.0530562188921,0.722046525194,50,0.1,1000],[4.95484862128,1.72577611875,-7.79119921435,-0.0907007188351,-0.67037383558,0.0493549671395,0.734803638662,50,0.1,1000],[5.09589151663,1.76728058608,-7.65774478537,-0.0894990717043,-0.660665314524,0.0463288703138,0.743885000604,50,0.1,1000],[5.16650624123,1.84794563691,-7.39501689284,-0.0885607070777,-0.64224515866,0.0400353160108,0.760312653329,50,0.1,1000],[5.13085217351,1.90466221583,-7.20567946943,-0.0888352214274,-0.629370198049,0.0352231567645,0.771207356338,50,0.1,1000],[6.01569221121,2.02353766937,-7.64544056904,-0.105687017265,-0.649622334436,0.0152370381517,0.75272100386,50,0.1,1000],[7.58728330513,2.2155997717,-8.62624871888,-0.149324374286,-0.743160110292,-0.0621465667398,0.649271196002,50,0.1,1000],[10.6707990644,2.66037096463,-10.892699652,-0.0819917596552,0.964862189437,0.179960514735,0.173010172766,50,0.1,1000],[12.3705242221,2.96072620845,-12.4091529948,-0.0911373873762,0.94106265523,0.109028076794,0.306933110015,50,0.1,1000],[14.0076606435,3.36576228286,-14.4157563981,-0.0723024965302,0.932643635787,0.0835127720078,0.343473164211,50,0.1,1000],[14.0434466239,3.49311950241,-15.0150816823,-0.0616444599436,0.935990057366,0.0840364399587,0.336244627955,50,0.1,1000],[13.0827348837,3.52851320346,-15.1132026143,-0.0476265323035,0.946156261612,0.0920033053067,0.306684583645,50,0.1,1000],[12.4648538345,3.54019355239,-15.119531083,-0.0388365060212,0.952015719499,0.0967112477326,0.287758110553,50,0.1,1000],[11.4543712878,3.54651977885,-15.0650326662,-0.0243789132889,0.960672268425,0.103647598111,0.256459814925,50,0.1,1000],[10.8311563838,3.54267296951,-14.9929412903,-0.0154364976948,0.965461202364,0.107395170996,0.236881106288,50,0.1,1000],[9.82487619389,3.52389146989,-14.8140635203,-0.00108210088158,0.972329850456,0.112487992457,0.20474360191,50,0.1,1000],[9.40925954476,3.51170673539,-14.7177652213,0.00478172315879,0.974860530405,0.114217626734,0.191254843402,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.38238135205,3.55771799719,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.95793578994,3.56855344279,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.02419545139,3.69592589647,13.408412805,-0.11401626453,0.065339545141,0.0603240611693,0.989490799809,50,0.1,1000],[7.2719910099,4.02559083424,13.1012728659,-0.137419342527,0.0229994056205,0.0489406928051,0.989035772977,50,0.1,1000],[5.74447458999,4.80416854777,12.2674743983,-0.185456470007,-0.0765294617206,0.0108106848426,0.979608221849,50,0.1,1000],[4.92417827203,5.31876626497,11.6169689842,-0.208841634167,-0.136080565155,-0.020075631901,0.968227359988,50,0.1,1000],[4.19053561668,6.00222882933,10.5293634352,-0.230929561935,-0.196515248492,-0.0615680848286,0.950927266128,50,0.1,1000],[4.21796505135,6.22558105735,9.98853252454,-0.23836733017,-0.203436782051,-0.0729063830096,0.946825829249,50,0.1,1000],[4.86641563423,6.23693934723,9.48283007465,-0.244710500754,-0.174369336148,-0.067546751119,0.951393473724,50,0.1,1000],[5.29150368874,6.22179145369,9.17312400221,-0.24824618869,-0.15352566535,-0.0626249154756,0.954401288684,50,0.1,1000],[5.95061678301,6.20439327641,8.61687962328,-0.254164154722,-0.119491195423,-0.05485059924,0.958182575731,50,0.1,1000],[6.33762148957,6.19772684112,8.24422697993,-0.257848076042,-0.0982480984511,-0.050083255208,0.959871527018,50,0.1,1000],[6.92530777071,6.19515802343,7.59019591803,-0.263937525897,-0.063672837137,-0.0425123683617,0.961496464253,50,0.1,1000],[7.26308425698,6.19845107919,7.16013159891,-0.267694460823,-0.0421454697115,-0.0378530387337,0.96183708729,50,0.1,1000],[7.76216330477,6.21268313776,6.41944496665,-0.273839388355,-0.00720022501033,-0.030396888392,0.9612680039,50,0.1,1000],[8.04066358757,6.22687475796,5.94005079876,-0.277601408922,0.0145109881295,-0.0257827771767,0.96024066639,50,0.1,1000],[8.43607867556,6.25893723365,5.12800792664,-0.283688531104,0.0496701708175,-0.0183271595935,0.957453814381,50,0.1,1000],[8.64680574137,6.28433547318,4.60996199699,-0.28738300383,0.0714686287095,-0.0136804937968,0.955047689024,50,0.1,1000],[8.92653894235,6.33421620392,3.74597983117,-0.293282754821,0.106684300573,-0.00609158755723,0.950035040563,50,0.1,1000],[9.06321122346,6.37047421893,3.20239986709,-0.296821772441,0.128468511729,-0.00132545594714,0.94625098154,50,0.1,1000],[9.21945082163,6.43712621039,2.30948764677,-0.302373795659,0.163569979516,0.00653830857889,0.939027262661,50,0.1,1000],[9.27873760632,6.48327303771,1.7554129373,-0.305647391546,0.185227809211,0.011511453452,0.933883192468,50,0.1,1000],[9.30899608909,6.56467993335,0.858995784683,-0.310653275764,0.22002483582,0.0197846369577,0.924495636561,50,0.1,1000],[9.29110977004,6.61916499549,0.310461554452,-0.31352744698,0.241431597621,0.0250435277526,0.918032758336,50,0.1,1000],[8.57415206549,6.26771704364,-0.463854048704,-0.324332872308,0.231133865889,0.0239147755906,0.916958781783,50,0.1,1000],[7.25648745421,5.58124242648,-1.57568861395,-0.364642193924,-0.00773814960336,-0.0417749644479,0.930177963508,50,0.1,1000],[4.78353353541,4.07457968267,-4.03715012086,-0.228620646073,-0.470239183913,-0.0939160330627,0.847223399604,50,0.1,1000],[3.59695995002,3.11347646975,-5.63397678592,-0.139851299997,-0.61042409842,-0.039534918048,0.77862765441,50,0.1,1000],[2.73928659721,1.90907662126,-7.69182043698,-0.0868134239468,-0.692343280591,0.0251498832391,0.715885252409,50,0.1,1000],[2.93072357136,1.59235248988,-8.26266121544,-0.0796073017711,-0.705558025896,0.0416227627976,0.702935342131,50,0.1,1000],[3.76822386267,1.62086641733,-8.26355451885,-0.0832125772846,-0.700484185333,0.0450782563247,0.707365198386,50,0.1,1000],[4.16216765369,1.65614270088,-8.20639148378,-0.085361708507,-0.695495505357,0.0461100624268,0.711950309286,50,0.1,1000],[4.59025425843,1.72791151504,-8.04569315196,-0.0885335876311,-0.684552236911,0.046406296074,0.722077900566,50,0.1,1000],[4.62432319873,1.79339860767,-7.90687775166,-0.0908447513968,-0.676235901054,0.0454663686225,0.729647206938,50,0.1,1000],[4.6013611086,1.9032813958,-7.61090406559,-0.0947698373486,-0.659234752301,0.0426403694566,0.744721436633,50,0.1,1000],[4.5584239444,1.97136957772,-7.39221367259,-0.09753074245,-0.646620458364,0.0401420123236,0.755485510085,50,0.1,1000],[5.49082862745,2.09023152798,-7.82994194224,-0.114257237921,-0.667355560256,0.0221364976541,0.73558943389,50,0.1,1000],[7.14706493894,2.27451378682,-8.82034535163,-0.153204112316,-0.755003474493,-0.0455845037439,0.63594048974,50,0.1,1000],[10.4230742709,2.69575085248,-11.0886470666,-0.0680398621887,0.972659232031,0.182666246476,0.126244357877,50,0.1,1000],[12.2508886309,2.9764745011,-12.5938549184,-0.101127731735,0.945263000527,0.106347447378,0.291446842742,50,0.1,1000],[14.059885409,3.34784829332,-14.5650550063,-0.0951832179547,0.931803086408,0.0725957558898,0.342655832296,50,0.1,1000],[14.148973877,3.45952524005,-15.1410374853,-0.088952224047,0.934006359446,0.0709027024482,0.338662707037,50,0.1,1000],[13.2043048407,3.47918955783,-15.2082180687,-0.0785881800887,0.943777885345,0.077978045115,0.311490971882,50,0.1,1000],[12.5928734014,3.48209575712,-15.1999139038,-0.0716037802545,0.949620508699,0.0824902171063,0.293750152669,50,0.1,1000],[11.5911867071,3.47458754845,-15.1257014311,-0.0593076202291,0.958496601904,0.089544227439,0.264099794876,50,0.1,1000],[10.9710442713,3.46324036449,-15.0453635134,-0.0512144672729,0.963562843211,0.0936211903803,0.245272905632,50,0.1,1000],[9.9682532412,3.43305556635,-14.8561700896,-0.0373878157261,0.971011767135,0.0995552009755,0.21407256078,50,0.1,1000],[9.55263618518,3.41693003111,-14.757609751,-0.0314191710372,0.973825281601,0.101743962116,0.20081165997,50,0.1,1000]]} diff --git a/test/golden/fixtures/groups.mixingCamera.json b/test/golden/fixtures/groups.mixingCamera.json index 095679e..05d25fa 100644 --- a/test/golden/fixtures/groups.mixingCamera.json +++ b/test/golden/fixtures/groups.mixingCamera.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[-2.69941730642,5.59813397463,12.4852569492,-0.253970856597,-0.343747743232,-0.172909951059,0.887377282697,50,0.1,1000],[-2.79870523965,5.68637239306,12.3523572566,-0.237302084316,-0.377398504299,-0.167594254302,0.879301004012,50,0.1,1000],[-2.80740636184,5.73401189187,12.2901815257,-0.228019905615,-0.39240668107,-0.163514720068,0.875949117024,50,0.1,1000],[-2.71351377688,5.80071144075,12.2217379648,-0.215392292497,-0.40749649507,-0.156299075891,0.873569325076,50,0.1,1000],[-2.58919814126,5.83531922644,12.196774235,-0.209096726152,-0.411774934965,-0.151749661342,0.873894731835,50,0.1,1000],[-2.28573046271,5.88064743402,12.1762175112,-0.201103384442,-0.411866404591,-0.144476904718,0.876954911919,50,0.1,1000],[-2.04299901347,5.90194691602,12.1711215547,-0.197342274899,-0.408404464971,-0.140116905402,0.88013014512,50,0.1,1000],[-1.57012628586,5.92570259644,12.1654828235,-0.192863059517,-0.398079724916,-0.133267975846,0.886891210633,50,0.1,1000],[-1.23718637703,5.93390219621,12.1590989864,-0.190936616597,-0.389289944754,-0.129172803422,0.891802071208,50,0.1,1000],[-0.63966605701,5.9370873224,12.1350710475,-0.188989864059,-0.371735475179,-0.122704178864,0.900577177296,50,0.1,1000],[-0.241972249421,5.93320779403,12.108134459,-0.188404679597,-0.359189861095,-0.118804875268,0.906295604097,50,0.1,1000],[0.443292491641,5.91809072412,12.0370884815,-0.18835584063,-0.336442493887,-0.112592975727,0.915779093136,50,0.1,1000],[0.885624593313,5.90386059357,11.9736500535,-0.188804038094,-0.321142843565,-0.108818122498,0.921617559209,50,0.1,1000],[1.62965152921,5.87369856614,11.8324405736,-0.190254157152,-0.29450659471,-0.102760600324,0.930864909845,50,0.1,1000],[2.10060425601,5.85134505495,11.7198370471,-0.191534122184,-0.27709798236,-0.0990543121244,0.936333077201,50,0.1,1000],[2.87961939129,5.81000378255,11.4903747949,-0.194202427751,-0.247415842405,-0.0930685925605,0.944674046993,50,0.1,1000],[3.36555687209,5.7819979244,11.3188759541,-0.196157837411,-0.228315707447,-0.0893831643456,0.949423346293,50,0.1,1000],[4.15851475229,5.7335094935,10.9875636318,-0.199802635113,-0.196131420663,-0.0833956227103,0.956376778756,50,0.1,1000],[4.64691981146,5.70227903101,10.750067534,-0.202284977996,-0.175606724754,-0.0796880383112,0.960152530824,50,0.1,1000],[5.43392400486,5.65035856313,10.3074066165,-0.206658520259,-0.141262400578,-0.0736342213873,0.965357546005,50,0.1,1000],[5.91269867922,5.61798325997,9.99926083838,-0.209507403836,-0.11947644065,-0.0698694094334,0.967961927709,50,0.1,1000],[6.67426566303,5.56553204829,9.43965557184,-0.214334154924,-0.083171485723,-0.0637026932456,0.97112581104,50,0.1,1000],[7.13149260627,5.53344007129,9.05858305549,-0.217368743011,-0.0602117048924,-0.0598601163706,0.972389914913,50,0.1,1000],[7.84846669788,5.48206550532,8.38026865364,-0.222336651665,-0.0220368262069,-0.0535631789235,0.973248055472,50,0.1,1000],[8.27251863522,5.45074814257,7.92633450214,-0.225352248167,0.00206980465109,-0.0496439489971,0.973009536686,50,0.1,1000],[8.92647877998,5.40032324362,7.1312976004,-0.230108258649,0.0421147807121,-0.0432400016647,0.971291324374,50,0.1,1000],[9.30639102489,5.36907762234,6.60681823901,-0.232873273564,0.0673941800788,-0.0392735293926,0.969373845758,50,0.1,1000],[9.88041883018,5.31734702159,5.7005238167,-0.237016464338,0.109391810761,-0.0328368582859,0.964768556758,50,0.1,1000],[10.2064386623,5.28404583485,5.10979206616,-0.239266379133,0.13591886166,-0.0288873144189,0.960959513157,50,0.1,1000],[10.6860751356,5.22627129787,4.10050680042,-0.2423344132,0.180027615174,-0.0225541708925,0.953076806626,50,0.1,1000],[10.9396391924,5.18715649393,3.44921245609,-0.243846059111,0.207627700598,-0.0187259604062,0.947142637519,50,0.1,1000],[11.2957575956,5.1158146903,2.34677893069,-0.245434460919,0.253665773747,-0.0126687651574,0.935550695052,50,0.1,1000],[11.4869955246,5.06534807216,1.64109124028,-0.24570912492,0.283013398704,-0.00909008464113,0.927064082168,50,0.1,1000],[11.7448699905,4.97001795264,0.455260746897,-0.244901380835,0.332076152923,-0.00364003376897,0.910898178985,50,0.1,1000],[11.870278421,4.90095977143,-0.299208522195,-0.24350281543,0.363195193033,-0.000565883079909,0.899330478974,50,0.1,1000],[12.0150290827,4.76891372263,-1.5601375509,-0.239618552996,0.415012860355,0.00385302215308,0.877685837313,50,0.1,1000],[12.0674873965,4.67316236069,-2.35868200277,-0.236087554013,0.447731064106,0.00615363591254,0.862416195256,50,0.1,1000],[12.0882307654,4.49204425862,-3.6867754206,-0.228369888448,0.501837414645,0.00910136928484,0.834220335637,50,0.1,1000],[12.3158028918,4.36350298152,-4.5232520489,-0.359094902163,-0.429272247493,-0.0916633408214,0.823634640312,50,0.1,1000],[13.5577954532,4.12891455937,-5.90280137246,-0.558798753778,-0.32184593967,-0.146067085169,0.750215669341,50,0.1,1000],[14.5272858965,3.97051186254,-6.76095499298,-0.471067939048,0.459247372977,0.276764297736,0.700420138712,50,0.1,1000],[16.0512662229,3.70177079543,-8.14699124537,-0.325418097963,0.652784377807,0.148884113116,0.667689402695,50,0.1,1000],[16.8557078027,3.53749706213,-8.98269270905,-0.273088606496,0.717100583951,0.110768993816,0.631600819749,50,0.1,1000],[17.8386118552,3.29749220386,-10.2687594988,-0.210441258199,0.786802431319,0.0775896643343,0.575009786792,50,0.1,1000],[18.229218377,3.18095791497,-10.9932611484,-0.18222366275,0.814839607955,0.0643887905872,0.546520844698,50,0.1,1000],[18.5168130604,3.07278644734,-12.0060473862,-0.151083758241,0.844389304251,0.0506044727473,0.511487622724,50,0.1,1000],[18.5007076138,3.06829082639,-12.5064361273,-0.139307128651,0.855802266708,0.0466652711655,0.496002375671,50,0.1,1000],[18.2132467785,3.17276377907,-13.0887085341,-0.129192299098,0.866958200796,0.0474224308745,0.479003069903,50,0.1,1000],[17.9110046558,3.3029872396,-13.3042328889,-0.127039968742,0.870520006498,0.0518019992291,0.472622806797,50,0.1,1000],[17.2834103723,3.59980302959,-13.4414943855,-0.127767636513,0.872692765663,0.0639388047646,0.466898915253,50,0.1,1000],[16.8449848641,3.81923311846,-13.415621481,-0.129722995412,0.87254769451,0.0736864767728,0.465191109553,50,0.1,1000],[16.0968753292,4.19738002962,-13.2405195124,-0.133577230028,0.871171319369,0.0915646456535,0.463501425665,50,0.1,1000],[15.6319920738,4.43007551383,-13.0743638408,-0.135786607597,0.870124622948,0.103177549135,0.462384613813,50,0.1,1000],[14.8921902486,4.78380891139,-12.7480462132,-0.138333371432,0.868876884979,0.12193408773,0.459400604425,50,0.1,1000],[14.4520282854,4.97904251772,-12.5270212839,-0.139034164867,0.868641633377,0.133036869453,0.456543979404,50,0.1,1000],[13.7676563266,5.24867547188,-12.1554524245,-0.138589248146,0.869430400988,0.149784547203,0.449942649185,50,0.1,1000],[13.3651886344,5.3838453632,-11.9249091803,-0.137345185423,0.870690426661,0.15916107354,0.444637193262,50,0.1,1000],[12.7410997085,5.55171343419,-11.5547351936,-0.133885393418,0.873988119299,0.172666092309,0.43405747237,50,0.1,1000],[12.3732583702,5.62486466604,-11.3306257625,-0.130965941425,0.876739794472,0.179903919203,0.426391644889,50,0.1,1000],[11.7996105332,5.69766647541,-10.9735965745,-0.125189266246,0.882233389931,0.189890711745,0.412229803508,50,0.1,1000],[11.5683726648,5.71273973187,-10.8270951634,-0.122469976281,0.884850373178,0.193424543051,0.405743599016,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[-2.69941730642,5.59813397463,12.4852569492,-0.253970856597,-0.343747743232,-0.172909951059,0.887377282697,50,0.1,1000],[-2.79889015532,5.68630823541,12.3524904825,-0.235693398336,-0.378422830357,-0.173092915026,0.878227548084,50,0.1,1000],[-2.80820660539,5.73375155296,12.2907201877,-0.225885866714,-0.393627158462,-0.17095399901,0.874532998555,50,0.1,1000],[-2.71725557873,5.79979807432,12.2237697366,-0.2130796785,-0.408636291876,-0.164901413751,0.872021189717,50,0.1,1000],[-2.59621109996,5.83396790043,12.200045962,-0.207021151205,-0.412734124201,-0.160094014324,0.872446383597,50,0.1,1000],[-2.3005317566,5.87909689902,12.1811873783,-0.199811608779,-0.412482983189,-0.151289516803,0.875810819573,50,0.1,1000],[-2.06378462288,5.90076044636,12.1768019275,-0.196717205536,-0.40880930152,-0.1454679723,0.879213492317,50,0.1,1000],[-1.6019159322,5.9265809866,12.1706639939,-0.193483315563,-0.398220387783,-0.13576065052,0.886314715619,50,0.1,1000],[-1.27597632089,5.93674744012,12.1634572034,-0.19238115779,-0.389290268233,-0.129664157937,0.891420093633,50,0.1,1000],[-0.689629294198,5.9448969992,12.1360513423,-0.19177233828,-0.371600048939,-0.119823294854,0.900432758128,50,0.1,1000],[-0.298192147888,5.94456173452,12.1068521418,-0.191979010158,-0.358969307946,-0.113749686413,0.906281470876,50,0.1,1000],[0.377935523535,5.93674153324,12.0302734762,-0.193109070678,-0.336148354677,-0.104078419288,0.915904390812,50,0.1,1000],[0.815635984743,5.9270888612,11.9637209031,-0.194188169147,-0.320771412143,-0.0981463142828,0.921826424609,50,0.1,1000],[1.55309306744,5.90546962157,11.8158967103,-0.196487979457,-0.294054888455,-0.0887649278852,0.931152503128,50,0.1,1000],[2.02090660286,5.88804445318,11.6999486571,-0.198151603756,-0.276547799982,-0.0830256434556,0.936677104868,50,0.1,1000],[2.79500590208,5.8553546392,11.4638326786,-0.201227743883,-0.24675773847,-0.0739895807535,0.945062725715,50,0.1,1000],[3.27849865846,5.83199059421,11.2893715696,-0.203265720364,-0.227541494577,-0.0684728392943,0.949852296649,50,0.1,1000],[4.0666211929,5.79124896156,10.9524942139,-0.20681226533,-0.195249835286,-0.059819485706,0.956832178524,50,0.1,1000],[4.55246949667,5.76305170309,10.7132798713,-0.209011173981,-0.174618022389,-0.0545583595854,0.96064887488,50,0.1,1000],[5.33361087099,5.71570392758,10.2677400143,-0.212689901529,-0.140218719937,-0.0463415013048,0.965895533494,50,0.1,1000],[5.8089784546,5.68560686885,9.95962875288,-0.214962595582,-0.118369801139,-0.0413511919782,0.968540010325,50,0.1,1000],[6.56275627904,5.6368871814,9.4005603859,-0.218680025334,-0.0821141452911,-0.0335728125387,0.971755720293,50,0.1,1000],[7.01576300987,5.60617526369,9.02192740954,-0.220883505186,-0.0591601133757,-0.0288712164781,0.973076056113,50,0.1,1000],[7.72377344868,5.55659902553,8.34866581107,-0.224356583272,-0.0211636646749,-0.0215693371373,0.974038493354,50,0.1,1000],[8.14348324161,5.5254943759,7.8999211701,-0.226332144501,0.00286068974474,-0.0171797866636,0.973894466434,50,0.1,1000],[8.78875654827,5.47492095733,7.11462779234,-0.229309467807,0.0426013169517,-0.0103868178852,0.972365368461,50,0.1,1000],[9.16516826191,5.44292879179,6.59784738165,-0.230902343515,0.0677308104068,-0.00632948798402,0.970595993533,50,0.1,1000],[9.73244437485,5.38966989595,5.70520246774,-0.233117224688,0.109326825216,-0.0000781459657204,0.966283601607,50,0.1,1000],[10.0567246831,5.35510653208,5.12390716124,-0.234149873169,0.135658956825,0.00362287724645,0.962682377053,50,0.1,1000],[10.5329247216,5.29524716389,4.13063694215,-0.235278805147,0.179316849552,0.00928253066544,0.955197982588,50,0.1,1000],[10.7977569358,5.25487138036,3.48939955101,-0.23552629835,0.207002417389,0.0125848912367,0.949483534609,50,0.1,1000],[11.1725521886,5.18175411591,2.40341275062,-0.235151475605,0.253002045847,0.0175567970288,0.938288605492,50,0.1,1000],[11.3724313866,5.1305206688,1.70717304452,-0.234321262062,0.282224220177,0.0203790937157,0.930068668557,50,0.1,1000],[11.6384308665,5.03451504729,0.536245234174,-0.231905911776,0.330862979369,0.0244848520701,0.914412286108,50,0.1,1000],[11.7694743772,4.96560347043,-0.210547441611,-0.229631240699,0.361781629452,0.0266840693304,0.903145340646,50,0.1,1000],[11.9211006925,4.83462097652,-1.45992060607,-0.22453313597,0.413229034566,0.0296318721808,0.882013938662,50,0.1,1000],[11.979666454,4.74022170128,-2.25356666348,-0.220405379006,0.445842452892,0.0309922789138,0.866997955449,50,0.1,1000],[12.0094099104,4.56224614735,-3.57497432853,-0.211993856215,0.499803170977,0.0323868220363,0.839170119205,50,0.1,1000],[12.2445290335,4.43642485554,-4.41287666374,-0.331267509492,-0.447161378508,-0.151478918584,0.816922686642,50,0.1,1000],[13.4968071064,4.20847635994,-5.8391440303,-0.494456720666,-0.418979370253,-0.260092637014,0.71576578492,50,0.1,1000],[14.473015195,4.05442253882,-6.75188136481,-0.408207184158,0.507616965692,0.327255111579,0.684540724054,50,0.1,1000],[16.0042881476,3.79092179385,-8.25369025879,-0.295559480896,0.671334822803,0.17135475924,0.657717032949,50,0.1,1000],[16.8138216339,3.62769745549,-9.15822060622,-0.248477024079,0.733709577879,0.1308445302,0.618715712384,50,0.1,1000],[17.8036678035,3.38552188531,-10.5419438548,-0.190321377698,0.802377675695,0.0961244333427,0.557429755262,50,0.1,1000],[18.2000191289,3.2652912006,-11.3083113273,-0.16449009038,0.829374320493,0.0810812742495,0.527737693973,50,0.1,1000],[18.4975665375,3.14772557934,-12.3610356612,-0.138250913793,0.856630637452,0.0627841721088,0.493080909736,50,0.1,1000],[18.4892723566,3.13554632809,-12.8671480104,-0.130281991682,0.866360301179,0.0555625726931,0.478914639262,50,0.1,1000],[18.2163712481,3.2247345146,-13.4339939619,-0.126833482423,0.874744277473,0.0509444529332,0.464909001289,50,0.1,1000],[17.9247470264,3.34417742136,-13.6272023169,-0.128874115963,0.876596507435,0.052072716043,0.46071515889,50,0.1,1000],[17.3169413532,3.62182486983,-13.7134475626,-0.135913592786,0.876064630053,0.0592599123772,0.458831692509,50,0.1,1000],[16.8918588411,3.82925656034,-13.6510531521,-0.141400049317,0.874321814671,0.0661963140669,0.459549168694,50,0.1,1000],[16.1674263589,4.19137522849,-13.4124078673,-0.15020166083,0.870491332877,0.0801451422563,0.46180196691,50,0.1,1000],[15.7171840623,4.41556818292,-13.208375851,-0.154974321565,0.868087393911,0.0897406663367,0.462983637932,50,0.1,1000],[15.0018462053,4.75692434296,-12.8236277086,-0.160759044985,0.864918996265,0.105930881662,0.463519479274,50,0.1,1000],[14.5756531153,4.94604201749,-12.5714173055,-0.162964296773,0.863734140078,0.115921309903,0.462566993149,50,0.1,1000],[13.9134974982,5.20792039323,-12.1554812527,-0.164139292489,0.863327633245,0.131590076799,0.458702236778,50,0.1,1000],[13.5228514615,5.34012130058,-11.9034469482,-0.163438780584,0.864104438326,0.140765212407,0.454748765411,50,0.1,1000],[12.9168805381,5.50564195464,-11.5049453468,-0.16013009221,0.866940503582,0.154581057432,0.445956515258,50,0.1,1000],[12.5580082789,5.57901418817,-11.2687886308,-0.156863415628,0.869630871804,0.162405502356,0.439044950373,50,0.1,1000],[11.9976740886,5.65438333317,-10.8976618058,-0.149852489501,0.87526742816,0.173824801388,0.425718332956,50,0.1,1000],[11.7705249647,5.67125759654,-10.7480688404,-0.146356056026,0.878048522158,0.178133903372,0.419379315264,50,0.1,1000]]} diff --git a/test/golden/fixtures/groups.sequencer.loop.json b/test/golden/fixtures/groups.sequencer.loop.json index bde8093..491501c 100644 --- a/test/golden/fixtures/groups.sequencer.loop.json +++ b/test/golden/fixtures/groups.sequencer.loop.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[5.7164363477,3.91589308262,14.2099190045,-0.128799390592,-0.018266487752,0.0421483359723,0.990606163005,50,0.1,1000],[4.8905739842,4.33866832899,13.6929599499,-0.155868784587,-0.0736100692399,0.0187726015222,0.984852308283,50,0.1,1000],[3.5626123895,5.16060268223,12.5964619461,-0.19430672928,-0.178317041268,-0.0394262455616,0.963791211265,50,0.1,1000],[2.99627751326,5.63814950441,11.8754249204,-0.20707859123,-0.230431622527,-0.0755635279958,0.947792106757,50,0.1,1000],[2.7639147374,6.16403955207,10.8889787211,-0.216920605198,-0.269130812042,-0.111601058133,0.931696979105,50,0.1,1000],[3.08528751768,6.23704335024,10.5651949515,-0.22076096745,-0.260463905952,-0.114256504263,0.932935474821,50,0.1,1000],[3.83651982267,6.193274432,10.2241618909,-0.226250590876,-0.228042305197,-0.106833945734,0.940953710449,50,0.1,1000],[4.29173273842,6.1697062664,9.97999850291,-0.22991675926,-0.207679397752,-0.102166595856,0.94528807157,50,0.1,1000],[5.01243307731,6.13811454113,9.52734813111,-0.236292505399,-0.174108309147,-0.0944304197766,0.951280739003,50,0.1,1000],[5.44256979174,6.12315955755,9.21460663306,-0.240423080661,-0.153105706063,-0.0895403611573,0.954325892335,50,0.1,1000],[6.11227157294,6.10714978809,8.65221624458,-0.247421042888,-0.118603533775,-0.0814023658486,0.95816996621,50,0.1,1000],[6.50480505012,6.10263761455,8.27346484442,-0.251852570507,-0.0970861733642,-0.0762433196713,0.959860153291,50,0.1,1000],[7.10347979973,6.10468329468,7.60790292608,-0.259207828479,-0.0618445447721,-0.0676396196804,0.961463174431,50,0.1,1000],[7.44636358971,6.11181797497,7.16867247469,-0.263777685003,-0.0399258523825,-0.0621786554692,0.961748966212,50,0.1,1000],[8.33325889658,5.9297498379,6.38405890451,-0.267099070669,0.014771162442,-0.0472578276662,0.962396278532,50,0.1,1000],[9.73627309102,5.34825079535,5.66974491241,-0.255240684576,0.0995969343384,-0.0236636650783,0.961443016805,50,0.1,1000],[11.7544418389,4.50927920804,4.12109540669,-0.224555904593,0.240747264159,0.00641954726206,0.944232063597,50,0.1,1000],[12.780319981,4.06258630362,2.99759021814,-0.202494358813,0.320496338777,0.0154761659486,0.925223551239,50,0.1,1000],[14.0566234739,3.46528683066,1.0445251062,-0.17103529818,0.428862612579,0.0157606914328,0.886890854003,50,0.1,1000],[14.6051767762,3.18153129918,-0.161328996223,-0.157142750143,0.481684733906,0.0104514941023,0.862076991614,50,0.1,1000],[15.084987373,2.86913688232,-1.96921391788,-0.14471864326,0.545623762582,-0.0000657165893003,0.825440015798,50,0.1,1000],[15.125710885,2.77212945922,-2.91152619019,-0.142387572012,0.572991735923,-0.00490782173172,0.807082500855,50,0.1,1000],[14.8756183398,2.73443306761,-4.14325818429,-0.143524117924,0.604293511693,-0.00833167626383,0.783684096094,50,0.1,1000],[14.6622945173,2.72461640146,-4.86957960264,-0.144308797797,0.622475132716,-0.00968769412869,0.76915916988,50,0.1,1000],[14.2417143628,2.72064489493,-6.01865761095,-0.145227414991,0.651278425296,-0.0109422682874,0.744731950063,50,0.1,1000],[14.1943797251,2.72552113541,-6.70547258939,-0.393503521094,-0.476888879172,-0.124685137633,0.776006180557,50,0.1,1000],[14.9950931239,2.74534200032,-7.78002890721,-0.648259301734,-0.327606714845,-0.196439193025,0.658669387133,50,0.1,1000],[15.7021006002,2.76455347907,-8.41497101822,-0.420503885102,0.677176184632,0.360590694658,0.484337948655,50,0.1,1000],[16.8315892269,2.80651749345,-9.39627085046,-0.253413068516,0.794336930619,0.175084821762,0.523599047506,50,0.1,1000],[17.4216599206,2.83840555649,-9.96868533944,-0.212065956501,0.812650520011,0.119334206983,0.529515353379,50,0.1,1000],[18.1216126115,2.8988013766,-10.8410168825,-0.176307370341,0.828760648288,0.0744312008841,0.525862620223,50,0.1,1000],[18.3851902948,2.94049478982,-11.342230669,-0.162792122106,0.836543909236,0.0605030529147,0.519646411984,50,0.1,1000],[18.5491923525,3.01379604106,-12.0932371144,-0.146824922071,0.848695019234,0.0491782585209,0.50570812281,50,0.1,1000],[18.5040495666,3.06142584076,-12.5167002972,-0.138843405166,0.856253359592,0.0464802381212,0.495370851478,50,0.1,1000],[18.3407105274,3.2845638976,-12.5013656967,-0.141797745896,0.853145465346,0.055723007499,0.498930015787,50,0.1,1000],[18.1205350753,3.81387181806,-11.7996497106,-0.163715728155,0.828640962289,0.0819118454683,0.529000723576,50,0.1,1000],[17.5391839771,5.10880680127,-10.2535989047,-0.218559163005,0.759070403824,0.136207888911,0.59790586659,50,0.1,1000],[17.0748515565,5.99263950816,-9.30042115677,-0.251834016921,0.711077757482,0.162566494888,0.636019013454,50,0.1,1000],[16.2603951589,7.18640380916,-8.1383785452,-0.28439549735,0.659618720932,0.187900773019,0.669862406455,50,0.1,1000],[15.8296595248,7.5928773007,-7.82489632,-0.288632125208,0.653557753807,0.197248588055,0.671302281574,50,0.1,1000],[15.39528285,7.63786085559,-7.95920678179,-0.27534658963,0.676784509588,0.205970077262,0.65094032786,50,0.1,1000],[15.1325851954,7.61221909071,-8.06426986404,-0.266124468012,0.69219028614,0.210674356724,0.636919689378,50,0.1,1000],[14.6843243859,7.55086329907,-8.19693257552,-0.251500683544,0.715718456942,0.217847298332,0.614033428389,50,0.1,1000],[14.3989162588,7.50065103022,-8.25697486208,-0.24259861952,0.729488934316,0.221908305884,0.599790386966,50,0.1,1000],[13.9263839285,7.39881990918,-8.32118556936,-0.228282991615,0.75081718094,0.227797517025,0.576427556404,50,0.1,1000],[13.6318338912,7.32423054607,-8.34165310435,-0.219513182415,0.763427129456,0.230947967135,0.561832730653,50,0.1,1000],[13.1510552021,7.18532817461,-8.34530451677,-0.205414609925,0.783084721312,0.23522489161,0.537821910714,50,0.1,1000],[12.9504675248,7.12166840867,-8.33659337395,-0.199595593998,0.791006420963,0.236691104412,0.527681496686,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[5.72866063362,3.8648777956,14.235265835,-0.125688489423,-0.0185943624816,0.0350828977661,0.991274857744,50,0.1,1000],[4.88188993713,4.30763943014,13.7086453937,-0.15390418129,-0.0742832755623,0.0172686892196,0.985138208743,50,0.1,1000],[3.50948717355,5.17391858464,12.5901843803,-0.196775829763,-0.178740575466,-0.0281561169872,0.963606928462,50,0.1,1000],[2.91510364157,5.68031553364,11.8550673963,-0.212953743734,-0.230386612439,-0.0573899930165,0.947775870415,50,0.1,1000],[2.64676205182,6.24414154772,10.8493601334,-0.226410662502,-0.2688881039,-0.08763112195,0.932071985392,50,0.1,1000],[2.95917592101,6.32658240258,10.5213546125,-0.230676967181,-0.26024757902,-0.0890646398231,0.933341751107,50,0.1,1000],[3.70348513134,6.28819693745,10.1779094913,-0.235806344713,-0.227961003619,-0.0807002815621,0.94123143444,50,0.1,1000],[4.15464546282,6.26644847971,9.93420268524,-0.239101276065,-0.207658469554,-0.0755899689107,0.945512927678,50,0.1,1000],[4.86641563423,6.23693934723,9.48283007465,-0.244710500754,-0.174369336148,-0.067546751119,0.951393473724,50,0.1,1000],[5.29150368874,6.22179145369,9.17312400221,-0.24824618869,-0.15352566535,-0.0626249154756,0.954401288684,50,0.1,1000],[5.95061678301,6.20439327641,8.61687962328,-0.254164154722,-0.119491195423,-0.05485059924,0.958182575731,50,0.1,1000],[6.33762148957,6.19772684112,8.24422697993,-0.257848076042,-0.0982480984511,-0.050083255208,0.959871527018,50,0.1,1000],[6.92530777071,6.19515802343,7.59019591803,-0.263937525897,-0.063672837137,-0.0425123683617,0.961496464253,50,0.1,1000],[7.26308425698,6.19845107919,7.16013159891,-0.267694460823,-0.0421454697115,-0.0378530387337,0.96183708729,50,0.1,1000],[8.15243056939,6.00885411856,6.38782545085,-0.269576778424,0.0131221749003,-0.0204369202953,0.962672582631,50,0.1,1000],[9.58587343172,5.42460084138,5.67287006683,-0.255081806764,0.101477512547,0.0136906792377,0.961482267963,50,0.1,1000],[11.6431032398,4.58879631791,4.12643611785,-0.216758537279,0.246263775913,0.0555880163318,0.943016363395,50,0.1,1000],[12.7101922208,4.14714137803,3.00583889914,-0.188959962458,0.327856622394,0.0686108704998,0.92309084937,50,0.1,1000],[14.0554904596,3.56124530012,1.05938050771,-0.149147620165,0.437393309458,0.0709419290757,0.883973598554,50,0.1,1000],[14.6305024295,3.28480053746,-0.142078649305,-0.131495579892,0.489825923063,0.0652426616282,0.859373535006,50,0.1,1000],[15.1263947682,2.98377548408,-1.94230703901,-0.1154149502,0.552577372616,0.0527692678067,0.82374331009,50,0.1,1000],[15.1662858773,2.89196082502,-2.88074303178,-0.112209160279,0.579307049596,0.0461380760728,0.806029605271,50,0.1,1000],[14.9020547121,2.8602642855,-4.10628596484,-0.113710366455,0.609683899595,0.0391571942342,0.783468065255,50,0.1,1000],[14.6807660839,2.8525125572,-4.82955686371,-0.115072863676,0.627353181084,0.0353113051691,0.769375937989,50,0.1,1000],[14.2469852392,2.85039806623,-5.97263988764,-0.117424307366,0.655296767713,0.0296946650712,0.745597683158,50,0.1,1000],[14.1941142553,2.8548395815,-6.65920465669,-0.36696632353,-0.493878824757,-0.188032619099,0.765547619686,50,0.1,1000],[14.9856813677,2.87194363054,-7.77370379959,-0.56269383406,-0.455841598182,-0.33608411903,0.602188966533,50,0.1,1000],[15.6886536175,2.88764692054,-8.45665253914,-0.326237908335,0.728801594587,0.432467592724,0.418794513021,50,0.1,1000],[16.8104164056,2.92177783377,-9.54110397267,-0.212732123609,0.815224261713,0.214377194089,0.494162792361,50,0.1,1000],[17.3979071911,2.94746405671,-10.1741080907,-0.179019119926,0.831236255641,0.151346630694,0.504076025403,50,0.1,1000],[18.0952332671,2.9963854948,-11.1315038307,-0.15151151356,0.845116726096,0.0978531899856,0.50323626036,50,0.1,1000],[18.3605204934,3.03022459083,-11.6678476069,-0.142552587946,0.851379470478,0.0794458682798,0.498517914354,50,0.1,1000],[18.5308064163,3.0899578555,-12.4509017104,-0.133535398756,0.860968033485,0.0617230287209,0.486921564856,50,0.1,1000],[18.4926971369,3.12881774552,-12.8777301928,-0.129775895667,0.866814098551,0.0554124352079,0.478247841062,50,0.1,1000],[18.3336394804,3.34218525376,-12.8495821675,-0.135972405607,0.862867852361,0.0619301803566,0.482840788496,50,0.1,1000],[18.1138590271,3.85977685391,-12.1180623653,-0.160266855157,0.83862665052,0.0860669733125,0.513431935392,50,0.1,1000],[17.5473594637,5.12306253202,-10.4821520965,-0.22298095903,0.766336842724,0.132823810105,0.587677778092,50,0.1,1000],[17.1030845138,5.98384593989,-9.45431367128,-0.2611920353,0.713919958083,0.152603968091,0.631513296035,50,0.1,1000],[16.3345036885,7.15840106106,-8.16447826985,-0.29797583107,0.654628586707,0.169144639565,0.673841159674,50,0.1,1000],[15.9317377664,7.55957244138,-7.79076447307,-0.303070688003,0.645561801498,0.175596603732,0.678648621363,50,0.1,1000],[15.5305774863,7.60547318476,-7.87874179275,-0.290849125778,0.666997700291,0.183144778748,0.661043753362,50,0.1,1000],[15.2849258453,7.58080284248,-7.96395158008,-0.282198987878,0.681765448287,0.187687614588,0.648330906323,50,0.1,1000],[14.8626490598,7.52157600516,-8.06983557484,-0.268245009543,0.704601363471,0.195112474915,0.627305870833,50,0.1,1000],[14.5906142659,7.47343030004,-8.11857830215,-0.259559676078,0.718218565514,0.199704358842,0.613929178134,50,0.1,1000],[14.1380581798,7.37657034837,-8.16964554178,-0.245214037104,0.739593640258,0.206928291419,0.591651929353,50,0.1,1000],[13.853197618,7.30578788139,-8.18656401639,-0.236131920412,0.752462845935,0.211225416783,0.577429826866,50,0.1,1000],[13.3865444448,7.17458861277,-8.18858605294,-0.221056417581,0.772746279676,0.217718367024,0.553711080034,50,0.1,1000],[13.1902433917,7.11430127598,-8.18147525518,-0.21461345752,0.781035811613,0.220254201883,0.543518363427,50,0.1,1000]]} diff --git a/test/golden/fixtures/groups.stateDriven.json b/test/golden/fixtures/groups.stateDriven.json index afc3c63..7e320dc 100644 --- a/test/golden/fixtures/groups.stateDriven.json +++ b/test/golden/fixtures/groups.stateDriven.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0,0,0,0,0,0,1,50,0.1,1000],[0,0,0,0,0,0,1,50,0.1,1000],[0,0,0,0,0,0,1,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.28793486086,3.34657018413,16.0145920758,-0.105779212389,-0.0701365110382,0.0286009840827,0.991500686714,50,0.1,1000],[3.01760364364,3.40375394566,15.8437378824,-0.104715562945,-0.0597105160236,0.0351817287064,0.992084447574,50,0.1,1000],[3.51166404242,3.43968160629,15.7088675714,-0.104496129672,-0.0504312522744,0.0390884519395,0.99247636778,50,0.1,1000],[4.36768489128,3.49602368528,15.4372500213,-0.104675581283,-0.0316184374271,0.0450405335912,0.992982702484,50,0.1,1000],[4.91934189053,3.52817926356,15.2365386122,-0.105025603485,-0.0181802548536,0.0483805144178,0.993125584592,50,0.1,1000],[5.83964279596,3.57376444648,14.8534395571,-0.105870702358,0.00602924234217,0.0531605349975,0.99293957527,50,0.1,1000],[6.41516030581,3.59687470797,14.5819408333,-0.106508288971,0.0221054700452,0.0556380590576,0.992507802971,50,0.1,1000],[6.53484487908,3.60414529131,13.7753269259,-0.115368234067,0.0248055070728,0.055662020742,0.991451762233,50,0.1,1000],[6.41004189253,3.611695218,12.3875630291,-0.136493799383,0.0161636319049,0.0525048787067,0.989116483254,50,0.1,1000],[6.118918269,3.64261064952,9.03937229334,-0.226521161975,-0.0361718171969,0.0264574360818,0.972974700028,50,0.1,1000],[5.90994094758,3.66892960049,6.57878430724,-0.352230104003,-0.16624043372,-0.0690617016721,0.918438105369,50,0.1,1000],[5.56833193797,3.70613191738,2.53012227875,0.108841814166,0.795428020929,0.436625301957,-0.40596313712,50,0.1,1000],[5.37872575072,3.71572040247,0.333565304648,0.0365094377413,0.893437739504,0.324779485783,-0.308146640743,50,0.1,1000],[5.15349576841,3.6958201103,-2.04661622177,0.0254151539522,0.925656505474,0.250714058647,-0.282234945781,50,0.1,1000],[5.08899648384,3.66173210133,-2.49043469941,0.0348787840959,0.921497300471,0.246910589079,-0.297760569327,50,0.1,1000],[4.98153467071,3.58454797535,-2.95185251354,0.053046374299,0.910275643904,0.246185374549,-0.328598684792,50,0.1,1000],[4.89848942256,3.52539539134,-3.23928800254,0.0644320648131,0.903126683192,0.244171847137,-0.347261878408,50,0.1,1000],[4.73402291825,3.41216490067,-3.7087182385,0.0828115689079,0.891231232186,0.238283821201,-0.376921683358,50,0.1,1000],[4.6139420249,3.33304852545,-3.99830838328,0.0939255544469,0.883723722156,0.233109734354,-0.394804033503,50,0.1,1000],[4.38672014408,3.19170143482,-4.46602230667,0.111199013298,0.871345960109,0.222231674648,-0.423088737768,50,0.1,1000],[4.22665244817,3.09811029253,-4.75111018535,0.121226847062,0.863606841228,0.214113228318,-0.440048634578,50,0.1,1000],[3.93295894925,2.93836805082,-5.20531718217,0.136104727866,0.850959581318,0.198769527448,-0.466726867637,50,0.1,1000],[3.73133012055,2.83668966681,-5.47812148589,0.144288576709,0.843120335109,0.188131454145,-0.482633881031,50,0.1,1000],[3.36992302739,2.66937493918,-5.90555090987,-0.155644018372,-0.830399792924,-0.169167658217,0.507536626137,50,0.1,1000],[3.24723097672,2.60079672999,-6.0537575369,-0.160806722065,-0.824472285288,-0.162451745652,0.517683377428,50,0.1,1000],[4.47998082475,2.62770208505,-5.4649877608,-0.210288417394,-0.799801672422,-0.232269110164,0.512003053472,50,0.1,1000],[5.88411570289,2.65103889941,-4.95286934631,0.316697745969,0.729691220008,0.380325828567,-0.471810899902,50,0.1,1000],[8.68681477343,2.68402518586,-4.31083915935,-0.361336157454,0.540845331172,0.181069777618,0.737655912129,50,0.1,1000],[9.44257393244,2.68561761641,-4.2450632702,-0.290884945258,0.563332448373,0.129034905428,0.76249097989,50,0.1,1000],[8.44705268991,2.59696823054,-4.63847388044,-0.351379458936,0.53884320175,0.160332773812,0.748648035734,50,0.1,1000],[7.32975960262,2.4889382252,-5.08040394881,-0.452597705231,0.474829900422,0.193786951659,0.729478238368,50,0.1,1000],[4.93876397677,2.24803373236,-6.00455220589,-0.537398167385,-0.45337657418,-0.279295095866,0.653947353462,50,0.1,1000],[3.4331409851,2.07916389109,-6.62211621322,-0.118233025996,-0.702023109639,0.00663744291937,0.702239595471,50,0.1,1000],[2.01597481985,1.82290415587,-7.52414475831,-0.103598509747,-0.706585336047,0.0400452079192,0.698856847276,50,0.1,1000],[1.86672898786,1.70537387006,-7.92083533604,-0.100483494195,-0.706300294755,0.0510793319019,0.698880435322,50,0.1,1000],[2.63900234515,1.63341017972,-8.1335649942,-0.0981441405337,-0.70236390087,0.0566947981263,0.702736350489,50,0.1,1000],[3.29209186224,1.63311503007,-8.11500991801,-0.097070322561,-0.698367059391,0.0563125040484,0.70688733524,50,0.1,1000],[4.14654623103,1.65132360919,-8.03789968232,-0.0947684851908,-0.690002272934,0.0546767931505,0.715490213666,50,0.1,1000],[4.53631529734,1.67339781442,-7.96179946857,-0.0931681389155,-0.683486320992,0.0530562188921,0.722046525194,50,0.1,1000],[4.95484862128,1.72577611875,-7.79119921435,-0.0907007188351,-0.67037383558,0.0493549671395,0.734803638662,50,0.1,1000],[5.09589151663,1.76728058608,-7.65774478537,-0.0894990717043,-0.660665314524,0.0463288703138,0.743885000604,50,0.1,1000],[5.16650624123,1.84794563691,-7.39501689284,-0.0885607070777,-0.64224515866,0.0400353160108,0.760312653329,50,0.1,1000],[5.13085217351,1.90466221583,-7.20567946943,-0.0888352214274,-0.629370198049,0.0352231567645,0.771207356338,50,0.1,1000],[4.97533330971,2.00597506076,-6.85425177343,-0.0910475593682,-0.606263340456,0.0258619172666,0.789611464701,50,0.1,1000],[4.9203556837,2.06916049569,-6.69440663031,-0.0945043090557,-0.595061697207,0.0201554904767,0.797849778022,50,0.1,1000],[6.03991947578,2.63507731098,-6.78605091862,-0.167797853542,-0.560498868782,-0.0279615129233,0.810495559665,50,0.1,1000],[7.27724532264,3.28260150904,-6.92428624595,-0.316751831309,-0.4766730974,-0.102638418401,0.813582442439,50,0.1,1000],[9.65801289057,4.58860612878,-7.26783829532,-0.566008399365,0.334230885345,0.214843379969,0.722334084211,50,0.1,1000],[11.1105028473,5.42982844206,-7.52593825022,-0.388386442376,0.596189522009,0.271701788882,0.647990866559,50,0.1,1000],[13.0285889244,6.62173363211,-7.94277582925,-0.282827777301,0.697223162437,0.238492694622,0.614011029836,50,0.1,1000],[13.7587940884,7.13404508286,-8.15172945061,-0.253096356511,0.724058744462,0.229105623434,0.599326106723,50,0.1,1000],[13.9263839285,7.39881990918,-8.32118556936,-0.228282991615,0.75081718094,0.227797517025,0.576427556404,50,0.1,1000],[13.6318338912,7.32423054607,-8.34165310435,-0.219513182415,0.763427129456,0.230947967135,0.561832730653,50,0.1,1000],[13.1510552021,7.18532817461,-8.34530451677,-0.205414609925,0.783084721312,0.23522489161,0.537821910714,50,0.1,1000],[12.9504675248,7.12166840867,-8.33659337395,-0.199595593998,0.791006420963,0.236691104412,0.527681496686,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0,0,0,0,0,0,1,50,0.1,1000],[0,0,0,0,0,0,1,50,0.1,1000],[0,0,0,0,0,0,1,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.29248124732,3.32488465009,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.02575018249,3.37114277487,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[3.52252743102,3.40043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[4.38343059933,3.44649172407,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[4.93832238196,3.47332746115,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[5.86356487799,3.51193230983,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.44201068933,3.53225511052,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[6.55960861976,3.54432761704,13.7917512868,-0.112046502268,0.0250295192537,0.0471201484416,0.992269517876,50,0.1,1000],[6.42755792093,3.56187230666,12.3747854263,-0.133652179359,0.0162633424952,0.0456179399768,0.989844231279,50,0.1,1000],[6.11797807162,3.61362070543,8.95188604912,-0.227820007787,-0.0368807457982,0.0271959846481,0.972624404927,50,0.1,1000],[5.89294036792,3.65234851405,6.4353244345,-0.3644743833,-0.172738593191,-0.0616525921008,0.912972486019,50,0.1,1000],[5.51532859569,3.70311839043,2.29369781702,0.0895526192064,0.81836256656,0.420161200844,-0.381742849772,50,0.1,1000],[5.30071102672,3.71553305129,0.0488370021233,0.015547139444,0.904122534474,0.311462723067,-0.292081668804,50,0.1,1000],[5.03682988117,3.68899369765,-2.38038397089,-0.00480679448308,0.931728425723,0.243983046183,-0.268944805863,50,0.1,1000],[4.95679524737,3.64569584211,-2.82815379439,-0.000277135803172,0.928040375911,0.241464037235,-0.28361259245,50,0.1,1000],[4.82566732792,3.55139044564,-3.28824697559,0.0106499447131,0.918298364186,0.242440865993,-0.312789257342,50,0.1,1000],[4.72962509922,3.48214146254,-3.57210998329,0.0177857381149,0.912129022345,0.241806840051,-0.330505319502,50,0.1,1000],[4.54346331504,3.35188813965,-4.03427619154,0.029818725675,0.901919696425,0.238293797627,-0.358981574475,50,0.1,1000],[4.41164816438,3.26317640257,-4.31710489421,0.0373779226139,0.895468870162,0.234824723652,-0.37629209749,50,0.1,1000],[4.16441205477,3.10608617756,-4.77254206643,0.0496118673016,0.884781288091,0.226666498664,-0.404132445183,50,0.1,1000],[3.99354108881,3.00400639072,-5.04814731588,0.0570146983474,0.878023182002,0.220342050553,-0.421039186772,50,0.1,1000],[3.68093169847,2.83068277342,-5.48558407997,0.0684937638807,0.866782836135,0.207656111787,-0.448190872876,50,0.1,1000],[3.46912614075,2.7220718574,-5.74642736984,0.0751553160294,0.859659908698,0.198642027381,-0.464626586419,50,0.1,1000],[3.08959537908,2.54402333573,-6.15282129222,0.0849710828796,0.847750692991,0.181875994889,-0.490937674344,50,0.1,1000],[2.96144390665,2.47273589235,-6.29065995876,-0.0896741091856,-0.842242208587,-0.175925736497,0.501634081232,50,0.1,1000],[4.22741058587,2.52266083377,-5.67618700202,0.13049167607,0.827150786089,0.242066636047,-0.490099217774,50,0.1,1000],[5.67152720476,2.57378885583,-5.13378852665,0.209103891536,0.786494484654,0.391179238969,-0.429745030399,50,0.1,1000],[8.55186654953,2.66621504563,-4.4280909104,-0.308794223796,0.587152047316,0.274645107987,0.696037833269,50,0.1,1000],[9.32800347095,2.68492952584,-4.34314922117,-0.248335227266,0.5923453829,0.201775934383,0.739420742582,50,0.1,1000],[8.30430874783,2.57946286553,-4.73782558792,-0.308292193776,0.576386834528,0.244388353223,0.716246098103,50,0.1,1000],[7.15644910865,2.45454243158,-5.1763499266,-0.409956346218,0.529046284779,0.303461367106,0.678201313351,50,0.1,1000],[4.70245440342,2.1827769105,-6.08176415875,-0.391957265846,-0.602076330773,-0.368490599687,0.589990060607,50,0.1,1000],[3.15622857563,1.99693939226,-6.68091015024,-0.0743385038859,-0.710065574441,-0.0279853558059,0.699640969851,50,0.1,1000],[1.67903544118,1.7269087804,-7.57445272283,-0.0684066961168,-0.712091491446,0.0122340932616,0.698639076132,50,0.1,1000],[1.50391782324,1.61223269446,-7.9898143603,-0.070926599782,-0.711564801073,0.0279617027306,0.698471971161,50,0.1,1000],[2.25924643929,1.56200564347,-8.26627541635,-0.0762515104631,-0.708904333758,0.0396435412814,0.700049099968,50,0.1,1000],[2.91246017252,1.57783860167,-8.28681800161,-0.079175562401,-0.706247828517,0.0422357659858,0.702254494543,50,0.1,1000],[3.76822386267,1.62086641733,-8.26355451885,-0.0832125772846,-0.700484185333,0.0450782563247,0.707365198386,50,0.1,1000],[4.16216765369,1.65614270088,-8.20639148378,-0.085361708507,-0.695495505357,0.0461100624268,0.711950309286,50,0.1,1000],[4.59025425843,1.72791151504,-8.04569315196,-0.0885335876311,-0.684552236911,0.046406296074,0.722077900566,50,0.1,1000],[4.62432319873,1.79339860767,-7.90687775166,-0.0908447513968,-0.676235901054,0.0454663686225,0.729647206938,50,0.1,1000],[4.6013611086,1.9032813958,-7.61090406559,-0.0947698373486,-0.659234752301,0.0426403694566,0.744721436633,50,0.1,1000],[4.5584239444,1.97136957772,-7.39221367259,-0.09753074245,-0.646620458364,0.0401420123236,0.755485510085,50,0.1,1000],[4.43324914356,2.08673480986,-6.9861209351,-0.103058813103,-0.622856705574,0.0345212815041,0.774749434648,50,0.1,1000],[4.40154292469,2.15386576953,-6.80249663263,-0.10745867511,-0.611135237041,0.0304832474752,0.783605211069,50,0.1,1000],[5.58209029752,2.70735708523,-6.88176283837,-0.172520177643,-0.58175657034,-0.0147159667755,0.794719775452,50,0.1,1000],[6.89364275438,3.3414238732,-7.00001511997,-0.3043362036,-0.511677286221,-0.0882071985736,0.798614625501,50,0.1,1000],[9.43529971607,4.62036438418,-7.29041055533,-0.606092239518,0.260408470724,0.171922374929,0.731629908198,50,0.1,1000],[10.9987421224,5.44415272618,-7.50749589281,-0.415163699318,0.576250958523,0.255283572436,0.656052004962,50,0.1,1000],[13.0888313796,6.61177747394,-7.85544928891,-0.301411116035,0.685121132085,0.218059885407,0.626266923826,50,0.1,1000],[13.9025715927,7.11438308285,-8.02992978874,-0.270589577753,0.712560112803,0.207675232096,0.613115294238,50,0.1,1000],[14.1380581798,7.37657034837,-8.16964554178,-0.245214037104,0.739593640258,0.206928291419,0.591651929353,50,0.1,1000],[13.853197618,7.30578788139,-8.18656401639,-0.236131920412,0.752462845935,0.211225416783,0.577429826866,50,0.1,1000],[13.3865444448,7.17458861277,-8.18858605294,-0.221056417581,0.772746279676,0.217718367024,0.553711080034,50,0.1,1000],[13.1902433917,7.11430127598,-8.18147525518,-0.21461345752,0.781035811613,0.220254201883,0.543518363427,50,0.1,1000]]} diff --git a/test/golden/fixtures/noise.impulse.json b/test/golden/fixtures/noise.impulse.json index 23d2641..89d9038 100644 --- a/test/golden/fixtures/noise.impulse.json +++ b/test/golden/fixtures/noise.impulse.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762917058531,3.21189639979,16.2487362652,-0.122223572875,-0.0285109047754,0.00658026299856,0.992071180249,50,0.1,1000],[0.846396177948,3.21983615059,16.2418930592,-0.118215390246,-0.0457556519965,0.00910918043582,0.991891407691,50,0.1,1000],[1.11516609137,3.24484389865,16.2127617973,-0.112702695709,-0.0647240914517,0.0143340396635,0.991414862544,50,0.1,1000],[1.36402677822,3.26742416741,16.1795187288,-0.110051810105,-0.0709639632227,0.0180435578189,0.991225072846,50,0.1,1000],[1.89397401928,3.3136967531,16.0921247247,-0.106992618154,-0.0730572129614,0.0245114494117,0.991269091691,50,0.1,1000],[2.93347281243,3.66933915991,16.0145920758,-0.115451020493,-0.0494274952175,0.0335263824685,0.991515993952,50,0.1,1000],[5.83177072585,4.81083748676,15.8437378824,-0.152010616236,0.0591867781729,0.0699597497047,0.9841216039,50,0.1,1000],[9.74357414598,6.55563665807,15.7088675714,-0.184964417012,0.229752852017,0.133524201115,0.94613586717,50,0.1,1000],[13.6881980971,8.15628028817,15.4372500213,-0.181443522506,0.355744996681,0.181241011623,0.898707650564,50,0.1,1000],[16.7728092884,9.45491296249,15.2365386122,-0.170982919974,0.426053042302,0.204127179706,0.864624624174,50,0.1,1000],[18.3868723468,9.84737922192,14.8534395571,-0.161649225783,0.450563242719,0.211812570034,0.852055002503,50,0.1,1000],[19.4478184542,10.1132037822,14.5819408333,-0.156160701378,0.465292582658,0.215474485314,0.844208146162,50,0.1,1000],[19.0179729187,9.45764392194,14.0816835821,-0.153518518049,0.454846874879,0.210417193948,0.851628433955,50,0.1,1000],[18.4480239417,8.89643178322,13.7371811672,-0.152926633071,0.443053742087,0.204210921161,0.859426975489,50,0.1,1000],[17.0917323998,7.76571036944,13.1180583299,-0.153213564885,0.409065788553,0.185920451748,0.880127473604,50,0.1,1000],[16.4006979989,7.14062758022,12.7005727033,-0.152574722618,0.388295247393,0.172401101852,0.892314751055,50,0.1,1000],[15.5508377158,6.26424316715,11.9642931392,-0.149929448784,0.358912282952,0.148961226602,0.909127981366,50,0.1,1000],[15.1865408396,5.80717626847,11.4758694748,-0.147519691297,0.34472442761,0.134561488275,0.917222009964,50,0.1,1000],[14.8214637257,5.18733552656,10.6273753576,-0.143045814556,0.329552634532,0.112729067997,0.926404400486,50,0.1,1000],[14.7120328861,4.87048479965,10.0720445667,-0.140320617737,0.325120642851,0.100568987479,0.929780926126,50,0.1,1000],[14.6780452903,4.44376787901,9.11952253352,-0.136485836139,0.325519166499,0.0831858311362,0.931927575659,50,0.1,1000],[14.7230600146,4.22531759806,8.50333252542,-0.134635229858,0.329894485321,0.0738026770952,0.931448414186,50,0.1,1000],[14.8658215188,4.20571940769,7.45826618617,-0.137067657835,0.342471002744,0.0621666755881,0.927394939549,50,0.1,1000],[14.9797556245,5.09039656181,6.78929885886,-0.1709081126,0.351050083873,0.0682165400534,0.918096269093,50,0.1,1000],[15.1792736827,6.73712965232,5.66644133913,-0.22910907888,0.365416687403,0.0816122263758,0.89850938729,50,0.1,1000],[15.2996960594,9.23763510757,4.95475003549,-0.304969529011,0.367041115879,0.106970677025,0.87225665941,50,0.1,1000],[15.4720589919,12.0273824151,3.77192660255,-0.37188541301,0.372594373783,0.127131664982,0.840661770259,50,0.1,1000],[15.5568177811,15.1631000355,3.02934889011,-0.430101421199,0.365431191572,0.144308249115,0.812802522724,50,0.1,1000],[15.6289274973,17.0392188892,1.80703531514,-0.46116690123,0.370332691509,0.150682126789,0.792132364871,50,0.1,1000],[15.6233436279,18.9749990011,1.04686022749,-0.486909748334,0.366994730168,0.155348537672,0.777239086028,50,0.1,1000],[15.5791018546,19.06786138,-0.19247399314,-0.49152952504,0.383251311807,0.158724830416,0.765717693554,50,0.1,1000],[15.5215364954,19.681997149,-0.955976318948,-0.499256868912,0.390003028764,0.162661878559,0.756426684922,50,0.1,1000],[15.3665117382,18.461332922,-2.18872284558,-0.487782131206,0.419216234615,0.168030351965,0.747055648483,50,0.1,1000],[15.2302736566,18.0797804876,-2.94087243828,-0.483740021816,0.435254944503,0.17250989046,0.739451866096,50,0.1,1000],[14.9383235923,16.0470773617,-4.14325818429,-0.458829987589,0.475275907707,0.176165937845,0.729762575353,50,0.1,1000],[14.7148959629,14.9461760043,-4.86957960264,-0.443188105889,0.499929136947,0.177685485775,0.722553132285,50,0.1,1000],[14.2807792454,12.4849477103,-6.01865761095,-0.403234135586,0.548999688331,0.172109426781,0.711603765676,50,0.1,1000],[14.2266856803,11.0091009133,-6.70547258939,-0.642420151074,-0.237192882649,-0.135074911542,0.716094026079,50,0.1,1000],[15.0186277406,8.98849296466,-7.78002890721,-0.709998673576,-0.0505815848371,-0.0219575224887,0.702040778019,50,0.1,1000],[15.7213695479,7.96617376374,-8.41497101822,-0.666992722247,0.308711771479,0.216882245066,0.642479449006,50,0.1,1000],[16.8454327775,6.63449268742,-9.39627085046,-0.444545686624,0.637909578987,0.323607046168,0.53919289796,50,0.1,1000],[17.4329107085,5.98923339489,-9.96868533944,-0.360899079299,0.714485922828,0.278881011407,0.530553580818,50,0.1,1000],[18.1296111784,5.17931732873,-10.8410168825,-0.270434531978,0.781743798299,0.197258123751,0.526147346615,50,0.1,1000],[18.3916538577,4.80126226975,-11.342230669,-0.232898797622,0.805885289268,0.158308963139,0.520812176123,50,0.1,1000],[18.5537499279,4.34417665827,-12.0932371144,-0.190467042427,0.832488401133,0.115282362151,0.507341447848,50,0.1,1000],[18.5077158735,4.13980928277,-12.5167002972,-0.171616268419,0.844963167633,0.0983660366972,0.496899612177,50,0.1,1000],[18.228119436,3.90451955457,-13.1375097512,-0.148004351016,0.862254277368,0.081734897466,0.477421909612,50,0.1,1000],[17.9492388534,3.80570127904,-13.4788172312,-0.136132282817,0.871888135,0.0762514157455,0.464181864378,50,0.1,1000],[17.3550869161,3.70045809129,-13.9639855532,-0.119355750821,0.886567463837,0.0726863051863,0.440986437263,50,0.1,1000],[16.9182128491,3.66086080253,-14.2207876285,-0.109909567708,0.8951696892,0.0728537008168,0.425773945588,50,0.1,1000],[16.1190559271,3.63383637827,-14.568067427,-0.095484007003,0.908449609124,0.0761619127443,0.399751766897,50,0.1,1000],[15.5833011713,3.63395210821,-14.7398772805,-0.0868542282059,0.916217595995,0.0795482578588,0.382980070636,50,0.1,1000],[14.6613191759,3.63398218313,-14.9498278371,-0.0726412182618,0.928209894111,0.0857187680475,0.354685689997,50,0.1,1000],[14.0694991659,3.63318570081,-15.0377376694,-0.063733308363,0.935166009913,0.0897511767164,0.336670945562,50,0.1,1000],[13.0829745134,3.62851924767,-15.1132026143,-0.04907427365,0.945668015473,0.0963555120732,0.30662572539,50,0.1,1000],[12.4650440398,3.62261615654,-15.119531083,-0.0399402451731,0.951620003618,0.100303563479,0.28768618438,50,0.1,1000],[11.4545018884,3.60628341712,-15.0650326662,-0.025073068544,0.96039027432,0.10625907778,0.256380324157,50,0.1,1000],[10.8312598765,3.59148331929,-14.9929412903,-0.0159495548378,0.965232099696,0.109531008714,0.236802794635,50,0.1,1000],[9.82494707657,3.5588364254,-14.8140635203,-0.00138660953887,0.97216591273,0.114020013897,0.204672792208,50,0.1,1000],[9.40932006077,3.54205153029,-14.7177652213,0.00454001901783,0.974717851221,0.115548713015,0.191188372188,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.725346704319,3.20828893,16.2512626602,-0.129002526634,0.00624535479663,0.00366936295058,0.991617809159,50,0.1,1000],[0.762929949219,3.21170367452,16.2490765663,-0.121891759649,-0.0298324403336,-0.00417539355115,0.992086180995,50,0.1,1000],[0.846473264377,3.2189550582,16.2433059187,-0.117379274869,-0.0476814241183,-0.00719978358231,0.991915697397,50,0.1,1000],[1.11567723964,3.24073277271,16.2187151936,-0.110874453515,-0.0672457339834,-0.00862396791508,0.991519285741,50,0.1,1000],[1.36513117328,3.25987251505,16.1899566479,-0.107647693638,-0.0736422335572,-0.00755611086516,0.991429120351,50,0.1,1000],[1.89686957143,3.2980086916,16.1113764164,-0.103846379518,-0.0757239843814,-0.00324542129101,0.991701202425,50,0.1,1000],[2.57797507448,3.46763156367,16.0396160816,-0.102330624711,-0.0726726016011,0.000659686897623,0.992092082942,50,0.1,1000],[3.77420697261,3.74537116993,15.8763935192,-0.100999148365,-0.0619032986874,0.00844905208718,0.992922840487,50,0.1,1000],[4.52252743102,3.90043858677,15.7452322179,-0.100737965537,-0.0523436245105,0.0139110423878,0.993437713283,50,0.1,1000],[5.30164047587,3.90559666234,15.4758994862,-0.100969949595,-0.0330067390665,0.0233992851392,0.99406644542,50,0.1,1000],[5.71378534492,3.86105894263,15.2753135196,-0.101397007519,-0.0191911496329,0.0294958847198,0.994223485654,50,0.1,1000],[6.40754635948,3.78392305057,14.8884468466,-0.102360750585,0.00568065874802,0.039415949919,0.993949892976,50,0.1,1000],[6.84324525724,3.73287239448,14.6138643314,-0.103031323037,0.0222170539141,0.0454775914275,0.993389519608,50,0.1,1000],[7.55213443847,3.6425945404,14.1054513953,-0.10413377743,0.0505824073835,0.0548856883321,0.991758608573,50,0.1,1000],[7.98494196278,3.58205652921,13.7560016846,-0.104755198377,0.0688089529614,0.0604001422809,0.990274456511,50,0.1,1000],[8.87580901604,3.57707574466,13.1269004424,-0.105639044978,0.0992933224018,0.0685679515232,0.987056059364,50,0.1,1000],[9.4281195889,3.57669757997,12.7041654926,-0.106054363424,0.118515261913,0.0731398568098,0.984559376594,50,0.1,1000],[10.2941538206,3.56655823438,11.9586018407,-0.106561280604,0.150193266901,0.0795202482851,0.979675051314,50,0.1,1000],[10.8076726974,3.55065400753,11.4667703214,-0.106525354167,0.169951778652,0.0828258226008,0.97617038726,50,0.1,1000],[11.5993445495,3.5152057418,10.6130226632,-0.1063018872,0.202220527245,0.0869652807053,0.969661697238,50,0.1,1000],[12.059961016,3.49086687486,10.0557024613,-0.106178019912,0.222205988313,0.0888776177453,0.965117348258,50,0.1,1000],[12.7554673735,3.44631908065,9.10022423829,-0.106039649491,0.254667423486,0.0907508532956,0.956903536819,50,0.1,1000],[13.1519888097,3.4153447421,8.48385496219,-0.105904915138,0.274701588951,0.091235741484,0.951314472429,50,0.1,1000],[13.7354274415,3.52700465658,7.43932222836,-0.105751756369,0.307138784966,0.0908136231079,0.9414006685,50,0.1,1000],[14.0586365105,3.66154013255,6.77213736597,-0.105626857079,0.327116149251,0.0899064005852,0.934748538965,50,0.1,1000],[14.5161046542,3.87699827677,5.65295938655,-0.105564566254,0.359391705531,0.087338871109,0.923074019751,50,0.1,1000],[14.7580290173,4.00843884048,4.94451486637,-0.105543347211,0.379238642619,0.0851807640611,0.915304807831,50,0.1,1000],[15.0777810428,4.1568499565,3.76747557324,-0.105736195601,0.411241496145,0.0807752954983,0.901762518863,50,0.1,1000],[15.2318920186,4.11730408818,3.02889133892,-0.105922209783,0.430886232069,0.0775968666647,0.892802479147,50,0.1,1000],[15.4047902355,3.96590733109,1.81331979191,-0.106519979445,0.462489415206,0.0717891044556,0.877270402603,50,0.1,1000],[15.466349588,3.84451609499,1.05724320303,-0.106994100726,0.481841222497,0.0678912816162,0.867047906746,50,0.1,1000],[15.4864835209,3.65339834402,-0.175264024341,-0.108093522029,0.512877222874,0.061213967543,0.849426627161,50,0.1,1000],[15.4529356622,3.53899951074,-0.934965431355,-0.108896004473,0.531817277365,0.0569485680677,0.837895521112,50,0.1,1000],[15.3182169161,3.36149160847,-2.16123575848,-0.110517946994,0.562072652872,0.0499996717884,0.818144332687,50,0.1,1000],[15.1895047638,3.2566915543,-2.91000742194,-0.111636816623,0.580456427882,0.0457490777854,0.805304028542,50,0.1,1000],[14.9020547121,3.09637539661,-4.10628596484,-0.113710366455,0.609683899595,0.0391571942342,0.783468065255,50,0.1,1000],[14.6807660839,3.00297552016,-4.82955686371,-0.115072863676,0.627353181084,0.0353113051691,0.769375937989,50,0.1,1000],[14.2469852392,2.8619721403,-5.97263988764,-0.117424307366,0.655296767713,0.0296946650712,0.745597683158,50,0.1,1000],[14.1941142553,2.8548395815,-6.65920465669,-0.36696632353,-0.493878824757,-0.188032619099,0.765547619686,50,0.1,1000],[14.9856813677,2.87194363054,-7.77370379959,-0.56269383406,-0.455841598182,-0.33608411903,0.602188966533,50,0.1,1000],[15.6886536175,2.88764692054,-8.45665253914,-0.326237908335,0.728801594587,0.432467592724,0.418794513021,50,0.1,1000],[16.8104164056,2.92177783377,-9.54110397267,-0.212732123609,0.815224261713,0.214377194089,0.494162792361,50,0.1,1000],[17.3979071911,2.94746405671,-10.1741080907,-0.179019119926,0.831236255641,0.151346630694,0.504076025403,50,0.1,1000],[18.0952332671,2.9963854948,-11.1315038307,-0.15151151356,0.845116726096,0.0978531899856,0.50323626036,50,0.1,1000],[18.3605204934,3.03022459083,-11.6678476069,-0.142552587946,0.851379470478,0.0794458682798,0.498517914354,50,0.1,1000],[18.5308064163,3.0899578555,-12.4509017104,-0.133535398756,0.860968033485,0.0617230287209,0.486921564856,50,0.1,1000],[18.4926971369,3.12881774552,-12.8777301928,-0.129775895667,0.866814098551,0.0554124352079,0.478247841062,50,0.1,1000],[18.2289320355,3.19331195718,-13.48433787,-0.124730107162,0.876604607828,0.0501297953414,0.462053855649,50,0.1,1000],[17.9615613719,3.23300429082,-13.8073587478,-0.121870431846,0.88280872559,0.0490504041352,0.450988258958,50,0.1,1000],[17.3878062417,3.29500812369,-14.2528663532,-0.116914363694,0.893165311089,0.0499684217028,0.431381403704,50,0.1,1000],[16.9637963011,3.3309603642,-14.4824332025,-0.113561507467,0.899678445852,0.0517797961636,0.418331603876,50,0.1,1000],[16.1857603865,3.38318033999,-14.7834030705,-0.107266182219,0.910347988712,0.0562902296091,0.395716964067,50,0.1,1000],[15.6620583635,3.41111921262,-14.928361527,-0.102852969819,0.91693396274,0.0597938876928,0.380891146613,50,0.1,1000],[14.7587495563,3.44723697829,-15.0971553759,-0.0946220576047,0.927479196001,0.0663151422105,0.355571805848,50,0.1,1000],[14.1766206581,3.46374185047,-15.1635490655,-0.088925554018,0.933841563612,0.070670502163,0.339172316143,50,0.1,1000],[13.2043048407,3.47918955783,-15.2082180687,-0.0785881800887,0.943777885345,0.077978045115,0.311490971882,50,0.1,1000],[12.5928734014,3.48209575712,-15.1999139038,-0.0716037802545,0.949620508699,0.0824902171063,0.293750152669,50,0.1,1000],[11.5911867071,3.47458754845,-15.1257014311,-0.0593076202291,0.958496601904,0.089544227439,0.264099794876,50,0.1,1000],[10.9710442713,3.46324036449,-15.0453635134,-0.0512144672729,0.963562843211,0.0936211903803,0.245272905632,50,0.1,1000],[9.9682532412,3.43305556635,-14.8561700896,-0.0373878157261,0.971011767135,0.0995552009755,0.21407256078,50,0.1,1000],[9.55263618518,3.41693003111,-14.757609751,-0.0314191710372,0.973825281601,0.101743962116,0.20081165997,50,0.1,1000]]} diff --git a/test/golden/fixtures/noise.perlin.json b/test/golden/fixtures/noise.perlin.json index 7610ecd..7b216c9 100644 --- a/test/golden/fixtures/noise.perlin.json +++ b/test/golden/fixtures/noise.perlin.json @@ -1 +1 @@ -{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.823213458654,3.25822313157,16.2368867203,-0.124556629061,0.00849005551966,0.00451936061141,0.992165883557,50,0.1,1000],[1.21610682983,3.46904475164,16.1796926262,-0.129304739735,-0.00445580371023,0.0128086336089,0.99151216281,50,0.1,1000],[1.6068548381,3.68726944781,16.1176756084,-0.137219242722,-0.00297932431566,0.0197856809564,0.990338593554,50,0.1,1000],[2.07120366023,3.87902516222,16.0473043984,-0.1405891397,-0.0104163555807,0.027776545523,0.989623492473,50,0.1,1000],[2.48711696762,4.06022155231,15.9750343131,-0.146304623812,-0.00662242637552,0.0341680940741,0.988627150076,50,0.1,1000],[3.03926630404,4.16701833488,15.8769243489,-0.145448150169,-0.00752713604298,0.0413660237627,0.988472068353,50,0.1,1000],[3.46727936966,4.26006618588,15.7908301908,-0.146672557235,-0.00240138118467,0.0465802374706,0.98808485253,50,0.1,1000],[4.08486010371,4.25696604277,15.6443802725,-0.141134273263,0.00161826561509,0.0523116307337,0.98860608506,50,0.1,1000],[4.50822779642,4.25388843417,15.5294423861,-0.138098233654,0.00698669143787,0.0558068304035,0.988820338426,50,0.1,1000],[5.16857028865,4.17137325117,15.2992096659,-0.130255251839,0.0146862402332,0.0595054949316,0.989584245928,50,0.1,1000],[5.57620827198,4.11316087008,15.1244041482,-0.125720696968,0.0199737990244,0.0609025214839,0.989993048755,50,0.1,1000],[6.26239304686,4.0130627146,14.770866342,-0.119300739014,0.0310060825252,0.0623568955863,0.990412830132,50,0.1,1000],[6.64988504996,3.94907168964,14.5080520755,-0.116224569392,0.0366285383953,0.0619447403743,0.990612461452,50,0.1,1000],[7.35135725613,3.86720533756,14.0101289052,-0.113151980153,0.0513315945028,0.0615996046746,0.990336905047,50,0.1,1000],[7.71675872852,3.82509990612,13.645989312,-0.112799453097,0.0579282295352,0.0597247078373,0.990128053778,50,0.1,1000],[8.41594636247,3.78593878924,12.9976757408,-0.113935483469,0.0764019797142,0.0579043090998,0.988852129537,50,0.1,1000],[8.74329983842,3.78445310202,12.5308689516,-0.117255207294,0.083887784321,0.0549077162828,0.988027934168,50,0.1,1000],[9.39858181329,3.77326761664,11.7492884833,-0.121924464149,0.105190012053,0.0518618175813,0.985586037991,50,0.1,1000],[9.64408934191,3.78179770178,11.2042937183,-0.127548671591,0.111939744553,0.0475523886831,0.984347296586,50,0.1,1000],[10.2092235435,3.7452847342,10.3286223982,-0.133060930331,0.134492502916,0.0431939259145,0.980989724841,50,0.1,1000],[10.3521022459,3.71403614937,9.74145596757,-0.138236489679,0.139497122482,0.0373049701695,0.979816087305,50,0.1,1000],[10.8322073913,3.61272510934,8.80257563591,-0.141734464329,0.163939842526,0.031823160666,0.975716329729,50,0.1,1000],[10.9044109419,3.51759158819,8.19078252034,-0.14421296408,0.169078336248,0.0250737245676,0.974672481164,50,0.1,1000],[11.3441874907,3.35349430362,7.19074653347,-0.144376852442,0.198513988978,0.0199538567269,0.969200373638,50,0.1,1000],[11.4022289059,3.20209582472,6.5478316546,-0.143465211991,0.20757362628,0.0139143569498,0.967541892267,50,0.1,1000],[11.8430096784,2.99575813473,5.47866628645,-0.140196321211,0.245092066388,0.0100829122568,0.959256589966,50,0.1,1000],[11.9281987017,2.80148613414,4.79816869393,-0.135637321661,0.261125252397,0.00506915965392,0.955714613864,50,0.1,1000],[12.3695069382,2.58961632839,3.65959164322,-0.129943231733,0.307017343493,0.00148516875376,0.942789956244,50,0.1,1000],[12.4780370484,2.39911951752,2.93898269525,-0.123809829315,0.330051197571,-0.00323995727346,0.935802776136,50,0.1,1000],[12.8737072269,2.25009077835,1.7416657399,-0.119547925822,0.380488871635,-0.00725046908661,0.916997242467,50,0.1,1000],[12.9733152655,2.12954303071,0.988919851466,-0.115955400726,0.407261420885,-0.0113429737,0.905849776204,50,0.1,1000],[13.2758329543,2.0916654028,-0.244287451262,-0.116577875974,0.456807075099,-0.0146362893211,0.881772461584,50,0.1,1000],[13.3418636775,2.0683301964,-1.01061523613,-0.117446353115,0.483890709457,-0.0169861174497,0.867045331719,50,0.1,1000],[13.5139355729,2.12803179445,-2.23432249577,-0.12225883688,0.528237334896,-0.0184759867884,0.840045673007,50,0.1,1000],[13.5241143403,2.17606908999,-2.96849858047,-0.125766328814,0.552147470798,-0.0189888397076,0.823987515072,50,0.1,1000],[13.5448429441,2.29125530112,-4.12670028976,-0.131635588156,0.589021201984,-0.0186932050687,0.79710517476,50,0.1,1000],[13.49288789,2.38455915186,-4.78990410085,-0.135659349392,0.608229931455,-0.0176777181614,0.781882593287,50,0.1,1000],[13.3618575648,2.52041524772,-5.85353056435,-0.140377653126,0.638472394435,-0.0158390987104,0.756568727215,50,0.1,1000],[13.387820304,2.60223239159,-6.59062263345,-0.306216969105,-0.536947295903,-0.0836853737714,0.781610854244,50,0.1,1000],[14.2594684199,2.71873883682,-7.7936173894,-0.47577559047,-0.545867717858,-0.229501380104,0.650380764355,50,0.1,1000],[15.0516376445,2.8557419949,-8.5648626773,-0.159262185282,0.803441044966,0.55764808439,0.134709530399,50,0.1,1000],[16.5439602789,2.99865732172,-9.51820137311,-0.26463875732,0.803728004178,0.221618372417,0.484636895449,50,0.1,1000],[17.4590502328,3.03437347479,-10.0607509255,-0.220779167807,0.811962045913,0.138779438825,0.522220702786,50,0.1,1000],[18.4824475052,3.00823562353,-10.9266604204,-0.179033736847,0.823695368124,0.0784085328779,0.532282785344,50,0.1,1000],[19.0109193454,2.92580763419,-11.4693499523,-0.15996430251,0.830668895242,0.054456196311,0.530504600435,50,0.1,1000],[19.3554830222,2.84419890261,-12.3075013652,-0.140608710233,0.844107685705,0.0370284561047,0.516081678593,50,0.1,1000],[19.453392647,2.73123925111,-12.8707433246,-0.128720731241,0.854168486394,0.0277798857412,0.503046169003,50,0.1,1000],[19.1779851694,2.6633804198,-13.651908219,-0.11553228823,0.869911083618,0.0243633934585,0.478866810329,50,0.1,1000],[18.8824861897,2.55730502852,-14.1960771946,-0.105737327057,0.881778626539,0.0212656722328,0.459166465055,50,0.1,1000],[18.1112383529,2.53904890041,-14.8426808807,-0.0938300670584,0.898077014713,0.0247319622907,0.429001077155,50,0.1,1000],[17.4919880803,2.48155993742,-15.2819805048,-0.0847015644831,0.910051354992,0.0258428556654,0.404925083271,50,0.1,1000],[16.3883441618,2.549308001,-15.6875967999,-0.0729139936771,0.924839523499,0.0343354989306,0.371720969026,50,0.1,1000],[15.5648787572,2.57613094513,-15.9174930605,-0.0643922685437,0.935126517472,0.0395689158645,0.346159403987,50,0.1,1000],[14.323710844,2.73093617906,-16.0034149815,-0.0526754286548,0.94681601009,0.0521577900293,0.313120275919,50,0.1,1000],[13.4465316966,2.83201068525,-15.9621444036,-0.0448090956418,0.954280402876,0.061009282004,0.289169371033,50,0.1,1000],[12.2416250687,3.0187354816,-15.7329569856,-0.0331057683452,0.962378639189,0.0757940852327,0.258817734282,50,0.1,1000],[11.431048556,3.13508158563,-15.4420134441,-0.0256370593253,0.966956498263,0.0863440407054,0.238500688238,50,0.1,1000],[10.3526362065,3.27890537884,-14.9880716789,-0.0135167262894,0.972155240847,0.100299143208,0.211356494283,50,0.1,1000],[9.65139111726,3.3589661673,-14.534434595,-0.00608444544753,0.974732256484,0.110271638282,0.194165325132,50,0.1,1000],[8.70189002404,3.4312729016,-13.9744001111,0.00660103753351,0.978281573093,0.121254946976,0.167984606094,50,0.1,1000],[8.28375730007,3.45624976908,-13.5905055856,0.0115268241648,0.979259679151,0.1273733431,0.157142115877,50,0.1,1000]]} +{"columns":["px","py","pz","qx","qy","qz","qw","fov","near","far"],"samples":[[0.823213458654,3.25822313157,16.2368867203,-0.124556629061,0.00849005551966,0.00451936061141,0.992165883557,50,0.1,1000],[0.853194937139,3.2654824732,16.2411917908,-0.116868026995,-0.0280011124987,-0.00283811369814,0.992748582006,50,0.1,1000],[0.93098433761,3.27374602229,16.2386075745,-0.11196218411,-0.0461122303109,-0.00564556109544,0.992625941221,50,0.1,1000],[1.18872226492,3.29365519132,16.217731868,-0.104739469299,-0.0661068337518,-0.00694063032534,0.992275847611,50,0.1,1000],[1.42984950779,3.30919934864,16.1904780906,-0.101034302568,-0.0727673377743,-0.00594040580875,0.992200431282,50,0.1,1000],[1.9465218707,3.33791618024,16.1133491238,-0.0964607348252,-0.075264406988,-0.00192998951457,0.992485199294,50,0.1,1000],[2.33224193733,3.35740627076,16.0420350802,-0.0945136701842,-0.0724560493166,0.00172805793942,0.99288181617,50,0.1,1000],[3.04923435058,3.39094303525,15.8789679845,-0.0926341491163,-0.0620525846327,0.00914248550004,0.993722700816,50,0.1,1000],[3.53616969979,3.41302314038,15.7475646751,-0.0921593292794,-0.0527004841107,0.0144414850937,0.994243813413,50,0.1,1000],[4.38189468981,3.45017211192,15.4772083316,-0.0922743851898,-0.0336816195486,0.023768288801,0.994879919784,50,0.1,1000],[4.92804619099,3.47370104235,15.2755780027,-0.0927721552265,-0.0200587497792,0.02979487533,0.995039315392,50,0.1,1000],[5.84027985158,3.50964087144,14.8865510876,-0.0940646795427,0.00450706455221,0.0397610636811,0.994761569546,50,0.1,1000],[6.41148906335,3.52891909718,14.6105584523,-0.0950454343865,0.0208565236301,0.0459563851361,0.994192829128,50,0.1,1000],[7.34100399636,3.55512129392,14.099434614,-0.0967644226967,0.0489091154132,0.0556640113241,0.992545244698,50,0.1,1000],[7.91005133736,3.56814236908,13.7480559341,-0.0978028356418,0.066921996868,0.061351171803,0.991056045536,50,0.1,1000],[8.81683406775,3.58162522926,13.1160135137,-0.0993637369627,0.0969409698202,0.0696840241895,0.98786306385,50,0.1,1000],[9.36099825017,3.58393910057,12.6922591557,-0.100175261577,0.115807621496,0.0742581753112,0.985413230666,50,0.1,1000],[10.2109037786,3.57540649677,11.9477781337,-0.101276025883,0.146897913995,0.0804817847901,0.980656337237,50,0.1,1000],[10.7134026285,3.55812064338,11.4587199064,-0.10158530138,0.166358413099,0.0836214876056,0.977247538623,50,0.1,1000],[11.4878686168,3.51642270374,10.6126720341,-0.101934249077,0.198368859928,0.0874431765756,0.970882534165,50,0.1,1000],[11.9395955496,3.48617517795,10.0614703104,-0.102166114355,0.218371901537,0.089080389885,0.966405961196,50,0.1,1000],[12.6253270112,3.43027603278,9.11628398973,-0.102555862051,0.251174200845,0.0903796477044,0.958240750161,50,0.1,1000],[13.019158509,3.39208607653,8.5054094145,-0.102681584342,0.271598483836,0.0904926839394,0.952628904647,50,0.1,1000],[13.6038002224,3.32618960806,7.466930847,-0.102781347774,0.304882322712,0.0895649125756,0.942582033715,50,0.1,1000],[13.9310243512,3.28298670718,6.80141568026,-0.102684740273,0.325453004371,0.0884441404668,0.935795821789,50,0.1,1000],[14.3991559597,3.21096008837,5.68162144373,-0.102457418361,0.358682360668,0.0856831747718,0.923854877743,50,0.1,1000],[14.6492327565,3.16642671841,4.97104034649,-0.102227433452,0.379065976872,0.0834590287537,0.915911091508,50,0.1,1000],[14.9828435086,3.09827952836,3.78873868772,-0.101989387362,0.411854077269,0.0789325446022,0.90207762266,50,0.1,1000],[15.145178429,3.05965508321,3.04646300257,-0.101889217484,0.431911758992,0.0756533231845,0.892943108208,50,0.1,1000],[15.3305590755,3.00533248519,1.82502226818,-0.102030610727,0.463903931688,0.0696771542765,0.877227445313,50,0.1,1000],[15.3997017172,2.97649881601,1.06529663595,-0.102264534657,0.483267642854,0.0656694106246,0.866995893203,50,0.1,1000],[15.4320305799,2.93769872565,-0.172058533475,-0.103117968113,0.513929198559,0.0587931481614,0.849580384219,50,0.1,1000],[15.4058729924,2.91723930153,-0.933092983325,-0.103888645457,0.532421058037,0.0543981874777,0.838317245142,50,0.1,1000],[15.2832798639,2.89009946519,-2.15793031866,-0.105675307431,0.561705100948,0.0472717555354,0.81919807745,50,0.1,1000],[15.1622635143,2.87676262153,-2.90368589088,-0.107016462314,0.57941709708,0.0429663381015,0.806831579821,50,0.1,1000],[14.8876397783,2.86405315252,-4.09268527511,-0.109580764641,0.607603137437,0.0364371531293,0.785800749089,50,0.1,1000],[14.6747075859,2.86041057746,-4.81063172922,-0.11128187182,0.624741961601,0.0327345896454,0.772167257179,50,0.1,1000],[14.2553637213,2.86121412129,-5.94520302091,-0.114180967484,0.652122570847,0.0274550094634,0.748962670439,50,0.1,1000],[14.1683043705,2.86968594472,-6.68222906521,-0.364947510402,-0.498138906855,-0.184446632449,0.764624341691,50,0.1,1000],[14.9604172323,2.8990610723,-7.80486356633,-0.562599486512,-0.459497603241,-0.332065788701,0.601727581524,50,0.1,1000],[15.7295354281,2.91977978626,-8.4409750449,-0.323218020089,0.727934797232,0.43251685821,0.422575685331,50,0.1,1000],[16.872238195,2.92815541011,-9.53566753826,-0.211193737528,0.813460764606,0.215050810203,0.497425309676,50,0.1,1000],[17.4640740649,2.94044604331,-10.1749523306,-0.178277325575,0.829423717821,0.152773498701,0.506886328081,50,0.1,1000],[18.1623637838,2.97359515792,-11.1460076799,-0.152025173303,0.84358890808,0.100661511012,0.505087478609,50,0.1,1000],[18.4252058456,3.00083110028,-11.6921968123,-0.143828702791,0.850152580895,0.08309684068,0.499648685098,50,0.1,1000],[18.5869897016,3.05373583609,-12.4910868701,-0.135958660785,0.860309895848,0.0666114278526,0.486770010727,50,0.1,1000],[18.5408919667,3.08928769164,-12.927071924,-0.13280472629,0.866503899178,0.0609463520869,0.477304346881,50,0.1,1000],[18.2596851002,3.14917996369,-13.5464337777,-0.128489305995,0.876775968457,0.0564751194944,0.459961911748,50,0.1,1000],[17.9791330704,3.18726753092,-13.8750027721,-0.12586416143,0.883204425126,0.0557508986763,0.448330228293,50,0.1,1000],[17.3815916986,3.24990589864,-14.3237620427,-0.120899884477,0.893786612868,0.0569992027336,0.428111900651,50,0.1,1000],[16.9425737124,3.28855482626,-14.5509456585,-0.117330171604,0.900354454105,0.0588503145173,0.414888091279,50,0.1,1000],[16.142045057,3.34869486335,-14.8401903987,-0.110455644459,0.910995607376,0.0631430343965,0.392300281872,50,0.1,1000],[15.6068123879,3.38315161445,-14.9732265513,-0.105623185992,0.917510638239,0.0663396861072,0.37764668322,50,0.1,1000],[14.690349913,3.43085399269,-15.1165162066,-0.0967595460712,0.927897116991,0.072114141312,0.352766326549,50,0.1,1000],[14.1040056226,3.45410603523,-15.1646342596,-0.0907593138656,0.934156626384,0.0758873124257,0.336682729202,50,0.1,1000],[13.1310122329,3.47822445431,-15.1785483507,-0.0800960327246,0.94393204105,0.0821407356188,0.309563930348,50,0.1,1000],[12.5223199184,3.48469079768,-15.15219684,-0.0729676145882,0.949682542608,0.0859807844189,0.292209000883,50,0.1,1000],[11.5282308135,3.48103281103,-15.0526392496,-0.0604150875929,0.958447682778,0.0919578051871,0.2631954001,50,0.1,1000],[10.9138110954,3.47163957772,-14.9598020217,-0.052108008196,0.963481371681,0.0953962991982,0.244720142211,50,0.1,1000],[9.92180476989,3.4432904119,-14.7558593781,-0.0378122777722,0.970943658557,0.100363074011,0.213929654168,50,0.1,1000],[9.51168909431,3.42721165602,-14.6529978031,-0.0316104763186,0.973784175392,0.102178607395,0.200760279272,50,0.1,1000]]} diff --git a/test/golden/scenarios.ts b/test/golden/scenarios.ts index 7ee1c16..5c5aa79 100644 --- a/test/golden/scenarios.ts +++ b/test/golden/scenarios.ts @@ -31,6 +31,7 @@ import { RotateWithFollowTargetAimThree } from '../../src/three/aim/RotateWithFo import { RotationComposerAimThree } from '../../src/three/aim/RotationComposerAimThree'; import { FollowBodyThree } from '../../src/three/body/FollowBodyThree'; import { HardLockToTargetBodyThree } from '../../src/three/body/HardLockToTargetBodyThree'; +import { OrbitFollowBodyThree, type OrbitFollowThreeOptions } from '../../src/three/body/OrbitFollowBodyThree'; import { PositionComposerBodyThree } from '../../src/three/body/PositionComposerBodyThree'; import { GroupFramingExtensionThree } from '../../src/three/extension/GroupFramingExtensionThree'; import { TargetGroup } from '../../src/three/extension/TargetGroup'; @@ -77,7 +78,7 @@ const aim = (name: string, make: (w: World) => Update, perFrame?: (w: World, dt: /** A full controller: Follow + HardLookAt, plus whatever `extra` registers. */ function rig(w: World, extra?: (c: VirtualCamera) => void, offset: Vec3 = [0, 3, 8]) { const controller = new VirtualCamera('rig'); - controller.setBody(new FollowBodyThree(w.target, { offset, damping: 0.4 })); + controller.setBody(new FollowBodyThree(w.target, { offset, damping: 0.4, rotationDamping: 0.4 })); controller.setAim(new HardLookAtAimThree(w.target)); extra?.(controller); const state = initialState(); @@ -133,6 +134,28 @@ function coreScenario(name: string, defaultBlend: BlendDefinition, hints: BlendH const bindingModes: BindingMode[] = Object.values(BindingModes); +/** OrbitFollow with all three axes driven every frame and a radius change halfway. */ +const orbitFollowScenario = (name: string, options: OrbitFollowThreeOptions): Scenario => ({ + name, + run: () => + simulate((w) => { + const orbit = new OrbitFollowBodyThree(w.target, options); + orbit.vertical.setValue(17.5); + orbit.horizontal.damping = 0.2; + orbit.vertical.damping = 0.2; + orbit.radial.damping = 0.3; + const state = initialState(); + return (dt, frame) => { + orbit.horizontal.applyDelta(Math.sin(w.clock.time) * 90 * dt); + orbit.vertical.applyDelta(Math.cos(w.clock.time * 1.3) * 40 * dt); + orbit.radial.applyDelta(Math.sin(w.clock.time * 0.7) * 0.5 * dt); + if (frame === 100) orbit.radius = 6; + orbit.update(state, dt, frame === 0); + return state; + }; + }), +}); + export const scenarios: Scenario[] = [ // bodies body('body.hardLockToTarget', (w) => new HardLockToTargetBodyThree(w.target, { damping: 0.3 }).update), @@ -143,7 +166,9 @@ export const scenarios: Scenario[] = [ ...bindingModes.map((mode) => body( `body.follow.${mode}`, - (w) => new FollowBodyThree(w.target, { offset: [0, 3, 8], damping: 0.4, bindingMode: mode }).update, + (w) => + new FollowBodyThree(w.target, { offset: [0, 3, 8], damping: 0.4, rotationDamping: 0.4, bindingMode: mode }) + .update, ), ), body( @@ -186,6 +211,15 @@ export const scenarios: Scenario[] = [ lookaheadIgnoreY: true, }).update, ), + orbitFollowScenario('body.orbitFollow.worldSpace', { radius: 10, damping: 0.4 }), + orbitFollowScenario('body.orbitFollow.threeRing', { orbitStyle: 'threeRing', splineCurvature: 0.3, damping: 0.4 }), + orbitFollowScenario('body.orbitFollow.lockToTarget', { + radius: 10, + damping: { into: 0.2, from: 0.6 }, + bindingMode: BindingModes.lockToTarget, + targetOffset: [0, 0.5, 0], + maxSpeed: 20, + }), // aims aim('aim.hardLookAt', (w) => new HardLookAtAimThree(w.target).update), diff --git a/test/react/body/Follow.test.tsx b/test/react/body/Follow.test.tsx index 54b1354..fc8d18e 100644 --- a/test/react/body/Follow.test.tsx +++ b/test/react/body/Follow.test.tsx @@ -26,6 +26,7 @@ describe('Body.Follow', () => { target: new Object3D(), offset: [1, 2, 3], damping: { into: 0.2, from: 1 }, + rotationDamping: 0.3, bindingMode: BindingModes.lockToTargetNoRoll, maxSpeed: 8, }, diff --git a/test/react/body/OrbitFollow.test.tsx b/test/react/body/OrbitFollow.test.tsx new file mode 100644 index 0000000..2034cfc --- /dev/null +++ b/test/react/body/OrbitFollow.test.tsx @@ -0,0 +1,139 @@ +import { useThree } from '@react-three/fiber'; +import { create } from '@react-three/test-renderer'; +import { createRef } from 'react'; +import { Object3D } from 'three'; +import { describe, expect, it } from 'vitest'; + +import { BindingModes } from '../../../src/core/body/BindingModes'; + +import type { OrbitFollowBodyThree } from '../../../src/three/body/OrbitFollowBodyThree'; +import { OrbitFollowHelperThree } from '../../../src/three/body/OrbitFollowHelperThree'; +import type { KlippThree } from '../../../src/three/KlippThree'; + +import { Body } from '../../../src/react/body/Body'; +import type { OrbitFollowProps } from '../../../src/react/body/OrbitFollow'; +import { InputController } from '../../../src/react/input/InputController'; +import { Klipp } from '../../../src/react/Klipp'; +import { useKlipp } from '../../../src/react/KlippContext'; +import { VirtualCamera } from '../../../src/react/VirtualCamera'; + +import { expectPropsReachInstance, expectStopsWhenUnmounted, mountInCamera } from '../wiring'; + +function SceneReader({ onRead }: { onRead: (core: KlippThree, element: HTMLElement) => void }) { + const element = useThree((state) => state.gl.domElement); + onRead(useKlipp(), element); + return null; +} + +describe('Body.OrbitFollow', () => { + it('registers a body that orbits the target every frame', async () => { + const target = new Object3D(); + target.position.set(3, 0, 0); + const mounted = await mountInCamera(); + await mounted.frame(); + expect(mounted.state.position[0]).toBeCloseTo(3, 9); + expect(mounted.state.position[2]).toBeCloseTo(5, 9); + }); + + it('passes every body prop to the same body, on mount and when props change', async () => { + await expectPropsReachInstance( + (props, ref) => , + { target: new Object3D(), radius: 4, targetOffset: [0, 1, 0], damping: 0.5, maxSpeed: 4 }, + { + target: new Object3D(), + radius: 8, + targetOffset: [1, 2, 3], + bindingMode: BindingModes.lockToTarget, + damping: { into: 0.2, from: 1 }, + maxSpeed: 8, + recenteringTarget: 'axisCenter', + orbitStyle: 'threeRing', + orbits: { top: { height: 3, radius: 1 }, center: { height: 1, radius: 3 }, bottom: { height: 0, radius: 2 } }, + splineCurvature: 0.2, + }, + ); + }); + + it('applies axis settings, and restores the defaults when they are removed, keeping the value', async () => { + const ref = createRef(); + const scene = (props: OrbitFollowProps) => ; + const mounted = await mountInCamera(scene({ radial: { range: [-1, 1], damping: 0.3 } })); + const body = ref.current!; + expect(body.radial).toMatchObject({ range: [-1, 1], damping: 0.3 }); + expect(body.vertical.value).toBe(0); + + body.radial.setValue(0.5); + await mounted.update(scene({})); + expect(body.radial).toMatchObject({ range: [Math.log(0.5), Math.log(2)], damping: 0, value: 0.5 }); + expect(body.horizontal).toMatchObject({ range: [-180, 180], wrap: true }); + }); + + it('applies autoNormalize to horizontal, unless its axis settings say otherwise', async () => { + const ref = createRef(); + const scene = (props: OrbitFollowProps) => ; + const mounted = await mountInCamera(scene({})); + expect(ref.current!.horizontal.autoNormalize).toBe(false); + + await mounted.update(scene({ autoNormalize: true })); + expect(ref.current!.horizontal.autoNormalize).toBe(true); + expect(ref.current!.vertical.autoNormalize).toBe(false); + + await mounted.update(scene({ autoNormalize: true, horizontal: { autoNormalize: false } })); + expect(ref.current!.horizontal.autoNormalize).toBe(false); + }); + + it('turns with a nested InputController, found through context', async () => { + let core: KlippThree | undefined; + let element: HTMLElement | undefined; + const renderer = await create( + + ((core = c), (element = e))} /> + + + + + + , + ); + await renderer.advanceFrames(1, 0.05); + const before = [...core!.activeState!.position]; + + const pointer = { pointerId: 1, buttons: 1, bubbles: true, pointerType: 'mouse' }; + element!.dispatchEvent(new PointerEvent('pointerdown', { ...pointer, clientX: 0, clientY: 0 })); + element!.dispatchEvent(new PointerEvent('pointermove', { ...pointer, clientX: 20, clientY: 0 })); + await renderer.advanceFrames(1, 0.05); + + expect(core!.activeState!.position).not.toEqual(before); + }); + + it("starts from VirtualCamera's initialState.position direction", async () => { + const target = new Object3D(); + const mounted = await mountInCamera(, { position: [-4, 0, 0] }); + await mounted.frame(); + expect(mounted.state.position[0]).toBeCloseTo(-10, 6); + expect(mounted.state.position[1]).toBeCloseTo(0, 6); + expect(mounted.state.position[2]).toBeCloseTo(0, 6); + }); + + it('draws the orbit in the scene while debug is on', async () => { + const scene = (debug: boolean) => ; + const helpers = () => { + const found: OrbitFollowHelperThree[] = []; + mounted.renderer.scene.instance.traverse((object) => { + if (object instanceof OrbitFollowHelperThree) found.push(object); + }); + return found; + }; + const mounted = await mountInCamera(scene(true)); + await mounted.frame(); + expect(helpers()).toHaveLength(1); + expect(helpers()[0].geometry.drawRange.count).toBeGreaterThan(0); + + await mounted.update(scene(false)); + expect(helpers()).toHaveLength(0); + }); + + it('stops moving the camera once unmounted', async () => { + await expectStopsWhenUnmounted((target) => ); + }); +}); diff --git a/test/three/body/FollowBodyThree.test.ts b/test/three/body/FollowBodyThree.test.ts index 9dc0551..ce77e4b 100644 --- a/test/three/body/FollowBodyThree.test.ts +++ b/test/three/body/FollowBodyThree.test.ts @@ -14,21 +14,13 @@ function expectVec3Close(actual: Vec3, expected: Vec3) { for (let i = 0; i < 3; i++) expect(actual[i]).toBeCloseTo(expected[i], 8); } -/** Runs one update so the next one damps instead of snapping, then moves the camera back to the origin. */ -function warmUp(body: FollowBodyThree) { - const out = cameraState.create(); - body.update(out, 0.016, false); - vec3.set(out.position, 0, 0, 0); - return out; -} - describe('FollowBodyThree', () => { it('sits at the offset from the target and publishes the target as out.target', () => { const out = cameraState.create(); new FollowBodyThree(new Vector3(2, 3, 4), { offset: [1, 2, 3] }).update(out, 0.1, false); - expect(out.position).toEqual([3, 5, 7]); - expect(out.target).toEqual([2, 3, 4]); + expectVec3Close(out.position, [3, 5, 7]); + expectVec3Close(out.target, [2, 3, 4]); expect(out.hasTarget).toBe(true); }); @@ -50,19 +42,20 @@ describe('FollowBodyThree', () => { }); describe('damping', () => { - it('snaps on the very first update, then eases toward the offset position and converges', () => { - const body = new FollowBodyThree(new Vector3(), { offset: [10, 5, -3], damping: 0.3 }); + it('snaps on the very first update, then eases after a moving target and converges', () => { + const target = new Vector3(); + const body = new FollowBodyThree(target, { offset: [10, 5, -3], damping: 0.3 }); const out = cameraState.create(); body.update(out, 0.016, false); - expect(out.position).toEqual([10, 5, -3]); + expectVec3Close(out.position, [10, 5, -3]); - vec3.set(out.position, 0, 0, 0); + target.set(-10, 0, 0); body.update(out, 0.016, false); expect(out.position[0]).toBeGreaterThan(0); expect(out.position[0]).toBeLessThan(10); for (let i = 0; i < 300; i++) body.update(out, 0.016, false); - expectVec3Close(out.position, [10, 5, -3]); + expectVec3Close(out.position, [0, 5, -3]); }); it('keeps out.target exactly offset away from the damped position (real bug: the lag distorted the offset blend hints read)', () => { @@ -80,13 +73,11 @@ describe('FollowBodyThree', () => { it('maxSpeed caps how fast damping closes the gap', () => { const run = (maxSpeed: number) => { - const body = new FollowBodyThree(new Vector3(), { - offset: [100, 0, 0], - damping: 1, - bindingMode: BindingModes.lockToTarget, - maxSpeed, - }); - const out = warmUp(body); + const target = new Vector3(); + const body = new FollowBodyThree(target, { offset: [0, 0, 5], damping: 1, maxSpeed }); + const out = cameraState.create(); + body.update(out, 0.016, false); + target.set(100, 0, 0); body.update(out, 0.05, false); return out.position[0]; }; @@ -106,7 +97,7 @@ describe('FollowBodyThree', () => { return out.position; }; - expect(run(true)).toEqual([-40, 12, 3]); + expectVec3Close(run(true), [-40, 12, 3]); expect(run(false)).not.toEqual([-40, 12, 3]); }); @@ -125,6 +116,25 @@ describe('FollowBodyThree', () => { expect(out.position).toEqual([-40, 12, 3]); }); + it('rotationDamping eases the turn with the target, which is instant without it', () => { + const run = (rotationDamping: number) => { + const target = new Object3D(); + const body = new FollowBodyThree(target, { offset: [0, 0, 10], rotationDamping }); + const out = cameraState.create(); + body.update(out, 0.016, false); + target.rotation.y = Math.PI / 2; + target.updateMatrixWorld(); + body.update(out, 0.016, false); + return out.position; + }; + + expectVec3Close(run(0), [10, 0, 0]); + const eased = run(0.5); + expect(eased[0]).toBeGreaterThan(0); + expect(eased[0]).toBeLessThan(10); + expect(Math.hypot(eased[0], eased[2])).toBeCloseTo(10, 9); + }); + describe('bindingMode', () => { /** A target yawed, pitched and rolled, so every mode has something to ignore. */ function tiltedTarget() { @@ -200,5 +210,24 @@ describe('FollowBodyThree', () => { body.update(out, 0.1, false); expectVec3Close(out.position, [5, 1, 8]); }); + + it('lockToTargetOnAssign captures the rotation again on entering the mode and on activation', () => { + const target = new Object3D(); + const { body, out } = follow(target, BindingModes.lockToTargetOnAssign); + expectVec3Close(out.position, [0, 1, 8]); + + target.rotateY(0.4); + target.updateMatrixWorld(); + body.bindingMode = BindingModes.worldSpace; + body.update(out, 0.1, false); + body.bindingMode = BindingModes.lockToTargetOnAssign; + body.update(out, 0.1, false); + expectVec3Close(out.position, rotated([0, 1, 8], target.quaternion)); + + target.rotation.set(0, 0, 0); + target.updateMatrixWorld(); + body.update(out, 0.1, true); + expectVec3Close(out.position, [0, 1, 8]); + }); }); }); diff --git a/test/three/body/OrbitFollowBodyThree.test.ts b/test/three/body/OrbitFollowBodyThree.test.ts new file mode 100644 index 0000000..808c571 --- /dev/null +++ b/test/three/body/OrbitFollowBodyThree.test.ts @@ -0,0 +1,59 @@ +import type { Vec3 } from 'math'; +import { Object3D, Vector3 } from 'three'; +import { describe, expect, it } from 'vitest'; + +import * as cameraState from '../../../src/core/CameraState'; +import { BindingModes } from '../../../src/core/body/BindingModes'; + +import { OrbitFollowBodyThree } from '../../../src/three/body/OrbitFollowBodyThree'; + +function expectVec3Close(actual: Vec3, expected: Vec3) { + for (let i = 0; i < 3; i++) expect(actual[i]).toBeCloseTo(expected[i], 8); +} + +function orbit(body: OrbitFollowBodyThree) { + const out = cameraState.create(); + body.update(out, 0.016, false); + return out; +} + +describe('OrbitFollowBodyThree', () => { + it('orbits a fixed point', () => { + const out = orbit(new OrbitFollowBodyThree(new Vector3(1, 2, 3))); + expectVec3Close(out.position, [1, 2, 13]); + expectVec3Close(out.target, [1, 2, 3]); + }); + + it("orbits an Object3D's world position, rotating the orbit with it in lockToTarget", () => { + const parent = new Object3D(); + parent.position.set(0, 5, 0); + const child = new Object3D(); + child.position.set(2, 0, 0); + child.rotation.y = Math.PI / 2; + parent.add(child); + parent.updateMatrixWorld(); + + const out = orbit(new OrbitFollowBodyThree(child, { bindingMode: BindingModes.lockToTarget })); + expectVec3Close(out.position, [12, 5, 0]); + }); + + it('follows a ref once it resolves', () => { + const ref = { current: null as Object3D | null }; + const body = new OrbitFollowBodyThree(ref); + const out = orbit(body); + expect(out.hasTarget).toBe(false); + + ref.current = new Object3D(); + ref.current.position.set(0, 0, -4); + ref.current.updateMatrixWorld(); + body.update(out, 0.016, false); + expectVec3Close(out.position, [0, 0, 6]); + }); + + it('takes targetOffset as a Vector3, a tuple or one number', () => { + expect(new OrbitFollowBodyThree(null, { targetOffset: new Vector3(1, 2, 3) }).targetOffset).toEqual([1, 2, 3]); + expect(new OrbitFollowBodyThree(null, { targetOffset: [0, 1.5] }).targetOffset).toEqual([0, 1.5, 0]); + expect(new OrbitFollowBodyThree(null, { targetOffset: 2 }).targetOffset).toEqual([2, 2, 2]); + expect(new OrbitFollowBodyThree(null).targetOffset).toEqual([0, 0, 0]); + }); +}); diff --git a/test/three/body/OrbitFollowHelperThree.test.ts b/test/three/body/OrbitFollowHelperThree.test.ts new file mode 100644 index 0000000..a459367 --- /dev/null +++ b/test/three/body/OrbitFollowHelperThree.test.ts @@ -0,0 +1,69 @@ +import { Color, Vector3 } from 'three'; +import { describe, expect, it } from 'vitest'; + +import * as cameraState from '../../../src/core/CameraState'; + +import { OrbitFollowBodyThree } from '../../../src/three/body/OrbitFollowBodyThree'; +import { OrbitFollowHelperThree } from '../../../src/three/body/OrbitFollowHelperThree'; + +function drawn(helper: OrbitFollowHelperThree): Vector3[] { + const attribute = helper.geometry.getAttribute('position'); + const points: Vector3[] = []; + for (let i = 0; i < helper.geometry.drawRange.count; i++) + points.push(new Vector3().fromBufferAttribute(attribute, i)); + return points; +} + +describe('OrbitFollowHelperThree', () => { + it('draws a circle and an arc on the sphere around the target', () => { + const target = new Vector3(1, 2, 3); + const body = new OrbitFollowBodyThree(target, { radius: 4 }); + body.update(cameraState.create(), 0.016, false); + const helper = new OrbitFollowHelperThree(); + helper.sync(body); + + const points = drawn(helper); + expect(points.length).toBe((64 + 32) * 2); + for (const point of points) expect(point.distanceTo(target)).toBeCloseTo(4, 4); + }); + + it('adds the three rings for threeRing', () => { + const body = new OrbitFollowBodyThree(new Vector3(), { orbitStyle: 'threeRing' }); + body.update(cameraState.create(), 0.016, false); + const helper = new OrbitFollowHelperThree(); + helper.sync(body); + + const points = drawn(helper); + expect(points.length).toBe((64 * 4 + 32) * 2); + const heights = new Set(points.slice(0, 64 * 6).map((point) => Math.round(point.y))); + expect([...heights].sort((a, b) => a - b)).toEqual([-10, 0, 10]); + }); + + it('colors the horizontal circle, the vertical arc and the rings apart', () => { + const body = new OrbitFollowBodyThree(new Vector3(), { orbitStyle: 'threeRing' }); + body.update(cameraState.create(), 0.016, false); + const helper = new OrbitFollowHelperThree(); + helper.sync(body); + + const colors = helper.geometry.getAttribute('color'); + const expectColor = (vertex: number, expected: Color) => + expect(new Color().fromBufferAttribute(colors, vertex).toArray()).toEqual( + expected.toArray().map((channel) => expect.closeTo(channel, 6)), + ); + expectColor(0, helper.colors.rings); + expectColor(64 * 6, helper.colors.horizontal); + expectColor(64 * 8, helper.colors.vertical); + }); + + it('follows the camera that moves with the target', () => { + const target = new Vector3(); + const body = new OrbitFollowBodyThree(target, { radius: 4 }); + const helper = new OrbitFollowHelperThree(); + const out = cameraState.create(); + body.update(out, 0.016, false); + target.set(10, 0, 0); + body.update(out, 0.016, false); + helper.sync(body); + for (const point of drawn(helper)) expect(point.distanceTo(target)).toBeCloseTo(4, 4); + }); +});