| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- // Filename: onOffTransition.I
- // Created by: drose (20Mar00)
- //
- ////////////////////////////////////////////////////////////////////
- //
- // PANDA 3D SOFTWARE
- // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
- //
- // All use of this software is subject to the terms of the Panda 3d
- // Software license. You should have received a copy of this license
- // along with this source code; you will also find a current copy of
- // the license at http://www.panda3d.org/license.txt .
- //
- // To contact the maintainers of this program write to
- // [email protected] .
- //
- ////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::Constructor
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH OnOffTransition::
- OnOffTransition(TransitionDirection direction) {
- _direction = direction;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::Copy Constructor
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH OnOffTransition::
- OnOffTransition(const OnOffTransition ©) :
- NodeTransition(copy),
- _direction(copy._direction)
- {
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::Copy Assignment Operator
- // Access: Public
- // Description:
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH void OnOffTransition::
- operator = (const OnOffTransition ©) {
- NodeTransition::operator = (copy);
- _direction = copy._direction;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::set_identity
- // Access: Public
- // Description: Changes the transition to an identity transition;
- // this has no effect on the attribute for any nodes at
- // this point and below.
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH void OnOffTransition::
- set_identity() {
- _direction = TD_identity;
- state_changed();
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::set_on
- // Access: Public
- // Description: Changes the transition to an 'on' transition;
- // this turns on the attribute for all nodes at this
- // point and below. However, this particular function
- // does not change the attribute value itself, and is
- // thus only appropriate for derived transition types
- // that do not actually carry an attribute value.
- // Derived types that *do* have an attribute value
- // should override this function to accept a value
- // parameter of the appropriate type.
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH void OnOffTransition::
- set_on() {
- _direction = TD_on;
- state_changed();
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::set_off
- // Access: Public
- // Description: Changes the transition to an 'off' transition; this
- // turns off the attribute for all nodes at this point
- // and below.
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH void OnOffTransition::
- set_off() {
- _direction = TD_off;
- state_changed();
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::is_identity
- // Access: Public
- // Description: Returns true if this is the identity transition,
- // false otherwise.
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH bool OnOffTransition::
- is_identity() const {
- return _direction == TD_identity;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::is_on
- // Access: Public
- // Description: Returns true if this transition is 'on', false
- // otherwise. If the derived transition type carries a
- // value, it should define a get_value() function which
- // allows you to query the on value.
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH bool OnOffTransition::
- is_on() const {
- return _direction == TD_on;
- }
- ////////////////////////////////////////////////////////////////////
- // Function: OnOffTransition::is_off
- // Access: Public
- // Description: Returns true if this transition is the 'off'
- // transition, false otherwise.
- ////////////////////////////////////////////////////////////////////
- INLINE_GRAPH bool OnOffTransition::
- is_off() const {
- return _direction == TD_off;
- }
|