1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00
This commit is contained in:
Kevin Levron 2021-02-26 23:46:58 +01:00
parent ca3c622fad
commit d9265d03f3
14 changed files with 88 additions and 59262 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
build/trois.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -930,7 +930,13 @@ var TubeGeometry = {
};
var Light = {
inject: ['scene'],
inject: {
scene: 'scene',
parent: {
from: 'group',
default: function () { return inject('scene'); },
},
},
props: {
color: {
type: String,
@ -949,9 +955,6 @@ var Light = {
},
// can't use setup because it will not be used in sub components
// setup() {},
created: function created() {
this.parent = inject('group', this.scene);
},
mounted: function mounted() {
var this$1 = this;
@ -1456,7 +1459,15 @@ var CubeTexture = {
};
var Mesh = {
inject: ['three', 'scene', 'rendererComponent'],
inject: {
three: 'three',
scene: 'scene',
rendererComponent: 'rendererComponent',
parent: {
from: 'group',
default: function () { return inject('scene'); },
},
},
emits: ['ready'],
props: {
materialId: String,
@ -1470,9 +1481,6 @@ var Mesh = {
},
// can't use setup because it will not be used in sub components
// setup() {},
created: function created() {
this.parent = inject('group', this.scene);
},
provide: function provide() {
return {
mesh: this,
@ -2206,8 +2214,9 @@ var InstancedMesh = {
castShadow: Boolean,
receiveShadow: Boolean,
},
created: function created() {
this.parent = inject('group', this.scene);
setup: function setup() {
var parent = inject('group', inject('scene'));
return { parent: parent };
},
provide: function provide() {
return {
@ -2346,8 +2355,9 @@ var Sprite = {
position: Object,
scale: Object,
},
created: function created() {
this.parent = inject('group', this.scene);
setup: function setup() {
var parent = inject('group', inject('scene'));
return { parent: parent };
},
mounted: function mounted() {
this.texture = new TextureLoader().load(this.src, this.onLoaded);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -929,7 +929,13 @@ var TubeGeometry = {
};
var Light = {
inject: ['scene'],
inject: {
scene: 'scene',
parent: {
from: 'group',
default: function () { return inject('scene'); },
},
},
props: {
color: {
type: String,
@ -948,9 +954,6 @@ var Light = {
},
// can't use setup because it will not be used in sub components
// setup() {},
created: function created() {
this.parent = inject('group', this.scene);
},
mounted: function mounted() {
var this$1 = this;
@ -1455,7 +1458,15 @@ var CubeTexture = {
};
var Mesh = {
inject: ['three', 'scene', 'rendererComponent'],
inject: {
three: 'three',
scene: 'scene',
rendererComponent: 'rendererComponent',
parent: {
from: 'group',
default: function () { return inject('scene'); },
},
},
emits: ['ready'],
props: {
materialId: String,
@ -1469,9 +1480,6 @@ var Mesh = {
},
// can't use setup because it will not be used in sub components
// setup() {},
created: function created() {
this.parent = inject('group', this.scene);
},
provide: function provide() {
return {
mesh: this,
@ -2205,8 +2213,9 @@ var InstancedMesh = {
castShadow: Boolean,
receiveShadow: Boolean,
},
created: function created() {
this.parent = inject('group', this.scene);
setup: function setup() {
var parent = inject('group', inject('scene'));
return { parent: parent };
},
provide: function provide() {
return {
@ -2345,8 +2354,9 @@ var Sprite = {
position: Object,
scale: Object,
},
created: function created() {
this.parent = inject('group', this.scene);
setup: function setup() {
var parent = inject('group', inject('scene'));
return { parent: parent };
},
mounted: function mounted() {
this.texture = new TextureLoader().load(this.src, this.onLoaded);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "troisjs",
"version": "0.1.2",
"version": "0.1.3",
"scripts": {
"dev": "vite",
"build": "vite build",

View File

@ -126,41 +126,41 @@ export default [
terser(),
],
},
{
input,
external: [
'gsap',
'vue',
],
output: {
format: 'cjs',
file: 'build/trois.js',
sourcemap: true,
},
plugins: [
...plugins,
resolve({
moduleDirectories: ['node_modules'],
}),
],
},
{
input,
external: [
'gsap',
'vue',
],
output: {
format: 'cjs',
file: 'build/trois.min.js',
sourcemap: true,
},
plugins: [
...plugins,
resolve({
moduleDirectories: ['node_modules'],
}),
terser(),
],
},
// {
// input,
// external: [
// 'gsap',
// 'vue',
// ],
// output: {
// format: 'cjs',
// file: 'build/trois.js',
// sourcemap: true,
// },
// plugins: [
// ...plugins,
// resolve({
// moduleDirectories: ['node_modules'],
// }),
// ],
// },
// {
// input,
// external: [
// 'gsap',
// 'vue',
// ],
// output: {
// format: 'cjs',
// file: 'build/trois.min.js',
// sourcemap: true,
// },
// plugins: [
// ...plugins,
// resolve({
// moduleDirectories: ['node_modules'],
// }),
// terser(),
// ],
// },
];