00001 // Filename: clientBase.I 00002 // Created by: drose (25Jan01) 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 //////////////////////////////////////////////////////////////////// 00022 // Function: ClientBase::is_forked 00023 // Access: Public 00024 // Description: Returns true if the ClientBase has been forked (and, 00025 // therefore, poll() does not need to be called), false 00026 // otherwise. 00027 //////////////////////////////////////////////////////////////////// 00028 INLINE bool ClientBase:: 00029 is_forked() const { 00030 return _forked; 00031 } 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Function: ClientBase::poll 00035 // Access: Public 00036 // Description: Initiates a poll of the client devices, if we are not 00037 // forked and if we have not already polled this frame. 00038 // Returns true if the poll occurred, or false if it did 00039 // not. 00040 //////////////////////////////////////////////////////////////////// 00041 INLINE bool ClientBase:: 00042 poll() { 00043 if (_forked || 00044 _last_poll_frame == ClockObject::get_global_clock()->get_frame_count()) { 00045 return false; 00046 } 00047 00048 do_poll(); 00049 return true; 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: ClientBase::get_last_poll_time 00054 // Access: Public 00055 // Description: Returns the time (according to the global 00056 // ClockObject's get_real_time() method) of the last 00057 // device poll. 00058 //////////////////////////////////////////////////////////////////// 00059 INLINE double ClientBase:: 00060 get_last_poll_time() const { 00061 return _last_poll_time; 00062 } 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: ClientBase::set_coordinate_system 00066 // Access: Published 00067 // Description: Specifies the coordinate system that all devices 00068 // associated with this client will operate in. 00069 // Normally, this is CS_default. 00070 //////////////////////////////////////////////////////////////////// 00071 void ClientBase:: 00072 set_coordinate_system(CoordinateSystem cs) { 00073 _cs = cs; 00074 } 00075 00076 //////////////////////////////////////////////////////////////////// 00077 // Function: ClientBase::get_coordinate_system 00078 // Access: Published 00079 // Description: Returns the coordinate system that all devices 00080 // associated with this client will operate in. 00081 // Normally, this is CS_default. 00082 //////////////////////////////////////////////////////////////////// 00083 INLINE CoordinateSystem ClientBase:: 00084 get_coordinate_system() const { 00085 return _cs; 00086 }