universo-platform-3d

Форк
0
144 строки · 2.7 Кб
1
import { ApiProperty } from '@nestjs/swagger'
2
import mongoose, { Document } from 'mongoose'
3
import { Light } from '../godot-types/light.schema'
4
import { Clouds, CloudsSchema } from '../godot-types/clouds.schema'
5
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
6
import { Vector3AsArray } from '../option-sets/vectors'
7

8
export type EnvironmentDocument = Environment & Document
9

10
@Schema({
11
  timestamps: true,
12
  toJSON: {
13
    virtuals: true
14
  }
15
})
16
export class Environment {
17
  @ApiProperty()
18
  _id: string
19

20
  @Prop({
21
    required: true,
22
    default: [0.05882353, 0.05882353, 0.05882353],
23
    type: mongoose.Types.Array
24
  })
25
  @ApiProperty()
26
  skyTopColor: Vector3AsArray
27

28
  @Prop({
29
    required: true,
30
    default: [0.1372549, 0.1372549, 0.1372549],
31
    type: mongoose.Types.Array
32
  })
33
  @ApiProperty()
34
  skyHorizonColor: Vector3AsArray
35

36
  @Prop({
37
    required: true,
38
    default: [0.18431373, 0.18431373, 0.16862745],
39
    type: mongoose.Types.Array
40
  })
41
  @ApiProperty()
42
  skyBottomColor: Vector3AsArray
43

44
  @Prop({
45
    required: true,
46
    default: 1
47
  })
48
  @ApiProperty()
49
  sunCount: number
50

51
  @Prop()
52
  @ApiProperty()
53
  suns: Light[]
54

55
  @Prop({
56
    required: true,
57
    default: false
58
  })
59
  @ApiProperty()
60
  fogEnabled: boolean
61

62
  @Prop({
63
    default: true
64
  })
65
  @ApiProperty()
66
  fogVolumetric: boolean
67

68
  @Prop({
69
    default: 0.01
70
  })
71
  @ApiProperty()
72
  fogDensity: number
73

74
  @Prop({
75
    default: [0.8, 0.9, 1.0],
76
    type: mongoose.Types.Array
77
  })
78
  @ApiProperty()
79
  fogColor: Vector3AsArray
80

81
  @Prop({
82
    required: true,
83
    default: true
84
  })
85
  @ApiProperty()
86
  ssao: boolean
87

88
  @Prop({
89
    required: true,
90
    default: true
91
  })
92
  @ApiProperty()
93
  glow: boolean
94

95
  @Prop({
96
    required: true,
97
    default: 1.0
98
  })
99
  @ApiProperty()
100
  glowHdrThreshold: number
101

102
  @Prop({
103
    required: true,
104
    default: 'medium'
105
  })
106
  @ApiProperty()
107
  shadowsPreset: string
108

109
  @Prop({
110
    required: true,
111
    default: false
112
  })
113
  @ApiProperty()
114
  globalIllumination: boolean
115

116
  @Prop({
117
    required: true,
118
    default: 'physical_sky'
119
  })
120
  @ApiProperty()
121
  environment: string
122

123
  @Prop({
124
    required: true,
125
    default: 2
126
  })
127
  @ApiProperty()
128
  tonemap: number
129

130
  @Prop({ type: CloudsSchema, required: false })
131
  @ApiProperty({ type: () => Clouds })
132
  clouds: Clouds
133

134
  @Prop({ type: Boolean, required: false, default: false })
135
  @ApiProperty({ type: () => Boolean, required: false, default: false })
136
  ssr?: boolean
137

138
  @ApiProperty()
139
  createdAt: Date // this is managed by mongoose timestamps: true, but defining it here so types will align
140
  @ApiProperty()
141
  updatedAt: Date // this is managed by mongoose timestamps: true, but defining it here so types will align
142
}
143

144
export const EnvironmentSchema = SchemaFactory.createForClass(Environment)
145

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.