2024-10-11 04:48:24 +02:00
|
|
|
function nodeValue_Quaternion(_name, _node, _value, _tooltip = "") { return new __NodeValue_Quaternion(_name, _node, _value, _tooltip); }
|
2024-08-07 11:48:39 +02:00
|
|
|
|
2024-10-11 04:48:24 +02:00
|
|
|
function __NodeValue_Quaternion(_name, _node, _value, _tooltip = "") : __NodeValue_Array(_name, _node, _value, _tooltip, 4) constructor {
|
2024-08-07 11:48:39 +02:00
|
|
|
setDisplay(VALUE_DISPLAY.d3quarternion);
|
|
|
|
|
|
|
|
/////============== GET =============
|
|
|
|
|
|
|
|
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { //// Get value
|
|
|
|
getValueRecursive(self.__curr_get_val, _time);
|
|
|
|
var val = __curr_get_val[0];
|
|
|
|
var nod = __curr_get_val[1];
|
|
|
|
|
2024-08-09 13:30:09 +02:00
|
|
|
var typ = nod.type;
|
2024-08-07 11:48:39 +02:00
|
|
|
var dis = nod.display_type;
|
|
|
|
|
2024-12-04 06:12:05 +01:00
|
|
|
if(!is_array(val)) return array_create(4, val);
|
2024-08-08 08:04:25 +02:00
|
|
|
|
2024-11-23 12:08:44 +01:00
|
|
|
var _convert = applyUnit && attributes.angle_display == QUARTERNION_DISPLAY.euler;
|
2024-12-04 06:12:05 +01:00
|
|
|
if(!_convert) return array_verify(val, 4);
|
2024-08-08 08:04:25 +02:00
|
|
|
|
|
|
|
var _d = array_get_depth(val);
|
|
|
|
|
|
|
|
if(_d == 1) return quarternionFromEuler(val[0], val[1], val[2]);
|
2024-09-04 06:14:10 +02:00
|
|
|
if(_d == 2) return array_map(val, function(v, i) /*=>*/ {return quarternionFromEuler(v[0], v[1], v[2])});
|
2024-08-08 08:04:25 +02:00
|
|
|
|
2024-08-07 11:48:39 +02:00
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|