|
1
|
|
|
<?php |
|
2
|
|
|
/** @formatter:off |
|
3
|
|
|
* ****************************************************************** |
|
4
|
|
|
* Created by Marko Kungla on Jul 8, 2016 - 3:16:33 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 Cone.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
|
|
|
final class Cone extends Entity implements EntityInterface |
|
30
|
|
|
{ |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* <a-cone> |
|
34
|
|
|
* |
|
35
|
|
|
* The cone primitive creates a cone shape. It is an entity that prescribes the geometry with its geometric |
|
36
|
|
|
* primitive set to cone. |
|
37
|
|
|
* |
|
38
|
|
|
* @return void |
|
39
|
|
|
*/ |
|
40
|
3 |
|
public function reset() |
|
41
|
|
|
{ |
|
42
|
3 |
|
parent::reset(); |
|
43
|
3 |
|
$this->component('Geometry')->primitive('cone'); |
|
44
|
3 |
|
} |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* geometry.height |
|
48
|
|
|
* |
|
49
|
|
|
* @param int $height |
|
50
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
51
|
|
|
*/ |
|
52
|
2 |
|
public function height(int $height) |
|
|
|
|
|
|
53
|
|
|
{ |
|
54
|
2 |
|
$this->component('Geometry')->height(1); |
|
55
|
2 |
|
return $this; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* geometry.openEnded |
|
60
|
|
|
* |
|
61
|
|
|
* @param bool $open_ended |
|
62
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
63
|
|
|
*/ |
|
64
|
2 |
|
public function openEnded(bool $open_ended) |
|
65
|
|
|
{ |
|
66
|
2 |
|
$this->component('Geometry')->openEnded($open_ended); |
|
67
|
2 |
|
return $this; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* geometry.radiusBottom |
|
72
|
|
|
* |
|
73
|
|
|
* @param float $radius |
|
74
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
75
|
|
|
*/ |
|
76
|
2 |
|
public function radiusBottom(float $radius) |
|
77
|
|
|
{ |
|
78
|
2 |
|
$this->component('Geometry')->radiusBottom($radius); |
|
79
|
2 |
|
return $this; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* geometry.radiusTop |
|
84
|
|
|
* |
|
85
|
|
|
* @param float $radius |
|
86
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
87
|
|
|
*/ |
|
88
|
2 |
|
public function radiusTop(float $radius) |
|
89
|
|
|
{ |
|
90
|
2 |
|
$this->component('Geometry')->radiusTop($radius); |
|
91
|
2 |
|
return $this; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* geometry.segmentsHeight |
|
96
|
|
|
* |
|
97
|
|
|
* @param int $s_height |
|
98
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
99
|
|
|
*/ |
|
100
|
2 |
|
public function segmentsHeight(int $s_height) |
|
101
|
|
|
{ |
|
102
|
2 |
|
$this->component('Geometry')->segmentsHeight($s_height); |
|
103
|
2 |
|
return $this; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* geometry.segmentsRadial |
|
108
|
|
|
* |
|
109
|
|
|
* @param in $s_radial |
|
|
|
|
|
|
110
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
111
|
|
|
*/ |
|
112
|
2 |
|
public function segmentsRadial(int $s_radial) |
|
113
|
|
|
{ |
|
114
|
2 |
|
$this->component('Geometry')->segmentsRadial($s_radial); |
|
115
|
2 |
|
return $this; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
/** |
|
119
|
|
|
* geometry.thetaLength |
|
120
|
|
|
* |
|
121
|
|
|
* @param float $t_lenght |
|
122
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
123
|
|
|
*/ |
|
124
|
2 |
|
public function thetaLength(float $t_lenght) |
|
|
|
|
|
|
125
|
|
|
{ |
|
126
|
2 |
|
$this->component('Geometry')->thetaLength(360); |
|
127
|
2 |
|
return $this; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* geometry.thetaStart |
|
132
|
|
|
* |
|
133
|
|
|
* @param float $t_start |
|
134
|
|
|
* @return \AframeVR\Extras\Primitives\Cone |
|
135
|
|
|
*/ |
|
136
|
2 |
|
public function thetaStart(float $t_start) |
|
|
|
|
|
|
137
|
|
|
{ |
|
138
|
2 |
|
$this->component('Geometry')->thetaStart(0); |
|
139
|
2 |
|
return $this; |
|
140
|
|
|
} |
|
141
|
|
|
} |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.