|
Revision 11034, 1.9 kB
(checked in by robert, 3 years ago)
|
|
Build fixes for build without ref_ptr<> automatic type conversion
|
| Rev | Line | |
|---|
| [11009] | 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #include <osgAnimation/StackedTransform> |
|---|
| 16 | |
|---|
| 17 | using namespace osgAnimation; |
|---|
| 18 | |
|---|
| 19 | StackedTransform::StackedTransform() {} |
|---|
| 20 | |
|---|
| 21 | StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co) |
|---|
| 22 | { |
|---|
| 23 | reserve(rhs.size()); |
|---|
| 24 | for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it) |
|---|
| 25 | { |
|---|
| [11034] | 26 | const StackedTransformElement* element = it->get(); |
|---|
| [11009] | 27 | if (element) |
|---|
| 28 | push_back(osg::clone(element,co)); |
|---|
| 29 | } |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | void StackedTransform::update() |
|---|
| 34 | { |
|---|
| 35 | int dirty = 0; |
|---|
| 36 | for (StackedTransform::iterator it = begin(); it != end(); ++it) |
|---|
| 37 | { |
|---|
| 38 | |
|---|
| [11034] | 39 | StackedTransformElement* element = it->get(); |
|---|
| [11009] | 40 | if (!element) |
|---|
| 41 | continue; |
|---|
| 42 | |
|---|
| 43 | element->update(); |
|---|
| 44 | if (element->isIdentity()) |
|---|
| 45 | continue; |
|---|
| 46 | dirty++; |
|---|
| 47 | } |
|---|
| 48 | if (!dirty) |
|---|
| 49 | return; |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | _matrix.makeIdentity(); |
|---|
| 54 | for (StackedTransform::iterator it = begin(); it != end(); ++it) |
|---|
| 55 | { |
|---|
| [11034] | 56 | StackedTransformElement* element = it->get(); |
|---|
| [11009] | 57 | if (!element || element->isIdentity()) |
|---|
| 58 | continue; |
|---|
| 59 | element->applyToMatrix(_matrix); |
|---|
| 60 | } |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | const osg::Matrix& StackedTransform::getMatrix() const |
|---|
| 64 | { |
|---|
| 65 | return _matrix; |
|---|
| 66 | } |
|---|