1 | <?php |
||
46 | trait Primitives |
||
47 | { |
||
48 | |||
49 | /** |
||
50 | * Aframe Document Object Model |
||
51 | * |
||
52 | * @var \AframeVR\Core\DOM\AframeDOMDocument |
||
53 | */ |
||
54 | protected $aframeDomObj; |
||
55 | |||
56 | /** |
||
57 | * Sphere primitives |
||
58 | * |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $spheres = array(); |
||
62 | |||
63 | /** |
||
64 | * Box primitives |
||
65 | * |
||
66 | * @var array |
||
67 | */ |
||
68 | protected $boxes = array(); |
||
69 | |||
70 | /** |
||
71 | * Cylinder primitives |
||
72 | * |
||
73 | * @var array |
||
74 | */ |
||
75 | protected $cylinders = array(); |
||
76 | |||
77 | /** |
||
78 | * Plane primitives |
||
79 | * |
||
80 | * @var array |
||
81 | */ |
||
82 | protected $planes = array(); |
||
83 | |||
84 | /** |
||
85 | * Camera primitives |
||
86 | * |
||
87 | * @var array |
||
88 | */ |
||
89 | protected $cameras = array(); |
||
90 | |||
91 | /** |
||
92 | * collada-model primitives |
||
93 | * |
||
94 | * @var array |
||
95 | */ |
||
96 | protected $collada_models = array(); |
||
97 | |||
98 | /** |
||
99 | * |
||
100 | * @var \AframeVR\Extras\Primitives\Sky $sky |
||
101 | */ |
||
102 | protected $sky; |
||
103 | |||
104 | /** |
||
105 | * |
||
106 | * @var \AframeVR\Extras\Primitives\Videosphere $videosphere |
||
107 | */ |
||
108 | protected $videosphere; |
||
109 | |||
110 | |||
111 | /** |
||
112 | * |
||
113 | * @var array |
||
114 | */ |
||
115 | protected $images = array(); |
||
116 | |||
117 | /** |
||
118 | * |
||
119 | * @var lights |
||
120 | */ |
||
121 | protected $lights = array(); |
||
122 | |||
123 | /** |
||
124 | * |
||
125 | * @var videos |
||
126 | */ |
||
127 | protected $videos = array(); |
||
128 | |||
129 | /** |
||
130 | * |
||
131 | * @var $toruses |
||
132 | */ |
||
133 | protected $toruses = array(); |
||
134 | |||
135 | /** |
||
136 | * |
||
137 | * @var $rings |
||
138 | */ |
||
139 | protected $rings = array(); |
||
140 | |||
141 | /** |
||
142 | * |
||
143 | * @var $objmodels |
||
144 | */ |
||
145 | protected $objmodels = array(); |
||
146 | |||
147 | /** |
||
148 | * |
||
149 | * @var $curvedimages |
||
150 | */ |
||
151 | protected $curvedimages = array(); |
||
152 | |||
153 | /** |
||
154 | * |
||
155 | * @var $cones |
||
156 | */ |
||
157 | protected $cones = array(); |
||
158 | |||
159 | /** |
||
160 | * A-Frame Primitive box |
||
161 | * |
||
162 | * @param string $id |
||
163 | * @return Entity |
||
164 | */ |
||
165 | 11 | public function box(string $id = 'untitled'): Entity |
|
169 | |||
170 | /** |
||
171 | * A-Frame Primitive sphere |
||
172 | * |
||
173 | * @param string $id |
||
174 | * @return Entity |
||
175 | */ |
||
176 | 7 | public function sphere(string $id = 'untitled'): Entity |
|
180 | |||
181 | /** |
||
182 | * A-Frame Primitive cylinder |
||
183 | * |
||
184 | * @param string $id |
||
185 | * @return Entity |
||
186 | */ |
||
187 | 7 | public function cylinder(string $id = 'untitled'): Entity |
|
191 | |||
192 | /** |
||
193 | * A-Frame Primitive plane |
||
194 | * |
||
195 | * @param string $id |
||
196 | * @return Entity |
||
197 | */ |
||
198 | 7 | public function plane(string $id = 'untitled'): Entity |
|
202 | |||
203 | /** |
||
204 | * A-Frame Primitive camera |
||
205 | * |
||
206 | * @param string $id |
||
207 | * @return Entity |
||
208 | */ |
||
209 | 6 | public function camera(string $id = 'untitled'): Entity |
|
213 | |||
214 | /** |
||
215 | * A-Frame Primitive collada-model |
||
216 | * |
||
217 | * @param string $id |
||
218 | * @return Entity |
||
219 | */ |
||
220 | 3 | public function colladaModel(string $id = 'untitled'): Entity |
|
224 | |||
225 | /** |
||
226 | * A-Frame Primitive image |
||
227 | * |
||
228 | * @param string $id |
||
229 | * @return Entity |
||
230 | */ |
||
231 | 1 | public function image(string $id = 'untitled'): Entity |
|
235 | |||
236 | /** |
||
237 | * A-Frame Primitive light |
||
238 | * |
||
239 | * @param string $id |
||
240 | * @return Entity |
||
241 | */ |
||
242 | 6 | public function light(string $id = 'untitled'): Entity |
|
246 | |||
247 | /** |
||
248 | * A-Frame Primitive video |
||
249 | * |
||
250 | * @param string $id |
||
251 | * @return Entity |
||
252 | */ |
||
253 | 3 | public function video(string $id = 'untitled'): Entity |
|
257 | |||
258 | /** |
||
259 | * A-Frame Primitive torus |
||
260 | * |
||
261 | * @param string $id |
||
262 | * @return Entity |
||
263 | */ |
||
264 | 4 | public function torus(string $id = 'untitled'): Entity |
|
268 | |||
269 | /** |
||
270 | * A-Frame Primitive ring |
||
271 | * |
||
272 | * @param string $id |
||
273 | * @return Entity |
||
274 | */ |
||
275 | 4 | public function ring(string $id = 'untitled'): Entity |
|
279 | |||
280 | /** |
||
281 | * A-Frame Primitive sky |
||
282 | * |
||
283 | * @return Entity |
||
284 | */ |
||
285 | 3 | public function videosphere(): Entity |
|
289 | |||
290 | /** |
||
291 | * A-Frame Primitive obj model |
||
292 | * |
||
293 | * @return Entity |
||
294 | */ |
||
295 | 4 | public function objmodel(string $id = 'untitled'): Entity |
|
299 | |||
300 | /** |
||
301 | * A-Frame Primitive curvedimage |
||
302 | * |
||
303 | * @return Entity |
||
304 | */ |
||
305 | 3 | public function curvedimage(string $id = 'untitled'): Entity |
|
309 | |||
310 | /** |
||
311 | * A-Frame Primitive curvedimage |
||
312 | * |
||
313 | * @return Entity |
||
314 | */ |
||
315 | 2 | public function cone(string $id = 'untitled'): Entity |
|
319 | |||
320 | |||
321 | /** |
||
322 | * A-Frame Primitive sky |
||
323 | * |
||
324 | * @return Entity |
||
325 | */ |
||
326 | 7 | public function sky(): Entity |
|
330 | |||
331 | |||
332 | /** |
||
333 | * Add all used primitevs to the scene |
||
334 | * |
||
335 | * @return void |
||
336 | */ |
||
337 | 10 | protected function preparePrimitives() |
|
358 | } |
||
359 |