summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-11 00:52:51 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-11 00:52:51 -0300
commitbc26f905817945300d397696330d1ab04a1af33c (patch)
treed06338399c8ea410042f6631fb3db3efcc100b05 /main
parent710692278d1353aad08bc7bceb655afc1d6c950c (diff)
Type renames:
Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
Diffstat (limited to 'main')
-rw-r--r--main/tests/test_gui.cpp2
-rw-r--r--main/tests/test_math.cpp16
-rw-r--r--main/tests/test_physics.cpp18
-rw-r--r--main/tests/test_physics_2d.cpp12
-rw-r--r--main/tests/test_render.cpp6
5 files changed, 27 insertions, 27 deletions
diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp
index bfce03d663..ab3df3b022 100644
--- a/main/tests/test_gui.cpp
+++ b/main/tests/test_gui.cpp
@@ -93,7 +93,7 @@ public:
TestCube *testcube = memnew( TestCube );
vp->add_child(testcube);
- testcube->set_transform(Transform( Matrix3().rotated(Vector3(0,1,0),Math_PI*0.25), Vector3(0,0,-8)));
+ testcube->set_transform(Transform( Basis().rotated(Vector3(0,1,0),Math_PI*0.25), Vector3(0,0,-8)));
Sprite *sp = memnew( Sprite );
sp->set_texture( vp->get_render_target_texture() );
diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp
index b3b70986c9..f3d9ddba87 100644
--- a/main/tests/test_math.cpp
+++ b/main/tests/test_math.cpp
@@ -609,19 +609,19 @@ MainLoop* test() {
float a=0.3;
//Quat q(v,a);
- Matrix3 m(v,a);
+ Basis m(v,a);
Vector3 v2(7,3,1);
v2.normalize();
float a2=0.8;
//Quat q(v,a);
- Matrix3 m2(v2,a2);
+ Basis m2(v2,a2);
Quat q=m;
Quat q2=m2;
- Matrix3 m3 = m.inverse() * m2;
+ Basis m3 = m.inverse() * m2;
Quat q3 = (q.inverse() * q2);//.normalized();
print_line(Quat(m3));
@@ -642,11 +642,11 @@ MainLoop* test() {
print_line(ret);
return NULL;
- Matrix3 m3;
+ Basis m3;
m3.rotate(Vector3(1,0,0),0.2);
m3.rotate(Vector3(0,1,0),1.77);
m3.rotate(Vector3(0,0,1),212);
- Matrix3 m32;
+ Basis m32;
m32.set_euler(m3.get_euler());
print_line("ELEULEEEEEEEEEEEEEEEEEER: "+m3.get_euler()+" vs "+m32.get_euler());
@@ -784,11 +784,11 @@ MainLoop* test() {
print_line(Variant(a));
- Matrix32 mat2_1;
+ Transform2D mat2_1;
mat2_1.rotate(0.5);
- Matrix32 mat2_2;
+ Transform2D mat2_2;
mat2_2.translate(Vector2(1,2));
- Matrix32 mat2_3 = mat2_1 * mat2_2;
+ Transform2D mat2_3 = mat2_1 * mat2_2;
mat2_3.affine_invert();
print_line(mat2_3.elements[0]);
diff --git a/main/tests/test_physics.cpp b/main/tests/test_physics.cpp
index b1a7af8dad..ea5b1cae85 100644
--- a/main/tests/test_physics.cpp
+++ b/main/tests/test_physics.cpp
@@ -351,7 +351,7 @@ public:
vs->viewport_set_scenario( viewport, scenario );
vs->camera_set_perspective(camera,60,0.1,40.0);
- vs->camera_set_transform(camera,Transform( Matrix3(), Vector3(0,9,12)));
+ vs->camera_set_transform(camera,Transform( Basis(), Vector3(0,9,12)));
//vs->scenario_set_debug(scenario,VS::SCENARIO_DEBUG_WIREFRAME);
Transform gxf;
@@ -441,7 +441,7 @@ public:
RID tribody = ps->body_create( PhysicsServer::BODY_MODE_STATIC, trimesh_shape);
- Transform tritrans = Transform( Matrix3(), Vector3(0,0,-2) );
+ Transform tritrans = Transform( Basis(), Vector3(0,0,-2) );
ps->body_set_state( tribody, PhysicsServer::BODY_STATE_TRANSFORM, tritrans );
vs->instance_set_transform( triins, tritrans );
RID trimesh_material = vs->fixed_material_create();
@@ -477,7 +477,7 @@ public:
#if 0
PhysicsServer * ps = PhysicsServer::get_singleton();
- mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Matrix3(),Vector3(0,0,-24)));
+ mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Basis(),Vector3(0,0,-24)));
RID b = create_body(PhysicsServer::SHAPE_CAPSULE,PhysicsServer::BODY_MODE_RIGID,Transform());
ps->joint_create_double_pin(b,Vector3(0,0,1.0),mover,Vector3(0,0,0));
@@ -508,17 +508,17 @@ public:
PhysicsServer * ps = PhysicsServer::get_singleton();
- mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Matrix3(),Vector3(0,0,-24)));
+ mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Basis(),Vector3(0,0,-24)));
RID b = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_RIGID,Transform());
- ps->joint_create_double_hinge(b,Transform(Matrix3(),Vector3(1,1,1.0)),mover,Transform(Matrix3(),Vector3(0,0,0)));
+ ps->joint_create_double_hinge(b,Transform(Basis(),Vector3(1,1,1.0)),mover,Transform(Basis(),Vector3(0,0,0)));
ps->body_add_collision_exception(mover,b);
/*
for(int i=0;i<20;i++) {
RID c = create_body(PhysicsServer::SHAPE_CAPSULE,PhysicsServer::BODY_MODE_RIGID,Transform());
- ps->joint_create_double_hinge(b,Transform(Matrix3(),Vector3(0,0,-0.7)),c,Transform(Matrix3(),Vector3(0,0,0.7)));
+ ps->joint_create_double_hinge(b,Transform(Basis(),Vector3(0,0,-0.7)),c,Transform(Basis(),Vector3(0,0,0.7)));
ps->body_add_collision_exception(c,b);
b=c;
}
@@ -560,7 +560,7 @@ public:
ps->body_set_force_integration_callback(character,this,"body_changed_transform",mesh_instance);
- ps->body_set_state( character, PhysicsServer::BODY_STATE_TRANSFORM,Transform(Matrix3(),Vector3(-2,5,-2)));
+ ps->body_set_state( character, PhysicsServer::BODY_STATE_TRANSFORM,Transform(Basis(),Vector3(-2,5,-2)));
bodies.push_back(character);
@@ -611,8 +611,8 @@ public:
void test_activate() {
- create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_RIGID,Transform(Matrix3(),Vector3(0,2,0)),true);
- //create_body(PhysicsServer::SHAPE_SPHERE,PhysicsServer::BODY_MODE_RIGID,Transform(Matrix3(),Vector3(0,6,0)),true);
+ create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_RIGID,Transform(Basis(),Vector3(0,2,0)),true);
+ //create_body(PhysicsServer::SHAPE_SPHERE,PhysicsServer::BODY_MODE_RIGID,Transform(Basis(),Vector3(0,6,0)),true);
create_static_plane( Plane( Vector3(0,1,0), -1) );
}
diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp
index 39b4e7edda..2074d532b1 100644
--- a/main/tests/test_physics_2d.cpp
+++ b/main/tests/test_physics_2d.cpp
@@ -51,7 +51,7 @@ class TestPhysics2DMainLoop : public MainLoop {
RID canvas;
RID ray;
RID ray_query;
- Matrix32 view_xform;
+ Transform2D view_xform;
Vector2 ray_from,ray_to;
@@ -262,7 +262,7 @@ protected:
}
}
- RID _add_body(Physics2DServer::ShapeType p_shape, const Matrix32& p_xform) {
+ RID _add_body(Physics2DServer::ShapeType p_shape, const Transform2D& p_xform) {
VisualServer *vs = VisualServer::get_singleton();
Physics2DServer *ps = Physics2DServer::get_singleton();
@@ -304,7 +304,7 @@ protected:
}
- void _add_concave(const Vector<Vector2>& p_points,const Matrix32& p_xform=Matrix32()) {
+ void _add_concave(const Vector<Vector2>& p_points,const Transform2D& p_xform=Transform2D()) {
Physics2DServer *ps = Physics2DServer::get_singleton();
VisualServer *vs = VisualServer::get_singleton();
@@ -382,7 +382,7 @@ public:
canvas = vs->canvas_create();
vs->viewport_attach_canvas(vp,canvas);
vs->viewport_attach_to_screen(vp,Rect2(Vector2(),OS::get_singleton()->get_window_size()));
- Matrix32 smaller;
+ Transform2D smaller;
//smaller.scale(Vector2(0.6,0.6));
//smaller.elements[2]=Vector2(100,0);
@@ -410,12 +410,12 @@ public:
Physics2DServer::ShapeType type = types[i%4];
// type=Physics2DServer::SHAPE_SEGMENT;
- _add_body(type,Matrix32(i*0.8,Point2(152+i*40,100-40*i)));
+ _add_body(type,Transform2D(i*0.8,Point2(152+i*40,100-40*i)));
//if (i==0)
// ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
}
- //RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Matrix32(0,Point2(101,140)));
+ //RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Transform2D(0,Point2(101,140)));
//ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC);
Point2 prev;
diff --git a/main/tests/test_render.cpp b/main/tests/test_render.cpp
index 51e1366073..3049ba7d45 100644
--- a/main/tests/test_render.cpp
+++ b/main/tests/test_render.cpp
@@ -95,7 +95,7 @@ public:
static const int s = 20;
for(int i=0;i<s;i++) {
- Matrix3 rot(Vector3(0,1,0),i*Math_PI/s);
+ Basis rot(Vector3(0,1,0),i*Math_PI/s);
for(int j=0;j<s;j++) {
Vector3 v;
@@ -179,7 +179,7 @@ public:
vs->viewport_set_active(viewport,true);
vs->viewport_attach_camera( viewport, camera );
vs->viewport_set_scenario( viewport, scenario );
- vs->camera_set_transform(camera, Transform( Matrix3(), Vector3(0,3,30 ) ) );
+ vs->camera_set_transform(camera, Transform( Basis(), Vector3(0,3,30 ) ) );
vs->camera_set_perspective( camera, 60, 0.1, 1000);
@@ -232,7 +232,7 @@ public:
for(List<InstanceInfo>::Element *E=instances.front();E;E=E->next()) {
- Transform pre( Matrix3(E->get().rot_axis, ofs), Vector3() );
+ Transform pre( Basis(E->get().rot_axis, ofs), Vector3() );
vs->instance_set_transform( E->get().instance, pre * E->get().base );
/*
if( !E->next() ) {