reset_prev_transform legal in sub-thread

This commit is contained in:
David Rose 2006-02-10 17:23:34 +00:00
parent 4d916f59e1
commit 1f11a05ff7
4 changed files with 20 additions and 17 deletions

View File

@ -320,7 +320,7 @@ reparent_to(const NodePath &other, int sort) {
nassertv_always(!is_empty());
nassertv(other._error_type == ET_ok);
// Reparenting implicitly resents the delta vector.
// Reparenting implicitly resets the delta vector.
node()->reset_prev_transform();
bool reparented = PandaNode::reparent(other._head, _head, sort, false);

View File

@ -570,21 +570,6 @@ get_prev_transform() const {
return cdata->_prev_transform;
}
////////////////////////////////////////////////////////////////////
// Function: PandaNode::reset_prev_transform
// Access: Published
// Description: Resets the "previous" transform on this node to be
// the same as the current transform. This is not the
// same as clearing it to identity.
////////////////////////////////////////////////////////////////////
INLINE void PandaNode::
reset_prev_transform() {
nassertv(Thread::get_current_pipeline_stage() == 0);
CDWriter cdata(_cycler);
cdata->_prev_transform = cdata->_transform;
}
////////////////////////////////////////////////////////////////////
// Function: PandaNode::get_tag
// Access: Published

View File

@ -1472,6 +1472,24 @@ set_prev_transform(const TransformState *transform) {
CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
}
////////////////////////////////////////////////////////////////////
// Function: PandaNode::reset_prev_transform
// Access: Published
// Description: Resets the "previous" transform on this node to be
// the same as the current transform. This is not the
// same as clearing it to identity.
////////////////////////////////////////////////////////////////////
void PandaNode::
reset_prev_transform() {
// Apply this operation to the current stage as well as to all
// upstream stages.
OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler) {
CDStageWriter cdata(_cycler, pipeline_stage);
cdata->_prev_transform = cdata->_transform;
}
CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
}
////////////////////////////////////////////////////////////////////
// Function: PandaNode::set_tag
// Access: Published

View File

@ -163,7 +163,7 @@ PUBLISHED:
void set_prev_transform(const TransformState *transform);
INLINE const TransformState *get_prev_transform() const;
INLINE void reset_prev_transform();
void reset_prev_transform();
void set_tag(const string &key, const string &value);
INLINE string get_tag(const string &key) const;