1 | <?php |
||
44 | trait Primitives |
||
45 | { |
||
46 | |||
47 | /** |
||
48 | * Aframe Document Object Model |
||
49 | * |
||
50 | * @var \AframeVR\Core\DOM\AframeDOMDocument |
||
51 | */ |
||
52 | protected $aframeDomObj; |
||
53 | |||
54 | /** |
||
55 | * Sphere primitives |
||
56 | * |
||
57 | * @var array |
||
58 | */ |
||
59 | protected $spheres = array(); |
||
60 | |||
61 | /** |
||
62 | * Box primitives |
||
63 | * |
||
64 | * @var array |
||
65 | */ |
||
66 | protected $boxes = array(); |
||
67 | |||
68 | /** |
||
69 | * Cylinder primitives |
||
70 | * |
||
71 | * @var array |
||
72 | */ |
||
73 | protected $cylinders = array(); |
||
74 | |||
75 | /** |
||
76 | * Plane primitives |
||
77 | * |
||
78 | * @var array |
||
79 | */ |
||
80 | protected $planes = array(); |
||
81 | |||
82 | /** |
||
83 | * Camera primitives |
||
84 | * |
||
85 | * @var array |
||
86 | */ |
||
87 | protected $cameras = array(); |
||
88 | |||
89 | /** |
||
90 | * collada-model primitives |
||
91 | * |
||
92 | * @var array |
||
93 | */ |
||
94 | protected $collada_models = array(); |
||
95 | |||
96 | /** |
||
97 | * |
||
98 | * @var \AframeVR\Extras\Primitives\Sky $sky |
||
99 | */ |
||
100 | protected $sky; |
||
101 | |||
102 | /** |
||
103 | * |
||
104 | * @var \AframeVR\Extras\Primitives\Videosphere $videosphere |
||
105 | */ |
||
106 | protected $videosphere; |
||
107 | |||
108 | |||
109 | /** |
||
110 | * |
||
111 | * @var array |
||
112 | */ |
||
113 | protected $images = array(); |
||
114 | |||
115 | /** |
||
116 | * |
||
117 | * @var lights |
||
118 | */ |
||
119 | protected $lights = array(); |
||
120 | |||
121 | /** |
||
122 | * |
||
123 | * @var videos |
||
124 | */ |
||
125 | protected $videos = array(); |
||
126 | |||
127 | /** |
||
128 | * |
||
129 | * @var toruses |
||
130 | */ |
||
131 | protected $toruses = array(); |
||
132 | |||
133 | /** |
||
134 | * |
||
135 | * @var rings |
||
136 | */ |
||
137 | protected $rings = array(); |
||
138 | |||
139 | /** |
||
140 | * |
||
141 | * @var rings |
||
142 | */ |
||
143 | protected $objmodels = array(); |
||
144 | |||
145 | /** |
||
146 | * A-Frame Primitive box |
||
147 | * |
||
148 | * @param string $id |
||
149 | * @return Entity |
||
150 | */ |
||
151 | 11 | public function box(string $id = 'untitled'): Entity |
|
155 | |||
156 | /** |
||
157 | * A-Frame Primitive sphere |
||
158 | * |
||
159 | * @param string $id |
||
160 | * @return Entity |
||
161 | */ |
||
162 | 7 | public function sphere(string $id = 'untitled'): Entity |
|
166 | |||
167 | /** |
||
168 | * A-Frame Primitive cylinder |
||
169 | * |
||
170 | * @param string $id |
||
171 | * @return Entity |
||
172 | */ |
||
173 | 7 | public function cylinder(string $id = 'untitled'): Entity |
|
177 | |||
178 | /** |
||
179 | * A-Frame Primitive plane |
||
180 | * |
||
181 | * @param string $id |
||
182 | * @return Entity |
||
183 | */ |
||
184 | 7 | public function plane(string $id = 'untitled'): Entity |
|
188 | |||
189 | /** |
||
190 | * A-Frame Primitive camera |
||
191 | * |
||
192 | * @param string $id |
||
193 | * @return Entity |
||
194 | */ |
||
195 | 6 | public function camera(string $id = 'untitled'): Entity |
|
199 | |||
200 | /** |
||
201 | * A-Frame Primitive collada-model |
||
202 | * |
||
203 | * @param string $id |
||
204 | * @return Entity |
||
205 | */ |
||
206 | 3 | public function colladaModel(string $id = 'untitled'): Entity |
|
210 | |||
211 | /** |
||
212 | * A-Frame Primitive image |
||
213 | * |
||
214 | * @param string $id |
||
215 | * @return Entity |
||
216 | */ |
||
217 | 1 | public function image(string $id = 'untitled'): Entity |
|
221 | |||
222 | /** |
||
223 | * A-Frame Primitive light |
||
224 | * |
||
225 | * @param string $id |
||
226 | * @return Entity |
||
227 | */ |
||
228 | 6 | public function light(string $id = 'untitled'): Entity |
|
232 | |||
233 | /** |
||
234 | * A-Frame Primitive video |
||
235 | * |
||
236 | * @param string $id |
||
237 | * @return Entity |
||
238 | */ |
||
239 | 3 | public function video(string $id = 'untitled'): Entity |
|
243 | |||
244 | /** |
||
245 | * A-Frame Primitive torus |
||
246 | * |
||
247 | * @param string $id |
||
248 | * @return Entity |
||
249 | */ |
||
250 | 4 | public function torus(string $id = 'untitled'): Entity |
|
254 | |||
255 | /** |
||
256 | * A-Frame Primitive ring |
||
257 | * |
||
258 | * @param string $id |
||
259 | * @return Entity |
||
260 | */ |
||
261 | 4 | public function ring(string $id = 'untitled'): Entity |
|
265 | |||
266 | /** |
||
267 | * A-Frame Primitive sky |
||
268 | * |
||
269 | * @return Entity |
||
270 | */ |
||
271 | 7 | public function sky(): Entity |
|
275 | |||
276 | /** |
||
277 | * A-Frame Primitive sky |
||
278 | * |
||
279 | * @return Entity |
||
280 | */ |
||
281 | 3 | public function videosphere(): Entity |
|
285 | |||
286 | /** |
||
287 | * A-Frame Primitive obj model |
||
288 | * |
||
289 | * @return Entity |
||
290 | */ |
||
291 | 4 | public function objmodel(string $id = 'untitled'): Entity |
|
295 | |||
296 | /** |
||
297 | * Add all used primitevs to the scene |
||
298 | * |
||
299 | * @return void |
||
300 | */ |
||
301 | 10 | protected function preparePrimitives() |
|
320 | } |
||
321 |