|
From: <axl...@us...> - 2009-06-03 01:22:27
|
Revision: 301
http://hgengine.svn.sourceforge.net/hgengine/?rev=301&view=rev
Author: axlecrusher
Date: 2009-06-03 01:22:25 +0000 (Wed, 03 Jun 2009)
Log Message:
-----------
construct from string
Modified Paths:
--------------
Mercury2/src/MercuryVertex.cpp
Mercury2/src/MercuryVertex.h
Modified: Mercury2/src/MercuryVertex.cpp
===================================================================
--- Mercury2/src/MercuryVertex.cpp 2009-06-01 00:17:40 UTC (rev 300)
+++ Mercury2/src/MercuryVertex.cpp 2009-06-03 01:22:25 UTC (rev 301)
@@ -121,6 +121,14 @@
return (q * MQuaternion(0, *this) * q.reciprocal()).ToVector();
}
+MercuryVertex MercuryVertex::CreateFromString(const MString& s)
+{
+ float x,y,z;
+ sscanf(s.c_str(), "%f,%f,%f", &x, &y, &z);
+ return MercuryVertex(x,y,z);
+}
+
+
/****************************************************************************
* Copyright (C) 2009 by Joshua Allen *
* *
Modified: Mercury2/src/MercuryVertex.h
===================================================================
--- Mercury2/src/MercuryVertex.h 2009-06-01 00:17:40 UTC (rev 300)
+++ Mercury2/src/MercuryVertex.h 2009-06-03 01:22:25 UTC (rev 301)
@@ -83,6 +83,8 @@
void Print(const MString& s = "Vertex") const;
MercuryVertex Rotate(const MQuaternion& q) const;
+
+ static MercuryVertex CreateFromString(const MString& s);
// float (*this)[3];
FloatRow m_xyzw;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|