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:
parent
7198c51aea
commit
e61c5ccb4a
@ -17,7 +17,8 @@ const plugins = [
|
|||||||
commonjs(),
|
commonjs(),
|
||||||
vue(),
|
vue(),
|
||||||
buble({
|
buble({
|
||||||
transforms: { forOf: false },
|
// transforms: { forOf: false },
|
||||||
|
objectAssign: 'Object.assign',
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -68,9 +68,9 @@ export default function useThree() {
|
|||||||
*/
|
*/
|
||||||
function init(params) {
|
function init(params) {
|
||||||
if (params) {
|
if (params) {
|
||||||
for (const [key, value] of Object.entries(params)) {
|
Object.entries(params).forEach(([key, value]) => {
|
||||||
conf[key] = value;
|
conf[key] = value;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!obj.scene) {
|
if (!obj.scene) {
|
||||||
@ -88,9 +88,9 @@ export default function useThree() {
|
|||||||
if (conf.orbit_ctrl) {
|
if (conf.orbit_ctrl) {
|
||||||
obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement);
|
obj.orbitCtrl = new OrbitControls(obj.camera, obj.renderer.domElement);
|
||||||
if (conf.orbit_ctrl instanceof Object) {
|
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;
|
obj.orbitCtrl[key] = value;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Color, ShaderMaterial as TShaderMaterial, UniformsUtils } from 'three';
|
import { Color, ShaderMaterial as TShaderMaterial, UniformsUtils } from 'three';
|
||||||
import ShaderMaterial from './ShaderMaterial.js';
|
|
||||||
import SubsurfaceScatteringShader from './SubsurfaceScatteringShader.js';
|
import SubsurfaceScatteringShader from './SubsurfaceScatteringShader.js';
|
||||||
|
import ShaderMaterial from './ShaderMaterial.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
extends: ShaderMaterial,
|
extends: ShaderMaterial,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
export function setFromProp(o, prop) {
|
export function setFromProp(o, prop) {
|
||||||
if (prop instanceof Object) {
|
if (prop instanceof Object) {
|
||||||
for (const [key, value] of Object.entries(prop)) {
|
Object.entries(prop).forEach(([key, value]) => {
|
||||||
o[key] = value;
|
o[key] = value;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user