|
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\Core\Helpers\MeshAttributes; |
|
28
|
|
|
use \AframeVR\Interfaces\PrimitiveInterface; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* <a-cone> |
|
32
|
|
|
* |
|
33
|
|
|
* The cone primitive creates a cone shape. It is an entity that prescribes the geometry with its geometric primitive |
|
34
|
|
|
* set to cone. |
|
35
|
|
|
*/ |
|
36
|
|
|
final class Cone extends Entity implements PrimitiveInterface |
|
37
|
|
|
{ |
|
38
|
|
|
|
|
39
|
|
|
use MeshAttributes; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Selector to obj |
|
43
|
|
|
* |
|
44
|
|
|
* Selector to an <a-asset-item> pointing to a .OBJ file or an inline path to a .OBJ file. |
|
45
|
|
|
* |
|
46
|
|
|
* @return ObjModelPrimitiveIF |
|
|
|
|
|
|
47
|
|
|
*/ |
|
48
|
3 |
|
public function init() |
|
49
|
|
|
{ |
|
50
|
3 |
|
$this->component('Geometry')->primitive('cone'); |
|
51
|
3 |
|
$this->component('Geometry')->height(1); |
|
52
|
3 |
|
$this->component('Geometry')->openEnded(false); |
|
53
|
3 |
|
$this->component('Geometry')->radiusBottom(1); |
|
54
|
3 |
|
$this->component('Geometry')->radiusTop(.8); |
|
55
|
3 |
|
$this->component('Geometry')->segmentsHeight(18); |
|
56
|
3 |
|
$this->component('Geometry')->segmentsRadial(36); |
|
57
|
3 |
|
$this->component('Geometry')->thetaLength(360); |
|
58
|
3 |
|
$this->component('Geometry')->thetaStart(0); |
|
59
|
3 |
|
return $this; |
|
60
|
|
|
} |
|
61
|
|
|
} |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.