FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
UnrealEnginePython/tests/test_transform.py at master · TheRealityMachine/UnrealEnginePython · GitHub
TheRealityMachine
UnrealEnginePython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
UnrealEnginePython
/
tests
/
test_transform.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (29 loc) · 1.15 KB
Breadcrumbs
UnrealEnginePython
/
tests
/
test_transform.py
Copy path
File metadata and controls
39 lines (29 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
unittest
import
unreal_engine
as
ue
from
unreal_engine
import
FVector
,
FRotator
,
FTransform
class
TestVector
(
unittest
.
TestCase
):
def
test_add
(
self
):
vector0
=
FVector
(
1
,
2
,
3
)
vector1
=
FVector
(
4
,
5
,
6
)
self
.
assertEqual
(
vector0
+
vector1
,
FVector
(
5
,
7
,
9
))
def
test_add_negative
(
self
):
vector0
=
FVector
(
1
,
2
,
3
)
vector1
=
FVector
(
-
4
,
-
5
,
-
6
)
self
.
assertEqual
(
vector0
+
vector1
,
FVector
(
-
3
,
-
3
,
-
3
))
def
test_scale
(
self
):
vector0
=
FVector
(
1
,
2
,
-
3
)
self
.
assertEqual
(
vector0
*
2
,
FVector
(
2
,
4
,
-
6
))
class
TestRotator
(
unittest
.
TestCase
):
def
test_roll_pitch_yaw
(
self
):
rotator0
=
FRotator
(
10
,
20
,
30
)
self
.
assertEqual
(
rotator0
.
roll
,
10
)
self
.
assertEqual
(
rotator0
.
pitch
,
20
)
self
.
assertEqual
(
rotator0
.
yaw
,
30
)
class
TestTransform
(
unittest
.
TestCase
):
def
test_default_values
(
self
):
transform0
=
FTransform
()
self
.
assertEqual
(
transform0
.
translation
,
FVector
(
0
,
0
,
0
))
self
.
assertEqual
(
transform0
.
rotation
.
roll
,
0
)
self
.
assertEqual
(
transform0
.
rotation
.
pitch
,
0
)
self
.
assertEqual
(
transform0
.
rotation
.
yaw
,
0
)
self
.
assertEqual
(
transform0
.
scale
,
FVector
(
1
,
1
,
1
))
Back
|
FazBrowse Home
|
New Git URL