Skip to content

Commit e3f4b0f

Browse files
committed
Added test resources and changed test asset path
1 parent 22cd4a4 commit e3f4b0f

55 files changed

Lines changed: 1580 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Tests/Runtime/OpenPLXTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace AGXUnityTesting.Runtime
1313
[TestFixture]
1414
public class OpenPLXTests
1515
{
16-
private string TestDataFolder => "Assets/Tests/";
16+
private string TestDataFolder => "Assets/AGXUnity/Tests/Runtime/Test Resources";
1717
private T FindComponentByName<T>( string name ) where T : MonoBehaviour
1818
{
1919
var go = GameObject.Find(name);
@@ -112,7 +112,7 @@ public IEnumerator TestImportAndMove()
112112
{
113113
yield return TestUtils.WaitUntilLoaded();
114114

115-
var openPLXObj = OpenPLXImporter.ImportOpenPLXFile<GameObject>("Assets/Tests/LinearSpringTest.openplx");
115+
var openPLXObj = OpenPLXImporter.ImportOpenPLXFile<GameObject>(TestDataFolder + "/LinearSpringTest.openplx");
116116

117117
openPLXObj.name = "Imported OpenPLX Object";
118118
openPLXObj.transform.position = new Vector3( 30, 0, 3 );
@@ -470,9 +470,9 @@ public IEnumerator TestMCAngularVelocitySignal()
470470
[Test]
471471
public void TestImportVisualMaterial()
472472
{
473-
var material = OpenPLXImporter.ImportOpenPLXFile<Material>( "Assets/Tests/visual_mat.openplx" );
473+
var material = OpenPLXImporter.ImportOpenPLXFile<Material>( TestDataFolder + "/visual_mat.openplx" );
474474

475-
byte[] data = System.IO.File.ReadAllBytes("Assets/Tests/simple_checkerboard.png");
475+
byte[] data = System.IO.File.ReadAllBytes( TestDataFolder + "/simple_checkerboard.png");
476476
var groundTruthTexture = new Texture2D(2, 2);
477477
ImageConversion.LoadImage( groundTruthTexture, data );
478478

@@ -489,8 +489,8 @@ public void TestImportVisualMaterial()
489489
[Test]
490490
public void TestBundleDirectory()
491491
{
492-
OpenPLXSettings.Instance.AdditionalBundleDirs.Add( "Assets/Tests/TestBundle" );
493-
var dependant = OpenPLXImporter.ImportOpenPLXFile<GameObject>("Assets/Tests/use_test_bundle.openplx");
492+
OpenPLXSettings.Instance.AdditionalBundleDirs.Add( TestDataFolder + "/TestBundle" );
493+
var dependant = OpenPLXImporter.ImportOpenPLXFile<GameObject>( TestDataFolder + "/use_test_bundle.openplx" );
494494

495495
Assert.NotNull( dependant );
496496
}

Tests/Runtime/Test Resources.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Blender MTL File: 'None'
2+
# Material Count: 1
3+
4+
newmtl None
5+
Ns 500
6+
Ka 0.8 0.8 0.8
7+
Kd 0.8 0.8 0.8
8+
Ks 0.8 0.8 0.8
9+
d 1
10+
illum 2

Tests/Runtime/Test Resources/Icosahedron.mtl.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Blender v3.2.0 OBJ File: ''
2+
# www.blender.org
3+
mtllib Icosahedron.mtl
4+
o Icosphere
5+
v 0.000000 -1.000000 0.000000
6+
v 0.723600 -0.447215 0.525720
7+
v -0.276385 -0.447215 0.850640
8+
v -0.894425 -0.447215 0.000000
9+
v -0.276385 -0.447215 -0.850640
10+
v 0.723600 -0.447215 -0.525720
11+
v 0.276385 0.447215 0.850640
12+
v -0.723600 0.447215 0.525720
13+
v -0.723600 0.447215 -0.525720
14+
v 0.276385 0.447215 -0.850640
15+
v 0.894425 0.447215 0.000000
16+
v 0.000000 1.000000 0.000000
17+
vt 0.181819 0.000000
18+
vt 0.272728 0.157461
19+
vt 0.090910 0.157461
20+
vt 0.363637 0.000000
21+
vt 0.454546 0.157461
22+
vt 0.909091 0.000000
23+
vt 1.000000 0.157461
24+
vt 0.818182 0.157461
25+
vt 0.727273 0.000000
26+
vt 0.636364 0.157461
27+
vt 0.545455 0.000000
28+
vt 0.363637 0.314921
29+
vt 0.181819 0.314921
30+
vt 0.909091 0.314921
31+
vt 0.727273 0.314921
32+
vt 0.545455 0.314921
33+
vt 0.000000 0.314921
34+
vt 0.272728 0.472382
35+
vt 0.090910 0.472382
36+
vt 0.818182 0.472382
37+
vt 0.636364 0.472382
38+
vt 0.454546 0.472382
39+
vn 0.1876 -0.7947 0.5774
40+
vn 0.6071 -0.7947 0.0000
41+
vn -0.4911 -0.7947 0.3568
42+
vn -0.4911 -0.7947 -0.3568
43+
vn 0.1876 -0.7947 -0.5774
44+
vn 0.9822 -0.1876 0.0000
45+
vn 0.3035 -0.1876 0.9342
46+
vn -0.7946 -0.1876 0.5774
47+
vn -0.7946 -0.1876 -0.5774
48+
vn 0.3035 -0.1876 -0.9342
49+
vn 0.7946 0.1876 0.5774
50+
vn -0.3035 0.1876 0.9342
51+
vn -0.9822 0.1876 0.0000
52+
vn -0.3035 0.1876 -0.9342
53+
vn 0.7946 0.1876 -0.5774
54+
vn 0.4911 0.7947 0.3568
55+
vn -0.1876 0.7947 0.5774
56+
vn -0.6071 0.7947 0.0000
57+
vn -0.1876 0.7947 -0.5774
58+
vn 0.4911 0.7947 -0.3568
59+
usemtl None
60+
s off
61+
f 1/1/1 2/2/1 3/3/1
62+
f 2/2/2 1/4/2 6/5/2
63+
f 1/6/3 3/7/3 4/8/3
64+
f 1/9/4 4/8/4 5/10/4
65+
f 1/11/5 5/10/5 6/5/5
66+
f 2/2/6 6/5/6 11/12/6
67+
f 3/3/7 2/2/7 7/13/7
68+
f 4/8/8 3/7/8 8/14/8
69+
f 5/10/9 4/8/9 9/15/9
70+
f 6/5/10 5/10/10 10/16/10
71+
f 2/2/11 11/12/11 7/13/11
72+
f 3/3/12 7/13/12 8/17/12
73+
f 4/8/13 8/14/13 9/15/13
74+
f 5/10/14 9/15/14 10/16/14
75+
f 6/5/15 10/16/15 11/12/15
76+
f 7/13/16 11/12/16 12/18/16
77+
f 8/17/17 7/13/17 12/19/17
78+
f 9/15/18 8/14/18 12/20/18
79+
f 10/16/19 9/15/19 12/21/19
80+
f 11/12/20 10/16/20 12/22/20

Tests/Runtime/Test Resources/Icosahedron.obj.meta

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Rod is Physics3D.Bodies.RigidBody:
3+
inertia.mass: 10
4+
geometry is Physics3D.Charges.Box:
5+
size: Math.Vec3.from_xyz(0.1, 0.1, 1)
6+
arrow is Physics3D.Charges.Box:
7+
local_transform:
8+
position.z: 0.5
9+
rotation: Math.Quat.angle_axis(Math.PI / 4, Math.Vec3.Y_AXIS())
10+
size: Math.Vec3.from_xyz(0.071, 0.1, 0.071)
11+
input_connector is Physics3D.Charges.MateConnector:
12+
position.z: -geometry.size.z * 0.5
13+
main_axis: -Math.Vec3.Z_AXIS()
14+
normal: -Math.Vec3.Y_AXIS()
15+
16+
FallingRod is Physics3D.System:
17+
rod1 is Rod
18+
prismatic is Physics3D.Interactions.Prismatic:
19+
initial_position: -0.25
20+
external_range is Physics3D.Interactions.LinearRange:
21+
start: -0.5
22+
end: 0
23+
charges: prismatic.charges
24+
25+
FallingRodScene is Physics3D.System:
26+
world_connector is Physics3D.Charges.MateConnector:
27+
main_axis: Math.Vec3.Z_AXIS()
28+
normal: Math.Vec3.Y_AXIS()
29+
30+
falling_rod is FallingRod:
31+
prismatic.charges: [ world_connector, falling_rod.rod1.input_connector ]

Tests/Runtime/Test Resources/LinearRangeTest.openplx.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
Rod is Physics3D.Bodies.RigidBody:
3+
inertia.mass: 10
4+
geometry is Physics3D.Charges.Box:
5+
size: Math.Vec3.from_xyz(0.1, 0.1, 1)
6+
arrow is Physics3D.Charges.Box:
7+
local_transform:
8+
position.z: 0.5
9+
rotation: Math.Quat.angle_axis(Math.PI / 4, Math.Vec3.Y_AXIS())
10+
size: Math.Vec3.from_xyz(0.071, 0.1, 0.071)
11+
input_connector is Physics3D.Charges.MateConnector:
12+
position.z: -geometry.size.z * 0.5
13+
main_axis: -Math.Vec3.Z_AXIS()
14+
normal: -Math.Vec3.Y_AXIS()
15+
16+
FallingRod is Physics3D.System:
17+
rod1 is Rod
18+
prismatic is Physics3D.Interactions.Prismatic:
19+
initial_position: -0.25
20+
external_spring is Physics3D.Interactions.LinearSpring:
21+
force_output.enabled: true
22+
min_effort: -200
23+
max_effort: 200
24+
charges: prismatic.charges
25+
26+
FallingRodScene is Physics3D.System:
27+
world_connector is Physics3D.Charges.MateConnector:
28+
main_axis: Math.Vec3.Z_AXIS()
29+
normal: Math.Vec3.Y_AXIS()
30+
31+
falling_rod is FallingRod:
32+
prismatic.charges: [ world_connector, falling_rod.rod1.input_connector ]

Tests/Runtime/Test Resources/LinearSpringTest.openplx.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)