Panda3D

clientBase.I

00001 // Filename: clientBase.I
00002 // Created by:  drose (25Jan01)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: ClientBase::is_forked
00019 //       Access: Public
00020 //  Description: Returns true if the ClientBase has been forked (and,
00021 //               therefore, poll() does not need to be called), false
00022 //               otherwise.
00023 ////////////////////////////////////////////////////////////////////
00024 INLINE bool ClientBase::
00025 is_forked() const {
00026   return _forked;
00027 }
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: ClientBase::poll
00031 //       Access: Public
00032 //  Description: Initiates a poll of the client devices, if we are not
00033 //               forked and if we have not already polled this frame.
00034 //               Returns true if the poll occurred, or false if it did
00035 //               not.
00036 ////////////////////////////////////////////////////////////////////
00037 INLINE bool ClientBase::
00038 poll() {
00039   if (_forked ||
00040       _last_poll_frame == ClockObject::get_global_clock()->get_frame_count()) {
00041     return false;
00042   }
00043 
00044   do_poll();
00045   return true;
00046 }
00047 
00048 ////////////////////////////////////////////////////////////////////
00049 //     Function: ClientBase::get_last_poll_time
00050 //       Access: Public
00051 //  Description: Returns the time (according to the global
00052 //               ClockObject's get_real_time() method) of the last
00053 //               device poll.
00054 ////////////////////////////////////////////////////////////////////
00055 INLINE double ClientBase::
00056 get_last_poll_time() const {
00057   return _last_poll_time;
00058 }
00059 
00060 ////////////////////////////////////////////////////////////////////
00061 //     Function: ClientBase::set_coordinate_system
00062 //       Access: Published
00063 //  Description: Specifies the coordinate system that all devices
00064 //               associated with this client will operate in.
00065 //               Normally, this is CS_default.
00066 ////////////////////////////////////////////////////////////////////
00067 void ClientBase::
00068 set_coordinate_system(CoordinateSystem cs) {
00069   _cs = cs;
00070 }
00071 
00072 ////////////////////////////////////////////////////////////////////
00073 //     Function: ClientBase::get_coordinate_system
00074 //       Access: Published
00075 //  Description: Returns the coordinate system that all devices
00076 //               associated with this client will operate in.
00077 //               Normally, this is CS_default.
00078 ////////////////////////////////////////////////////////////////////
00079 INLINE CoordinateSystem ClientBase::
00080 get_coordinate_system() const {
00081   return _cs;
00082 }
 All Classes Functions Variables Enumerations