Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitc1323c84096c6c2048e53262f1eead5b50d0f52d (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-12-11 22:19:21 +0200
Committer
 Syndamia <kamen@syndamia.com>
2022-12-11 22:19:21 +0200
Filesdc0e66e0d167cf79a2bf7b6576ac698243bbd50a
uni-projects-c1323c84096c6c2048e53262f1eead5b50d0f52d.tar
uni-projects-c1323c84096c6c2048e53262f1eead5b50d0f52d.tar.gz
uni-projects-c1323c84096c6c2048e53262f1eead5b50d0f52d.zip
Parenta940b965c3715d1a56fed4402488b3347b48fa95 (diff)
[OKG/HWK2] cpos and B posture can now be null
1 files changed, 3 insertions, 2 deletions
-rw-r--r--Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html5
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)