00001 // Filename: animChannelMatrixXfmTable.I 00002 // Created by: drose (21Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Function: AnimChannelMatrixXfmTable::is_valid_id 00022 // Access: Public, Static 00023 // Description: Returns true if the given letter is one of the nine 00024 // valid table id's. 00025 //////////////////////////////////////////////////////////////////// 00026 INLINE bool AnimChannelMatrixXfmTable:: 00027 is_valid_id(char table_id) { 00028 return get_table_index(table_id) >= 0; 00029 } 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: AnimChannelMatrixXfmTable::has_table 00033 // Access: Public 00034 // Description: Returns true if the indicated subtable has been 00035 // assigned. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE bool AnimChannelMatrixXfmTable:: 00038 has_table(char table_id) const { 00039 int table_index = get_table_index(table_id); 00040 if (table_index < 0) { 00041 return false; 00042 } 00043 return !(_tables[table_index] == (const float *)NULL); 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: AnimChannelMatrixXfmTable::get_table 00048 // Access: Public 00049 // Description: Returns a pointer to the indicated subtable's data, 00050 // if it exists, or NULL if it does not. 00051 //////////////////////////////////////////////////////////////////// 00052 INLINE CPTA_float AnimChannelMatrixXfmTable:: 00053 get_table(char table_id) const { 00054 int table_index = get_table_index(table_id); 00055 if (table_index < 0) { 00056 return CPTA_float(); 00057 } 00058 return _tables[table_index]; 00059 } 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: AnimChannelMatrixXfmTable::clear_table 00063 // Access: Public 00064 // Description: Removes the indicated table from the definition. 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE void AnimChannelMatrixXfmTable:: 00067 clear_table(char table_id) { 00068 int table_index = get_table_index(table_id); 00069 if (table_index >= 0) { 00070 _tables[table_index] = NULL; 00071 } 00072 } 00073 00074 00075 //////////////////////////////////////////////////////////////////// 00076 // Function: AnimChannelMatrixXfmTable::get_table_id 00077 // Access: Protected, Static 00078 // Description: Returns the table ID associated with the indicated 00079 // table index number. This is the letter 'i', 'j', 00080 // 'k', 'h', 'p', 'r', 'x', 'y', or 'z'. 00081 //////////////////////////////////////////////////////////////////// 00082 INLINE char AnimChannelMatrixXfmTable:: 00083 get_table_id(int table_index) { 00084 return _table_ids[table_index]; 00085 } 00086 00087 00088 //////////////////////////////////////////////////////////////////// 00089 // Function: AnimChannelMatrixXfmTable::get_default_value 00090 // Access: Protected, Static 00091 // Description: Returns the default value the indicated table is 00092 // expected to have in the absence of any data. 00093 //////////////////////////////////////////////////////////////////// 00094 INLINE float AnimChannelMatrixXfmTable:: 00095 get_default_value(int table_index) { 00096 return _default_values[table_index]; 00097 } 00098