Panda3D
Loading...
Searching...
No Matches
clientBase.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file clientBase.I
10 * @author drose
11 * @date 2001-01-25
12 */
13
14/**
15 * Returns true if the ClientBase has been forked (and, therefore, poll() does
16 * not need to be called), false otherwise.
17 */
18INLINE bool ClientBase::
19is_forked() const {
20 return _forked;
21}
22
23/**
24 * Initiates a poll of the client devices, if we are not forked and if we have
25 * not already polled this frame. Returns true if the poll occurred, or false
26 * if it did not.
27 */
28INLINE bool ClientBase::
29poll() {
30 if (_forked ||
31 _last_poll_frame == ClockObject::get_global_clock()->get_frame_count()) {
32 return false;
33 }
34
35 do_poll();
36 return true;
37}
38
39/**
40 * Returns the time (according to the global ClockObject's get_real_time()
41 * method) of the last device poll.
42 */
43INLINE double ClientBase::
44get_last_poll_time() const {
45 return _last_poll_time;
46}
47
48/**
49 * Specifies the coordinate system that all devices associated with this
50 * client will operate in. Normally, this is CS_default.
51 */
53set_coordinate_system(CoordinateSystem cs) {
54 _cs = cs;
55}
56
57/**
58 * Returns the coordinate system that all devices associated with this client
59 * will operate in. Normally, this is CS_default.
60 */
61INLINE CoordinateSystem ClientBase::
63 return _cs;
64}
bool is_forked() const
Returns true if the ClientBase has been forked (and, therefore, poll() does not need to be called),...
Definition clientBase.I:19
void set_coordinate_system(CoordinateSystem cs)
Specifies the coordinate system that all devices associated with this client will operate in.
Definition clientBase.I:53
bool poll()
Initiates a poll of the client devices, if we are not forked and if we have not already polled this f...
Definition clientBase.I:29
CoordinateSystem get_coordinate_system() const
Returns the coordinate system that all devices associated with this client will operate in.
Definition clientBase.I:62
double get_last_poll_time() const
Returns the time (according to the global ClockObject's get_real_time() method) of the last device po...
Definition clientBase.I:44
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.