1
|
|
|
<?php |
2
|
|
|
/** @formatter:off |
3
|
|
|
* ****************************************************************** |
4
|
|
|
* Created by Marko Kungla on Jun 27, 2016 - 5:45:05 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 RingMethods.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\Core\Components\Geometry\Methods; |
25
|
|
|
|
26
|
|
|
class RingMethods |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* Radius of the inner hole of the ring. |
30
|
|
|
* |
31
|
|
|
* @param array $dom_attributes |
32
|
|
|
* @param double $radiusInner |
33
|
|
|
* @return void |
34
|
|
|
*/ |
35
|
5 |
|
public function radiusInner(array &$dom_attributes, float $radiusInner) |
36
|
|
|
{ |
37
|
5 |
|
$dom_attributes['radiusInner'] = $radiusInner; |
38
|
5 |
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Radius of the outer edge of the ring. |
42
|
|
|
* |
43
|
|
|
* @param array $dom_attributes |
44
|
|
|
* @param double $radiusOuter |
45
|
|
|
* @return void |
46
|
|
|
*/ |
47
|
5 |
|
public function radiusOuter(array &$dom_attributes, float $radiusOuter) |
48
|
|
|
{ |
49
|
5 |
|
$dom_attributes['radiusOuter'] = $radiusOuter; |
50
|
5 |
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Central angle in degrees. |
54
|
|
|
* |
55
|
|
|
* @param array $dom_attributes |
56
|
|
|
* @param double $thetaLength |
57
|
|
|
* @return void |
58
|
|
|
*/ |
59
|
3 |
|
public function thetaLength(array &$dom_attributes, float $thetaLength) |
60
|
|
|
{ |
61
|
3 |
|
$dom_attributes['thetaLength'] = $thetaLength; |
62
|
3 |
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Starting angle in degrees. |
66
|
|
|
* |
67
|
|
|
* @param array $dom_attributes |
68
|
|
|
* @param double $thetaStart |
69
|
|
|
* @return void |
70
|
|
|
*/ |
71
|
3 |
|
public function thetaStart(array &$dom_attributes, float $thetaStart) |
72
|
|
|
{ |
73
|
3 |
|
$dom_attributes['thetaStart'] = $thetaStart; |
74
|
3 |
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Number of segments. |
78
|
|
|
* A higher number means the ring will be more round. |
79
|
|
|
* |
80
|
|
|
* @param array $dom_attributes |
81
|
|
|
* @param int $segmentsTheta |
82
|
|
|
* @return void |
83
|
|
|
*/ |
84
|
5 |
|
public function segmentsTheta(array &$dom_attributes, int $segmentsTheta) |
85
|
|
|
{ |
86
|
5 |
|
$dom_attributes['segmentsTheta'] = $segmentsTheta; |
87
|
5 |
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Number of triangles within each face defined by segmentsTheta. |
91
|
|
|
* |
92
|
|
|
* @param array $dom_attributes |
93
|
|
|
* @param int $segmentsPhi |
94
|
|
|
* @return void |
95
|
|
|
*/ |
96
|
3 |
|
public function segmentsPhi(array &$dom_attributes, int $segmentsPhi) |
97
|
|
|
{ |
98
|
3 |
|
$dom_attributes['segmentsPhi'] = $segmentsPhi; |
99
|
3 |
|
} |
100
|
|
|
} |
101
|
|
|
|