MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / fromVector

Function fromVector

javascript/MaterialXView/source/helper.js:39–54  ·  view source on GitHub ↗

* Get Three uniform from MaterialX vector * @param {any} value * @param {any} dimension * @returns {THREE.Uniform}

(value, dimension)

Source from the content-addressed store, hash-verified

37 * @returns {THREE.Uniform}
38 */
39function fromVector(value, dimension)
40{
41 let outValue;
42 if (value)
43 {
44 outValue = value.data();
45 }
46 else
47 {
48 outValue = [];
49 for (let i = 0; i < dimension; ++i)
50 outValue.push(0.0);
51 }
52
53 return outValue;
54}
55
56/**
57 * Get Three uniform from MaterialX matrix

Callers 1

toThreeUniformFunction · 0.85

Calls 2

pushMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected