From c1323c84096c6c2048e53262f1eead5b50d0f52d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 11 Dec 2022 22:19:21 +0200 Subject: [OKG/HWK2] cpos and B posture can now be null --- Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html index fd44bd9..02d9c6a 100644 --- a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html +++ b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html @@ -209,8 +209,8 @@ mannequin : instruction[1], A : instruction[2], - B : fixPostureY(instruction[3]), - cpos : instruction[1].position.clone(), + B : (!instruction[3]) ? null : fixPostureY(instruction[3]), + cpos : null, npos : (instruction.length < 5 || !instruction[4]) ? null : vecSum(instruction[1].position, arrToVec(instruction[4])), crot : null, nrot : (instruction.length < 6 || !instruction[5]) ? null : vecMultScal(arrToVec(instruction[5]), Math.PI / 2), @@ -236,6 +236,7 @@ if (!mo.iscamera) { if (!mo.A) mo.A = fixPostureY(mo.mannequin.posture); if (!mo.crot) mo.crot = mo.mannequin.rotation.clone(); + if (!mo.cpos) mo.cpos = mo.mannequin.position.clone(); if (mo.B) mo.mannequin.posture = Mannequin.blend(mo.A, mo.B, blendPer); if (mo.npos) -- cgit v1.3.1-26-gb76a