This repository was archived by the owner on Mar 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPhysics.html
More file actions
101 lines (98 loc) · 3.65 KB
/
Physics.html
File metadata and controls
101 lines (98 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
The static global Physics class allows you cast shapes to find a <a href="http://berserk-games.com/knowledgebase/object">Object</a> and change the gravity. For example, <font face="monospace">Physics.setGravity({0, -20, 0}).
<a class="anchor" name="Functions"></a>
<table width="100%">
<caption><strong><h3>Functions</h3></strong></caption>
<tr>
<th class="table_column_rv">Return Value</th>
<th class="table_column_fn">Function Name</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">cast(Table Info)</font></td>
<td><a class="anchor" name="cast"></a>Casts a shape based on Info and returns a table of multiple Hit.
<br/><h3>Info</h3>
<table>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>origin</td>
<td>The start point of the cast.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>direction</td>
<td>The direction of the cast.</td>
</tr>
<tr>
<td>int</td>
<td>type</td>
<td>The type of cast. 1 = Ray, 2 = Sphere, 3 = Box.</td>
<tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>size</td>
<td>The size of the cast. Only used for Sphere and Box.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>orientation</td>
<td>The rotation of the cast. Only used for Box.
</tr>
<tr>
<td>float</td>
<td>max_distance</td>
<td>The distance the ray will cast. If not supplied it will be infinity.</td>
</tr>
<tr>
<td>bool</td>
<td>debug</td>
<td>Visualize the cast with this debug bool set to true.</td>
</tr>
</table>
<br/><h3>Hit</h3>
<table>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>point</td>
<td>The position the cast impact.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>normal</td>
<td>The surface normal of the impact point.</td>
</tr>
<tr>
<td>float</td>
<td>distance</td>
<td>The distance between the cast origin and the impact point.</td>
<tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/object">Object</a></td>
<td>hit_object</td>
<td>The object hit by the cast.</td>
</tr>
</table></td>
</tr>
<tr>
<td><font face="monospace"><a href="http://berserk-games.com/knowledgebase/vector">Vector</a>
</font></td>
<td><font face="monospace">getGravity()</font></td>
<td><a class="anchor" name="getGravity"></a>Returns the gravity <a href="http://berserk-games.com/knowledgebase/vector">Vector</a>.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">setGravity(<a href="http://berserk-games.com/knowledgebase/vector">Vector</a>
)</font></td>
<td><a class="anchor" name="setGravity"></a>Sets the gravity <a href="http://berserk-games.com/knowledgebase/vector">Vector</a>.</td>
</tr>
</table>