add clear_transform

This commit is contained in:
David Rose 2003-11-06 04:51:08 +00:00
parent de8c2d0de3
commit 28aba7f1a6
2 changed files with 24 additions and 0 deletions

View File

@ -458,6 +458,16 @@ get_transform() const {
return node()->get_transform();
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::clear_transform
// Access: Published
// Description: Sets the transform object on this node to identity.
////////////////////////////////////////////////////////////////////
INLINE void NodePath::
clear_transform() {
set_transform(TransformState::make_identity());
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::set_transform
// Access: Published
@ -469,6 +479,18 @@ set_transform(const TransformState *transform) {
node()->set_transform(transform);
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::clear_transform
// Access: Published
// Description: Sets the transform object on this node to identity,
// relative to the other node. This effectively places
// this node at the same position as the other node.
////////////////////////////////////////////////////////////////////
INLINE void NodePath::
clear_transform(const NodePath &other) {
set_transform(other, TransformState::make_identity());
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::get_net_transform
// Access: Published

View File

@ -238,8 +238,10 @@ PUBLISHED:
INLINE CPT(RenderState) get_net_state() const;
INLINE const TransformState *get_transform() const;
INLINE void clear_transform();
INLINE void set_transform(const TransformState *transform);
CPT(TransformState) get_transform(const NodePath &other) const;
INLINE void clear_transform(const NodePath &other);
void set_transform(const NodePath &other, const TransformState *transform);
INLINE CPT(TransformState) get_net_transform() const;