Completed
Push — master ( 44e5f7...e8b22d )
by Marko
9s
created

Cone   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 26
ccs 11
cts 11
cp 1
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 13 1
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
0 ignored issues
show
Documentation introduced by
Should the return type not be Cone?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
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
}