|
| 1 | +// Filename: qpfindApproxLevelEntry.I |
| 2 | +// Created by: drose (13Mar02) |
| 3 | +// |
| 4 | +//////////////////////////////////////////////////////////////////// |
| 5 | +// |
| 6 | +// PANDA 3D SOFTWARE |
| 7 | +// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved |
| 8 | +// |
| 9 | +// All use of this software is subject to the terms of the Panda 3d |
| 10 | +// Software license. You should have received a copy of this license |
| 11 | +// along with this source code; you will also find a current copy of |
| 12 | +// the license at http://www.panda3d.org/license.txt . |
| 13 | +// |
| 14 | +// To contact the maintainers of this program write to |
| 15 | +// panda3d@yahoogroups.com . |
| 16 | +// |
| 17 | +//////////////////////////////////////////////////////////////////// |
| 18 | + |
| 19 | + |
| 20 | +//////////////////////////////////////////////////////////////////// |
| 21 | +// Function: qpFindApproxLevelEntry::Constructor |
| 22 | +// Access: Public |
| 23 | +// Description: |
| 24 | +//////////////////////////////////////////////////////////////////// |
| 25 | +INLINE qpFindApproxLevelEntry:: |
| 26 | +qpFindApproxLevelEntry(const qpNodePath &node_path, qpFindApproxPath &approx_path) : |
| 27 | + _node_path(node_path), |
| 28 | + _approx_path(approx_path) |
| 29 | +{ |
| 30 | + _i = 0; |
| 31 | +} |
| 32 | + |
| 33 | +//////////////////////////////////////////////////////////////////// |
| 34 | +// Function: qpFindApproxLevelEntry::Copy Constructor |
| 35 | +// Access: Public |
| 36 | +// Description: |
| 37 | +//////////////////////////////////////////////////////////////////// |
| 38 | +INLINE qpFindApproxLevelEntry:: |
| 39 | +qpFindApproxLevelEntry(const qpFindApproxLevelEntry ©) : |
| 40 | + _node_path(copy._node_path), |
| 41 | + _i(copy._i), |
| 42 | + _approx_path(copy._approx_path) |
| 43 | +{ |
| 44 | +} |
| 45 | + |
| 46 | +//////////////////////////////////////////////////////////////////// |
| 47 | +// Function: qpFindApproxLevelEntry::Copy Assignment Operator |
| 48 | +// Access: Public |
| 49 | +// Description: |
| 50 | +//////////////////////////////////////////////////////////////////// |
| 51 | +INLINE void qpFindApproxLevelEntry:: |
| 52 | +operator = (const qpFindApproxLevelEntry ©) { |
| 53 | + _node_path = copy._node_path; |
| 54 | + _i = copy._i; |
| 55 | + nassertv(&_approx_path == ©._approx_path); |
| 56 | +} |
| 57 | + |
| 58 | + |
| 59 | +//////////////////////////////////////////////////////////////////// |
| 60 | +// Function: qpFindApproxLevelEntry::next_is_stashed |
| 61 | +// Access: Public |
| 62 | +// Description: Returns true if the next node matched by this entry |
| 63 | +// must be a stashed node, false otherwise. |
| 64 | +//////////////////////////////////////////////////////////////////// |
| 65 | +INLINE bool qpFindApproxLevelEntry:: |
| 66 | +next_is_stashed() const { |
| 67 | + return _approx_path.matches_stashed(_i); |
| 68 | +} |
| 69 | + |
| 70 | +//////////////////////////////////////////////////////////////////// |
| 71 | +// Function: qpFindApproxLevelEntry::is_solution |
| 72 | +// Access: Public |
| 73 | +// Description: Returns true if this entry represents a solution to |
| 74 | +// the search; i.e. all the components of the path have |
| 75 | +// been successfully matched. |
| 76 | +//////////////////////////////////////////////////////////////////// |
| 77 | +INLINE bool qpFindApproxLevelEntry:: |
| 78 | +is_solution() const { |
| 79 | + return (_i >= _approx_path.get_num_components()); |
| 80 | +} |
0 commit comments