Changeset 241 for cpp/frams/vm


Ignore:
Timestamp:
05/07/14 20:39:52 (11 years ago)
Author:
Maciej Komosinski
Message:

Added toString() and angles representation to Orient

Location:
cpp/frams/vm/classes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/classes/3dobject.cpp

    r240 r241  
    217217static ParamEntry paramtab[]=
    218218{
    219 {"Orient",1,27,"Orient","3D orientation, stored as 3x3 matrix."},
     219{"Orient",1,29,"Orient","3D orientation, stored as 3x3 matrix."},
    220220
    221221{"xx",1,PARAM_NOSTATIC,"orientation.x.x","f",FIELD(o.x.x),},
     
    259259{"localToWorld",0,PARAM_NOSTATIC,"transform coordinates","p oXYZ(oXYZ point,oXYZ center)",PROCEDURE(p_localToWorld),},
    260260{"worldToLocal",0,PARAM_NOSTATIC,"transform coordinates","p oXYZ(oXYZ point,oXYZ center)",PROCEDURE(p_worldToLocal),},
     261{"angles",0,PARAM_READONLY | PARAM_NOSTATIC,"Euler angles representation","oXYZ",GETONLY(angles),},
     262{"toString",0,PARAM_READONLY | PARAM_NOSTATIC,"textual form","s",GETONLY(toString),},
    261263{0,0,0,},
    262264};
     
    433435else
    434436        ret->setEmpty();
     437}
     438
     439void Orient_Ext::get_angles(ExtValue *ret)
     440{
     441*ret=Pt3D_Ext::makeDynamicObject(new Pt3D_Ext(o.getAngles()));
     442}
     443
     444void Orient_Ext::get_toString(ExtValue *ret)
     445{
     446Pt3D a=o.getAngles();
     447ret->setString(SString::sprintf("Orient@(%g,%g,%g)",a.x,a.y,a.z));
    435448}
    436449
  • cpp/frams/vm/classes/3dobject.h

    r229 r241  
    7171PARAMPROCDEF(p_localToWorld);
    7272PARAMPROCDEF(p_worldToLocal);
     73PARAMGETDEF(angles);
    7374#undef STATRICKCLASS
    7475
Note: See TracChangeset for help on using the changeset viewer.