1
|
|
|
<?php |
2
|
|
|
/** @formatter:off |
3
|
|
|
* ****************************************************************** |
4
|
|
|
* Created by Marko Kungla on Jun 21, 2016 - 11:58:54 AM |
5
|
|
|
* Contact [email protected] |
6
|
|
|
* @copyright 2016 Marko Kungla - https://github.com/mkungla |
7
|
|
|
* @license The MIT License (MIT) |
8
|
|
|
* |
9
|
|
|
* @category AframeVR |
10
|
|
|
* @package aframe-php |
11
|
|
|
* |
12
|
|
|
* Lang PHP (php version >= 7) |
13
|
|
|
* Encoding UTF-8 |
14
|
|
|
* File Box.php |
15
|
|
|
* Code format PSR-2 and 12 |
16
|
|
|
* @link https://github.com/mkungla/aframe-php |
17
|
|
|
* @issues https://github.com/mkungla/aframe-php/issues |
18
|
|
|
* ******************************************************************** |
19
|
|
|
* Contributors: |
20
|
|
|
* @author Marko Kungla <[email protected]> |
21
|
|
|
* ******************************************************************** |
22
|
|
|
* Comments: |
23
|
|
|
* @formatter:on */ |
24
|
|
|
namespace AframeVR\Extras\Primitives; |
25
|
|
|
|
26
|
|
|
use \AframeVR\Core\Entity; |
27
|
|
|
use \AframeVR\Interfaces\EntityInterface; |
28
|
|
|
|
29
|
|
|
class Box extends Entity implements EntityInterface |
30
|
|
|
{ |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* Init <a-box> |
34
|
|
|
* |
35
|
|
|
* The box primitive, formerly called <a-cube>, creates shapes such as boxes, cubes, or walls. It is an entity that |
36
|
|
|
* prescribes the geometry with its geometric primitive set to box. |
37
|
|
|
* |
38
|
|
|
* @return void |
39
|
|
|
*/ |
40
|
8 |
|
public function reset() |
41
|
|
|
{ |
42
|
8 |
|
parent::reset(); |
43
|
8 |
|
$this->component('Geometry')->primitive('box'); |
44
|
8 |
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* geometry.depth |
48
|
|
|
* |
49
|
|
|
* @param float $depth |
50
|
|
|
* @return \AframeVR\Extras\Primitives\Box |
51
|
|
|
*/ |
52
|
2 |
|
public function depth(float $depth) |
53
|
|
|
{ |
54
|
2 |
|
$this->component('Geometry')->depth($depth); |
55
|
2 |
|
return $this; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* geometry.height |
60
|
|
|
* |
61
|
|
|
* @param float $height |
62
|
|
|
* @return \AframeVR\Extras\Primitives\Box |
63
|
|
|
*/ |
64
|
2 |
|
public function height(float $height) |
65
|
|
|
{ |
66
|
2 |
|
$this->component('Geometry')->height($height); |
67
|
2 |
|
return $this; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* geometry.width |
72
|
|
|
* |
73
|
|
|
* @param float $height |
|
|
|
|
74
|
|
|
* @return \AframeVR\Extras\Primitives\Box |
75
|
|
|
*/ |
76
|
2 |
|
public function width(float $width) |
77
|
|
|
{ |
78
|
2 |
|
$this->component('Geometry')->width($width); |
79
|
2 |
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Optional: geometry.segmentsHeight |
84
|
|
|
* |
85
|
|
|
* @param int $height |
86
|
|
|
* @return \AframeVR\Extras\Primitives\Box |
87
|
|
|
*/ |
88
|
2 |
|
public function segmentsHeight(int $height) |
89
|
|
|
{ |
90
|
2 |
|
$this->component('Geometry')->segmentsHeight($height); |
91
|
2 |
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* Optional: geometry.segmentsWidth |
96
|
|
|
* |
97
|
|
|
* @param int $width |
98
|
|
|
* @return \AframeVR\Extras\Primitives\Box |
99
|
|
|
*/ |
100
|
2 |
|
public function segmentsWidth(int $width) |
101
|
|
|
{ |
102
|
2 |
|
$this->component('Geometry')->segmentsWidth($width); |
103
|
2 |
|
return $this; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Optional: geometry.segmentsDepth |
108
|
|
|
* |
109
|
|
|
* @param int $depth |
110
|
|
|
* @return \AframeVR\Extras\Primitives\Box |
111
|
|
|
*/ |
112
|
2 |
|
public function segmentsDepth(int $depth) |
113
|
|
|
{ |
114
|
2 |
|
$this->component('Geometry')->segmentsDepth($depth); |
115
|
2 |
|
return $this; |
116
|
|
|
} |
117
|
|
|
} |
118
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.