diff options
1 files changed, 13 insertions, 4 deletions
| -rw-r--r-- | Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html | 17 |
diff --git a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html index 2864dbc..3099725 100644 --- a/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html +++ b/Year 2/Computer Graphics Fundamentals/Homework 2/mannequin.html @@ -174,8 +174,9 @@ {
t = Math.floor(t) / 100;
- if (animationData.hasOwnProperty(t)) {
- for (var instr of animationData[t]) {
+ var prop = approxProp(animationData, t);
+ if (prop)
+ for (var instr of prop) {
if (instr[1].constructor === Array) {
executeHooks.push({
start : t,
@@ -203,7 +204,6 @@ });
}
}
- }
const executeLength = executeHooks.length;
for (var i = 0; i < executeLength; i++) {
@@ -303,6 +303,15 @@ return p;
}
+ function approxProp(object, property) {
+ if (object.hasOwnProperty(property))
+ return object[property];
+ var toCheck = property.toFixed(1);
+ if (object.hasOwnProperty(toCheck))
+ return object[toCheck];
+ return null;
+ }
+
/*
* За функции, генериращи обекти
*/
@@ -665,7 +674,7 @@ 3, [50, 0, 0], [0, -10, 0], false
]
],
- 5.01: [
+ 5: [
[
3, jotaro,
null,
|
