src/ldtypes.h

changeset 268
778eed342ee4
parent 267
95fde37e1f00
child 269
2d71227f35cb
equal deleted inserted replaced
267:95fde37e1f00 268:778eed342ee4
55 // LDMatrixObject 55 // LDMatrixObject
56 // 56 //
57 // Common code for objects with matrices 57 // Common code for objects with matrices
58 // ============================================================================= 58 // =============================================================================
59 class LDMatrixObject { 59 class LDMatrixObject {
60 PROPERTY (matrix, transform, setTransform)
61 PROPERTY (vertex, position, setPosition)
62
60 public: 63 public:
61 LDMatrixObject () {} 64 LDMatrixObject () {}
62 LDMatrixObject (const matrix& transform, const vertex& pos) : 65 LDMatrixObject (const matrix& transform, const vertex& pos) :
63 transform (transform), pos (pos) {} 66 PROP_NAME (transform) (transform), PROP_NAME (position) (pos) {}
64 67
65 matrix transform; 68 const double& setCoordinate (const Axis ax, double value) {
66 vertex pos; 69 vertex v = position ();
70 v[ax] = value;
71 setPosition (v);
72
73 return position ()[ax];
74 }
67 }; 75 };
68 76
69 // ============================================================================= 77 // =============================================================================
70 // LDObject 78 // LDObject
71 // 79 //

mercurial