From fcdbce98291d581d4e39636fe6851d5ec7439bce Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 30 Sep 2009 03:25:10 +0000 Subject: [PATCH] finished addPlane() git-svn-id: svn://anubis/misc/OdeWorld@155 bd8a9e45-a331-0410-811e-c64571078777 --- OdeWorld.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OdeWorld.cc b/OdeWorld.cc index e20897e..149d210 100644 --- a/OdeWorld.cc +++ b/OdeWorld.cc @@ -204,8 +204,18 @@ dGeomID OdeWorld::addPlane(const string & name, bool static_data, { if (args.size() != 6) return 0; - float a, b, c, d; - /* TODO: find a, b, c, d from args */ + + dMatrix3 r; + dRFromEulerAngles(r, args[3], args[4], args[5]); + dVector3 default_plane_direction = {0, 0, 1, 0}; + dVector3 rotated_plane_direction; + dMultiply0(rotated_plane_direction, default_plane_direction, r, 1, 3, 3); + + float a = rotated_plane_direction[0]; + float b = rotated_plane_direction[1]; + float c = rotated_plane_direction[2]; + float d = a * args[0] + b * args[1] + c * args[2]; + dGeomID id = dCreatePlane(m_space, a, b, c, d); return id; }