1
|
|
|
<?php |
2
|
|
|
/** @formatter:off |
3
|
|
|
* ****************************************************************** |
4
|
|
|
* Created by Marko Kungla on Jun 27, 2016 - 4:21:09 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 BoxMethods.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 BoxMethods |
27
|
|
|
{ |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* The box primitive defines boxes (i.e., any quadilateral, not just cubes). |
31
|
|
|
*/ |
32
|
|
|
const DEFAULTS = array( |
33
|
|
|
/* Width (in meters) of the sides on the X axis. */ |
34
|
|
|
'width' => 1, |
35
|
|
|
/* Height (in meters) of the sides on the Y axis. */ |
36
|
|
|
'height' => 1, |
37
|
|
|
/* Depth (in meters) of the sides on the Z axis. */ |
38
|
|
|
'depth' => 1 |
39
|
|
|
); |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Depth (in meters) of the sides on the Z axis. |
43
|
|
|
* |
44
|
|
|
* @param array $dom_attributes |
45
|
|
|
* @param double $depth |
46
|
|
|
* @return void |
47
|
|
|
*/ |
48
|
6 |
|
public function depth(array &$dom_attributes, float $depth) |
49
|
|
|
{ |
50
|
6 |
|
$dom_attributes['depth'] = $depth; |
51
|
6 |
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Height (in meters) of the sides on the Y axis. |
55
|
|
|
* |
56
|
|
|
* @param array $dom_attributes |
57
|
|
|
* @param double $height |
58
|
|
|
* @return void |
59
|
|
|
*/ |
60
|
7 |
|
public function height(array &$dom_attributes, float $height) |
61
|
|
|
{ |
62
|
7 |
|
$dom_attributes['height'] = $height; |
63
|
7 |
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Width (in meters) of the sides on the X axis. |
67
|
|
|
* |
68
|
|
|
* @param array $dom_attributes |
69
|
|
|
* @param double $width |
70
|
|
|
* @return void |
71
|
|
|
*/ |
72
|
7 |
|
public function width(array &$dom_attributes, float $width) |
73
|
|
|
{ |
74
|
7 |
|
$dom_attributes['width'] = $width; |
75
|
7 |
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* segmentsHeight |
79
|
|
|
* |
80
|
|
|
* @param array $dom_attributes |
81
|
|
|
* @param number $int |
|
|
|
|
82
|
|
|
*/ |
83
|
|
|
public function segmentsHeight(array &$dom_attributes, $int = 0) |
84
|
|
|
{ |
85
|
|
|
$dom_attributes['segmentsHeight'] = $int; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* segmentsWidth |
90
|
|
|
* |
91
|
|
|
* @param array $dom_attributes |
92
|
|
|
* @param number $int |
|
|
|
|
93
|
|
|
*/ |
94
|
|
|
public function segmentsWidth(array &$dom_attributes, $int = 0) |
95
|
|
|
{ |
96
|
|
|
$dom_attributes['segmentsWidth'] = $int; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* segmentsDepth |
101
|
|
|
* |
102
|
|
|
* @param array $dom_attributes |
103
|
|
|
* @param number $int |
|
|
|
|
104
|
|
|
*/ |
105
|
|
|
public function segmentsDepth(array &$dom_attributes, $int = 0) |
106
|
|
|
{ |
107
|
|
|
$dom_attributes['segmentsDepth'] = $int; |
108
|
|
|
} |
109
|
|
|
} |
110
|
|
|
|