mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
Review of the PR's own code: joints, rings, node posing, card clearance
- A hand-set Canadarm2 joint no longer stops Dextre's and the Japanese arm's sway: only the joints set by hand hold still. - A ring already shown or hidden is not sent to the renderer again (the close-up asked for it every frame). - Node posing: the matrix handed to a node goes through one scratch (the node copies it), and a name the model lacks is looked up once. - The tracked card's clearance step holds until the clearance has left it, so jitter at a step's edge no longer republishes the card every frame. - A frame the station cannot be placed in gives its dots back rather than drawing neither model nor dot.
This commit is contained in:
1 parent
b1c5aa11b7
commit
ce3d292198
6 files changed
+36
-14
No files matched your search
@@ -502,7 +502,8 @@ export function createIssArticulation() {
|
||||
/** Whether the last update had the station in sunlight; null before one. */
|
||||
let lastSunlit = null;
|
||||
/** Command panel state: the arm is being posed by hand, so the sway is off. */
|
||||
let armManual = false;
|
||||
/** The arm joints posed by hand (command panel); the rest keep swaying. */
|
||||
const manualJoints = new Set();
|
||||
let armNodes = null;
|
||||
/** Command panel state: how far the arrays are rolled out, 0.05 to 1. */
|
||||
let deploy = 1;
|
||||
@@ -697,10 +698,10 @@ export function createIssArticulation() {
|
||||
dishes = nextDishes;
|
||||
|
||||
// Arm: an illustrative sway (see ISS_ARM_JOINTS).
|
||||
if (!armManual) {
|
||||
{
|
||||
const arm = issArmAngles(nowMs / 1000, ISS_SWAY_JOINTS);
|
||||
ISS_SWAY_JOINTS.forEach((joint, i) => {
|
||||
if (!joint.sway) return;
|
||||
if (!joint.sway || manualJoints.has(joint.node)) return;
|
||||
const node = (armNodes ??= ISS_SWAY_JOINTS.map(
|
||||
(entry) => model.getNode(entry.node) ?? null,
|
||||
))[i];
|
||||
@@ -723,7 +724,7 @@ export function createIssArticulation() {
|
||||
* @param {number} angle Radians.
|
||||
*/
|
||||
function setJoint(name, pivot, axis, angle) {
|
||||
armManual = true;
|
||||
manualJoints.add(name);
|
||||
const node = boundModel?.getNode(name);
|
||||
if (node) node.matrix = issAxisMatrix(pivot, axis, angle, scratchMatrix);
|
||||
}
|
||||
@@ -739,7 +740,7 @@ export function createIssArticulation() {
|
||||
override = null;
|
||||
dishOverride = null;
|
||||
telemetryAllowed = true;
|
||||
armManual = false;
|
||||
manualJoints.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -802,7 +803,7 @@ export function createIssArticulation() {
|
||||
|
||||
/** Command panel: hand the arm back to its sway. */
|
||||
function resumeArm() {
|
||||
armManual = false;
|
||||
manualJoints.clear();
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user