|
1
|
|
|
<?php |
|
2
|
|
|
/** @formatter:off |
|
3
|
|
|
* ****************************************************************** |
|
4
|
|
|
* Created by Marko Kungla on Jul 9, 2016 - 2:53:15 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 Circle.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 Circle extends Entity implements EntityInterface |
|
30
|
|
|
{ |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Init <a-circle> |
|
34
|
|
|
* |
|
35
|
|
|
* @return void |
|
36
|
|
|
*/ |
|
37
|
2 |
|
public function reset() |
|
38
|
|
|
{ |
|
39
|
2 |
|
parent::reset(); |
|
40
|
2 |
|
$this->component('Geometry')->primitive('circle'); |
|
41
|
2 |
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* geometry.radius |
|
45
|
|
|
* |
|
46
|
|
|
* @param float $radius |
|
47
|
|
|
* @return \AframeVR\Extras\Primitives\Circle |
|
48
|
|
|
*/ |
|
49
|
2 |
|
public function radius(float $radius) |
|
50
|
|
|
{ |
|
51
|
2 |
|
$this->component('Geometry')->radius($radius); |
|
52
|
2 |
|
return $this; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* geometry.segments |
|
57
|
|
|
* |
|
58
|
|
|
* @param int $segments |
|
|
|
|
|
|
59
|
|
|
* @return \AframeVR\Extras\Primitives\Circle |
|
60
|
|
|
*/ |
|
61
|
2 |
|
public function segments(float $segments) |
|
62
|
|
|
{ |
|
63
|
2 |
|
$this->component('Geometry')->segments($segments); |
|
64
|
2 |
|
return $this; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* geometry.thetaLength |
|
69
|
|
|
* |
|
70
|
|
|
* @param float $theta_length |
|
71
|
|
|
* @return \AframeVR\Extras\Primitives\Circle |
|
72
|
|
|
*/ |
|
73
|
2 |
|
public function thetaLength(float $theta_length) |
|
74
|
|
|
{ |
|
75
|
2 |
|
$this->component('Geometry')->thetaLength($theta_length); |
|
76
|
2 |
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* geometry.thetaStart |
|
81
|
|
|
* |
|
82
|
|
|
* @param int $theta_start |
|
|
|
|
|
|
83
|
|
|
* @return \AframeVR\Extras\Primitives\Circle |
|
84
|
|
|
*/ |
|
85
|
2 |
|
public function thetaStart(float $theta_start) |
|
86
|
|
|
{ |
|
87
|
2 |
|
$this->component('Geometry')->thetaStart($theta_start); |
|
88
|
2 |
|
return $this; |
|
89
|
|
|
} |
|
90
|
|
|
} |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.