Changeset 825
- Timestamp:
- 11/25/18 20:10:31 (6 years ago)
- Location:
- cpp/frams/vm/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/classes/3dobject.cpp
r343 r825 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-201 5Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2018 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 93 93 } 94 94 95 SString Pt3D_Ext::toString() const 96 { 97 SString s = "("; 98 s += SString::valueOf(p.x); 99 s += ","; 100 s += SString::valueOf(p.y); 101 s += ","; 102 s += SString::valueOf(p.z); 103 s += ")"; 104 return s; 105 } 106 95 107 void Pt3D_Ext::get_toString(ExtValue *ret) 96 108 { 97 SString s = "("; 98 ExtValue v; 99 v.setDouble(p.x); s += v.getString(); 100 s += ","; 101 v.setDouble(p.y); s += v.getString(); 102 s += ","; 103 v.setDouble(p.z); s += v.getString(); 104 s += ")"; 105 ret->setString(s); 109 ret->setString(toString()); 106 110 } 107 111 … … 174 178 { 175 179 int index = args->getInt(); 176 if ((index < 0) || (index >2))180 if ((index < 0) || (index > 2)) 177 181 ret->setEmpty(); 178 182 else … … 184 188 #ifdef __CODEGUARD__ 185 189 static Pt3D_Ext static_pt3dobj; 186 static Param static_pt3dparam(getStaticParamtab(), &static_pt3dobj);190 static Param static_pt3dparam(getStaticParamtab(), &static_pt3dobj); 187 191 #else 188 192 static Param static_pt3dparam(getStaticParamtab()); … … 378 382 { 379 383 double q1 = args[0].getDouble(), q2 = 1.0 - q1; 380 o.x.x = q1 *o1->o.x.x + q2*o2->o.x.x;381 o.x.y = q1 *o1->o.x.y + q2*o2->o.x.y;382 o.x.z = q1 *o1->o.x.z + q2*o2->o.x.z;383 o.y.x = q1 *o1->o.y.x + q2*o2->o.y.x;384 o.y.y = q1 *o1->o.y.y + q2*o2->o.y.y;385 o.y.z = q1 *o1->o.y.z + q2*o2->o.y.z;386 o.z.x = q1 *o1->o.z.x + q2*o2->o.z.x;387 o.z.y = q1 *o1->o.z.y + q2*o2->o.z.y;388 o.z.z = q1 *o1->o.z.z + q2*o2->o.z.z;384 o.x.x = q1 * o1->o.x.x + q2 * o2->o.x.x; 385 o.x.y = q1 * o1->o.x.y + q2 * o2->o.x.y; 386 o.x.z = q1 * o1->o.x.z + q2 * o2->o.x.z; 387 o.y.x = q1 * o1->o.y.x + q2 * o2->o.y.x; 388 o.y.y = q1 * o1->o.y.y + q2 * o2->o.y.y; 389 o.y.z = q1 * o1->o.y.z + q2 * o2->o.y.z; 390 o.z.x = q1 * o1->o.z.x + q2 * o2->o.z.x; 391 o.z.y = q1 * o1->o.z.y + q2 * o2->o.z.y; 392 o.z.z = q1 * o1->o.z.z + q2 * o2->o.z.z; 389 393 o.normalize(); 390 394 } … … 399 403 { 400 404 double q1 = args[0].getDouble(), q2 = 1.0 - q1; 401 o.x.x = q1 *o1->o.x.x + q2*p2->p.x;402 o.x.y = q1 *o1->o.x.y + q2*p2->p.y;403 o.x.z = q1 *o1->o.x.z + q2*p2->p.z;405 o.x.x = q1 * o1->o.x.x + q2 * p2->p.x; 406 o.x.y = q1 * o1->o.x.y + q2 * p2->p.y; 407 o.x.z = q1 * o1->o.x.z + q2 * p2->p.z; 404 408 o.normalize(); 405 409 } … … 448 452 void Orient_Ext::get_toString(ExtValue *ret) 449 453 { 450 Pt3D a = o.getAngles();451 ret->setString(SString ::sprintf("Orient@(%g,%g,%g)", a.x, a.y, a.z));454 Pt3D_Ext a(o.getAngles()); 455 ret->setString(SString("Orient@") + a.toString()); 452 456 } 453 457 … … 456 460 #ifdef __CODEGUARD__ 457 461 static Orient_Ext static_orientobj; 458 static Param static_orientparam(getStaticParamtab(), &static_orientobj);462 static Param static_orientparam(getStaticParamtab(), &static_orientobj); 459 463 #else 460 464 static Param static_orientparam(getStaticParamtab()); -
cpp/frams/vm/classes/3dobject.h
r343 r825 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-201 5Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2018 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 34 34 PARAMPROCDEF(p_get); 35 35 #undef STATRICKCLASS 36 36 SString toString() const; 37 37 static ParamInterface* getInterface(); 38 38 static ExtObject makeStaticObject(Pt3D* p);
Note: See TracChangeset
for help on using the changeset viewer.