1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

fix rollup forOf

This commit is contained in:
Kevin Levron 2020-09-17 10:57:13 +02:00
parent 7198c51aea
commit e61c5ccb4a
4 changed files with 9 additions and 8 deletions

View File

@ -17,7 +17,8 @@ const plugins = [
commonjs(),
vue(),
buble({
transforms: { forOf: false },
// transforms: { forOf: false },
objectAssign: 'Object.assign',
}),
];

View File

@ -68,9 +68,9 @@ export default function useThree() {
*/
function init(params) {
if (params) {
for (const [key, value] of Object.entries(params)) {
Object.entries(params).forEach(([key, value]) => {
conf[key] = value;
}
});
}
if (!obj.scene) {
@ -88,9 +88,9 @@ export default function useThree() {
if (conf.orbit_ctrl) {
obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement);
if (conf.orbit_ctrl instanceof Object) {
for (const [key, value] of Object.entries(conf.orbit_ctrl)) {
Object.entries(conf.orbit_ctrl).forEach(([key, value]) => {
obj.orbitCtrl[key] = value;
}
});
}
}

View File

@ -1,6 +1,6 @@
import { Color, ShaderMaterial as TShaderMaterial, UniformsUtils } from 'three';
import ShaderMaterial from './ShaderMaterial.js';
import SubsurfaceScatteringShader from './SubsurfaceScatteringShader.js';
import ShaderMaterial from './ShaderMaterial.js';
export default {
extends: ShaderMaterial,

View File

@ -1,8 +1,8 @@
export function setFromProp(o, prop) {
if (prop instanceof Object) {
for (const [key, value] of Object.entries(prop)) {
Object.entries(prop).forEach(([key, value]) => {
o[key] = value;
}
});
}
};