Game
- Create class "player"
This commit is contained in:
38
site/real_game/node_modules/three/src/scenes/Fog.js
generated
vendored
Normal file
38
site/real_game/node_modules/three/src/scenes/Fog.js
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
import { Color } from '../math/Color.js';
|
||||
|
||||
class Fog {
|
||||
|
||||
constructor( color, near = 1, far = 1000 ) {
|
||||
|
||||
this.isFog = true;
|
||||
|
||||
this.name = '';
|
||||
|
||||
this.color = new Color( color );
|
||||
|
||||
this.near = near;
|
||||
this.far = far;
|
||||
|
||||
}
|
||||
|
||||
clone() {
|
||||
|
||||
return new Fog( this.color, this.near, this.far );
|
||||
|
||||
}
|
||||
|
||||
toJSON( /* meta */ ) {
|
||||
|
||||
return {
|
||||
type: 'Fog',
|
||||
name: this.name,
|
||||
color: this.color.getHex(),
|
||||
near: this.near,
|
||||
far: this.far
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { Fog };
|
35
site/real_game/node_modules/three/src/scenes/FogExp2.js
generated
vendored
Normal file
35
site/real_game/node_modules/three/src/scenes/FogExp2.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
import { Color } from '../math/Color.js';
|
||||
|
||||
class FogExp2 {
|
||||
|
||||
constructor( color, density = 0.00025 ) {
|
||||
|
||||
this.isFogExp2 = true;
|
||||
|
||||
this.name = '';
|
||||
|
||||
this.color = new Color( color );
|
||||
this.density = density;
|
||||
|
||||
}
|
||||
|
||||
clone() {
|
||||
|
||||
return new FogExp2( this.color, this.density );
|
||||
|
||||
}
|
||||
|
||||
toJSON( /* meta */ ) {
|
||||
|
||||
return {
|
||||
type: 'FogExp2',
|
||||
name: this.name,
|
||||
color: this.color.getHex(),
|
||||
density: this.density
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { FogExp2 };
|
77
site/real_game/node_modules/three/src/scenes/Scene.js
generated
vendored
Normal file
77
site/real_game/node_modules/three/src/scenes/Scene.js
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
import { Object3D } from '../core/Object3D.js';
|
||||
import { Euler } from '../math/Euler.js';
|
||||
|
||||
class Scene extends Object3D {
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
this.isScene = true;
|
||||
|
||||
this.type = 'Scene';
|
||||
|
||||
this.background = null;
|
||||
this.environment = null;
|
||||
this.fog = null;
|
||||
|
||||
this.backgroundBlurriness = 0;
|
||||
this.backgroundIntensity = 1;
|
||||
this.backgroundRotation = new Euler();
|
||||
|
||||
this.environmentIntensity = 1;
|
||||
this.environmentRotation = new Euler();
|
||||
|
||||
this.overrideMaterial = null;
|
||||
|
||||
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
||||
|
||||
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
copy( source, recursive ) {
|
||||
|
||||
super.copy( source, recursive );
|
||||
|
||||
if ( source.background !== null ) this.background = source.background.clone();
|
||||
if ( source.environment !== null ) this.environment = source.environment.clone();
|
||||
if ( source.fog !== null ) this.fog = source.fog.clone();
|
||||
|
||||
this.backgroundBlurriness = source.backgroundBlurriness;
|
||||
this.backgroundIntensity = source.backgroundIntensity;
|
||||
this.backgroundRotation.copy( source.backgroundRotation );
|
||||
|
||||
this.environmentIntensity = source.environmentIntensity;
|
||||
this.environmentRotation.copy( source.environmentRotation );
|
||||
|
||||
if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
|
||||
|
||||
this.matrixAutoUpdate = source.matrixAutoUpdate;
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
toJSON( meta ) {
|
||||
|
||||
const data = super.toJSON( meta );
|
||||
|
||||
if ( this.fog !== null ) data.object.fog = this.fog.toJSON();
|
||||
|
||||
if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;
|
||||
if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;
|
||||
data.object.backgroundRotation = this.backgroundRotation.toArray();
|
||||
|
||||
if ( this.environmentIntensity !== 1 ) data.object.environmentIntensity = this.environmentIntensity;
|
||||
data.object.environmentRotation = this.environmentRotation.toArray();
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { Scene };
|
Reference in New Issue
Block a user