SmoothMover

from panda3d.direct import SmoothMover
class SmoothMover

Bases: DTOOL_SUPER_BASE

This class handles smoothing of sampled motion points over time, e.g. for smoothing the apparent movement of remote avatars, whose positions are sent via occasional telemetry updates.

It can operate in any of three modes: off, in which it does not smooth any motion but provides the last position it was told; smoothing only, in which it smooths motion information but never tries to anticipate where the avatar might be going; or full prediction, in which it smooths motion as well as tries to predict the avatar’s position in lead of the last position update. The assumption is that all SmoothMovers in the world will be operating in the same mode together.

Inheritance diagram

Inheritance diagram of SmoothMover

PMOff = 0
PMOn = 1
PM_off = 0
PM_on = 1
SMOff = 0
SMOn = 1
SM_off = 0
SM_on = 1
__init__(*args, **kwargs)
applySmoothHpr()

C++ Interface: apply_smooth_hpr(SmoothMover self, NodePath node)

/**
  • Applies the smoothed orientation to the indicated NodePath. This is

  • equivalent to calling node.set_hpr(smooth_mover->get_smooth_hpr()). It

  • exists as an optimization only, to avoid the overhead of passing the return

  • value through Python.

*/

applySmoothPos()

C++ Interface: apply_smooth_pos(SmoothMover self, NodePath node)

/**
  • Applies the smoothed position to the indicated NodePath. This is

  • equivalent to calling node.set_pos(smooth_mover->get_smooth_pos()). It

  • exists as an optimization only, to avoid the overhead of passing the return

  • value through Python.

*/

applySmoothPosHpr()

C++ Interface: apply_smooth_pos_hpr(SmoothMover self, NodePath pos_node, NodePath hpr_node)

/**
  • Applies the smoothed position and orientation to the indicated NodePath.

  • This is equivalent to calling

  • node.set_pos_hpr(smooth_mover->get_smooth_pos(),

  • smooth_mover->get_smooth_hpr()). It exists as an optimization only, to

  • avoid the overhead of passing the return value through Python.

*/

apply_smooth_hpr()

C++ Interface: apply_smooth_hpr(SmoothMover self, NodePath node)

/**
  • Applies the smoothed orientation to the indicated NodePath. This is

  • equivalent to calling node.set_hpr(smooth_mover->get_smooth_hpr()). It

  • exists as an optimization only, to avoid the overhead of passing the return

  • value through Python.

*/

apply_smooth_pos()

C++ Interface: apply_smooth_pos(SmoothMover self, NodePath node)

/**
  • Applies the smoothed position to the indicated NodePath. This is

  • equivalent to calling node.set_pos(smooth_mover->get_smooth_pos()). It

  • exists as an optimization only, to avoid the overhead of passing the return

  • value through Python.

*/

apply_smooth_pos_hpr()

C++ Interface: apply_smooth_pos_hpr(SmoothMover self, NodePath pos_node, NodePath hpr_node)

/**
  • Applies the smoothed position and orientation to the indicated NodePath.

  • This is equivalent to calling

  • node.set_pos_hpr(smooth_mover->get_smooth_pos(),

  • smooth_mover->get_smooth_hpr()). It exists as an optimization only, to

  • avoid the overhead of passing the return value through Python.

*/

clearPositions()

C++ Interface: clear_positions(const SmoothMover self, bool reset_velocity)

/**
  • Erases all the old position reports. This should be done, for instance,

  • prior to teleporting the avatar to a new position; otherwise, the smoother

  • might try to lerp the avatar there. If reset_velocity is true, the

  • velocity is also reset to 0.

*/

clear_positions()

C++ Interface: clear_positions(const SmoothMover self, bool reset_velocity)

/**
  • Erases all the old position reports. This should be done, for instance,

  • prior to teleporting the avatar to a new position; otherwise, the smoother

  • might try to lerp the avatar there. If reset_velocity is true, the

  • velocity is also reset to 0.

*/

computeAndApplySmoothHpr()

C++ Interface: compute_and_apply_smooth_hpr(const SmoothMover self, NodePath hpr_node)

/**
  • A further optimization to reduce Python calls. This computes the smooth

  • position and applies it to the indicated node or nodes in one call. The

  • pos_node and hpr_node might be the same NodePath.

*/

computeAndApplySmoothPos()

C++ Interface: compute_and_apply_smooth_pos(const SmoothMover self, NodePath node)

/**
  • A further optimization to reduce Python calls. This computes the smooth

  • position and applies it to the indicated node in one call.

*/

computeAndApplySmoothPosHpr()

C++ Interface: compute_and_apply_smooth_pos_hpr(const SmoothMover self, NodePath pos_node, NodePath hpr_node)

/**
  • A further optimization to reduce Python calls. This computes the smooth

  • position and applies it to the indicated node or nodes in one call. The

  • pos_node and hpr_node might be the same NodePath.

*/

computeSmoothPosition()

C++ Interface: compute_smooth_position(const SmoothMover self) compute_smooth_position(const SmoothMover self, double timestamp)

/**
  • Computes the smoothed position (and orientation) of the mover at the

  • indicated point in time, based on the previous position reports. After

  • this call has been made, get_smooth_pos() etc. may be called to retrieve

  • the smoothed position.

  • With no parameter, the function uses ClockObject::get_frame_time() as the

  • default time.

*/

/**
  • Computes the smoothed position (and orientation) of the mover at the

  • indicated point in time, based on the previous position reports. After

  • this call has been made, get_smooth_pos() etc. may be called to retrieve

  • the smoothed position.

  • The return value is true if the value has changed (or might have changed)

  • since the last call to compute_smooth_position(), or false if it remains

  • the same.

*/

compute_and_apply_smooth_hpr()

C++ Interface: compute_and_apply_smooth_hpr(const SmoothMover self, NodePath hpr_node)

/**
  • A further optimization to reduce Python calls. This computes the smooth

  • position and applies it to the indicated node or nodes in one call. The

  • pos_node and hpr_node might be the same NodePath.

*/

compute_and_apply_smooth_pos()

C++ Interface: compute_and_apply_smooth_pos(const SmoothMover self, NodePath node)

/**
  • A further optimization to reduce Python calls. This computes the smooth

  • position and applies it to the indicated node in one call.

*/

compute_and_apply_smooth_pos_hpr()

C++ Interface: compute_and_apply_smooth_pos_hpr(const SmoothMover self, NodePath pos_node, NodePath hpr_node)

/**
  • A further optimization to reduce Python calls. This computes the smooth

  • position and applies it to the indicated node or nodes in one call. The

  • pos_node and hpr_node might be the same NodePath.

*/

compute_smooth_position()

C++ Interface: compute_smooth_position(const SmoothMover self) compute_smooth_position(const SmoothMover self, double timestamp)

/**
  • Computes the smoothed position (and orientation) of the mover at the

  • indicated point in time, based on the previous position reports. After

  • this call has been made, get_smooth_pos() etc. may be called to retrieve

  • the smoothed position.

  • With no parameter, the function uses ClockObject::get_frame_time() as the

  • default time.

*/

/**
  • Computes the smoothed position (and orientation) of the mover at the

  • indicated point in time, based on the previous position reports. After

  • this call has been made, get_smooth_pos() etc. may be called to retrieve

  • the smoothed position.

  • The return value is true if the value has changed (or might have changed)

  • since the last call to compute_smooth_position(), or false if it remains

  • the same.

*/

getAcceptClockSkew()

C++ Interface: get_accept_clock_skew(const SmoothMover self)

/**
  • Returns the current state of the ‘accept clock skew’ flag. See

  • set_accept_clock_skew().

*/

getDefaultToStandingStill()

C++ Interface: get_default_to_standing_still(const SmoothMover self)

/**
  • Returns the current state of the ‘default to standing still’ flag. See

  • set_default_to_standing_still().

*/

getDelay()

C++ Interface: get_delay(const SmoothMover self)

/**
  • Returns the amount of time, in seconds, to delay the computed position of a

  • SmoothMover. See set_delay().

*/

getDirectionalVelocity()

C++ Interface: get_directional_velocity(const SmoothMover self)

/**
  • Returns the current state of the ‘directional velocity’ flag. See

  • set_directional_velocity().

*/

getExpectedBroadcastPeriod()

C++ Interface: get_expected_broadcast_period(const SmoothMover self)

/**
  • Returns the interval at which we expect the SmoothNodes to broadcast their

  • position, in elapsed seconds. See set_expected_broadcast_period().

*/

getForwardAxis()

C++ Interface: get_forward_axis(SmoothMover self)

/**
  • Returns the smoothed position as computed by a previous call to

  • compute_smooth_position().

*/

getLatestPosition()

C++ Interface: get_latest_position(const SmoothMover self)

/**
  • Updates the smooth_pos (and smooth_hpr, etc.) members to reflect the

  • absolute latest position known for this avatar. This may result in a pop

  • to the most recent position.

  • Returns true if the latest position is known, false otherwise.

*/

getMaxPositionAge()

C++ Interface: get_max_position_age(const SmoothMover self)

/**
  • Returns the maximum amount of time a position is allowed to remain

  • unchanged before assuming it represents the avatar actually standing still.

*/

getMostRecentTimestamp()

C++ Interface: get_most_recent_timestamp(SmoothMover self)

/**
  • Returns most recently recorded timestamp

*/

getPredictionMode()

C++ Interface: get_prediction_mode(const SmoothMover self)

/**
  • Returns the predictioning mode of all SmoothMovers in the world. See

  • set_prediction_mode().

*/

getResetVelocityAge()

C++ Interface: get_reset_velocity_age(const SmoothMover self)

/**
  • Returns the amount of time that should elapse after the last position

  • report before the velocity is reset to 0. See set_reset_velocity_age().

*/

getSampleHpr()

C++ Interface: get_sample_hpr(SmoothMover self)

/**
  • Returns the current orientation of the working sample point. This

  • orientation is updated periodically by set_h(), set_p(), etc., and its

  • current value is copied to the sample point table when mark_position() is

  • called.

*/

getSamplePos()

C++ Interface: get_sample_pos(SmoothMover self)

/**
  • Returns the current position of the working sample point. This position is

  • updated periodically by set_x(), set_y(), etc., and its current value is

  • copied to the sample point table when mark_position() is called.

*/

getSmoothForwardVelocity()

C++ Interface: get_smooth_forward_velocity(SmoothMover self)

/**
  • Returns the speed at which the avatar is moving, in feet per second, along

  • its own forward axis (after applying the avatar’s hpr). This will be a

  • positive number if the avatar is moving forward, and a negative number if

  • it is moving backward.

*/

getSmoothHpr()

C++ Interface: get_smooth_hpr(SmoothMover self)

/**
  • Returns the smoothed orientation as computed by a previous call to

  • compute_smooth_position().

*/

getSmoothLateralVelocity()

C++ Interface: get_smooth_lateral_velocity(SmoothMover self)

/**
  • Returns the speed at which the avatar is moving, in feet per second, along

  • its own lateral axis (after applying the avatar’s hpr). This will be a

  • positive number if the avatar is moving right, and a negative number if it

  • is moving left.

*/

getSmoothMode()

C++ Interface: get_smooth_mode(const SmoothMover self)

/**
  • Returns the smoothing mode of all SmoothMovers in the world. See

  • set_smooth_mode().

*/

getSmoothPos()

C++ Interface: get_smooth_pos(SmoothMover self)

/**
  • Returns the smoothed position as computed by a previous call to

  • compute_smooth_position().

*/

getSmoothRotationalVelocity()

C++ Interface: get_smooth_rotational_velocity(SmoothMover self)

/**
  • Returns the speed at which the avatar is rotating in the horizontal plane

  • (i.e. heading), in degrees per second. This may be positive or negative,

  • according to the direction of rotation.

*/

get_accept_clock_skew()

C++ Interface: get_accept_clock_skew(const SmoothMover self)

/**
  • Returns the current state of the ‘accept clock skew’ flag. See

  • set_accept_clock_skew().

*/

get_default_to_standing_still()

C++ Interface: get_default_to_standing_still(const SmoothMover self)

/**
  • Returns the current state of the ‘default to standing still’ flag. See

  • set_default_to_standing_still().

*/

get_delay()

C++ Interface: get_delay(const SmoothMover self)

/**
  • Returns the amount of time, in seconds, to delay the computed position of a

  • SmoothMover. See set_delay().

*/

get_directional_velocity()

C++ Interface: get_directional_velocity(const SmoothMover self)

/**
  • Returns the current state of the ‘directional velocity’ flag. See

  • set_directional_velocity().

*/

get_expected_broadcast_period()

C++ Interface: get_expected_broadcast_period(const SmoothMover self)

/**
  • Returns the interval at which we expect the SmoothNodes to broadcast their

  • position, in elapsed seconds. See set_expected_broadcast_period().

*/

get_forward_axis()

C++ Interface: get_forward_axis(SmoothMover self)

/**
  • Returns the smoothed position as computed by a previous call to

  • compute_smooth_position().

*/

get_latest_position()

C++ Interface: get_latest_position(const SmoothMover self)

/**
  • Updates the smooth_pos (and smooth_hpr, etc.) members to reflect the

  • absolute latest position known for this avatar. This may result in a pop

  • to the most recent position.

  • Returns true if the latest position is known, false otherwise.

*/

get_max_position_age()

C++ Interface: get_max_position_age(const SmoothMover self)

/**
  • Returns the maximum amount of time a position is allowed to remain

  • unchanged before assuming it represents the avatar actually standing still.

*/

get_most_recent_timestamp()

C++ Interface: get_most_recent_timestamp(SmoothMover self)

/**
  • Returns most recently recorded timestamp

*/

get_prediction_mode()

C++ Interface: get_prediction_mode(const SmoothMover self)

/**
  • Returns the predictioning mode of all SmoothMovers in the world. See

  • set_prediction_mode().

*/

get_reset_velocity_age()

C++ Interface: get_reset_velocity_age(const SmoothMover self)

/**
  • Returns the amount of time that should elapse after the last position

  • report before the velocity is reset to 0. See set_reset_velocity_age().

*/

get_sample_hpr()

C++ Interface: get_sample_hpr(SmoothMover self)

/**
  • Returns the current orientation of the working sample point. This

  • orientation is updated periodically by set_h(), set_p(), etc., and its

  • current value is copied to the sample point table when mark_position() is

  • called.

*/

get_sample_pos()

C++ Interface: get_sample_pos(SmoothMover self)

/**
  • Returns the current position of the working sample point. This position is

  • updated periodically by set_x(), set_y(), etc., and its current value is

  • copied to the sample point table when mark_position() is called.

*/

get_smooth_forward_velocity()

C++ Interface: get_smooth_forward_velocity(SmoothMover self)

/**
  • Returns the speed at which the avatar is moving, in feet per second, along

  • its own forward axis (after applying the avatar’s hpr). This will be a

  • positive number if the avatar is moving forward, and a negative number if

  • it is moving backward.

*/

get_smooth_hpr()

C++ Interface: get_smooth_hpr(SmoothMover self)

/**
  • Returns the smoothed orientation as computed by a previous call to

  • compute_smooth_position().

*/

get_smooth_lateral_velocity()

C++ Interface: get_smooth_lateral_velocity(SmoothMover self)

/**
  • Returns the speed at which the avatar is moving, in feet per second, along

  • its own lateral axis (after applying the avatar’s hpr). This will be a

  • positive number if the avatar is moving right, and a negative number if it

  • is moving left.

*/

get_smooth_mode()

C++ Interface: get_smooth_mode(const SmoothMover self)

/**
  • Returns the smoothing mode of all SmoothMovers in the world. See

  • set_smooth_mode().

*/

get_smooth_pos()

C++ Interface: get_smooth_pos(SmoothMover self)

/**
  • Returns the smoothed position as computed by a previous call to

  • compute_smooth_position().

*/

get_smooth_rotational_velocity()

C++ Interface: get_smooth_rotational_velocity(SmoothMover self)

/**
  • Returns the speed at which the avatar is rotating in the horizontal plane

  • (i.e. heading), in degrees per second. This may be positive or negative,

  • according to the direction of rotation.

*/

handleWrtReparent()

C++ Interface: handle_wrt_reparent(const SmoothMover self, NodePath old_parent, NodePath new_parent)

/**
  • Node is being wrtReparented, update recorded sample positions to reflect

  • new parent

*/

handle_wrt_reparent()

C++ Interface: handle_wrt_reparent(const SmoothMover self, NodePath old_parent, NodePath new_parent)

/**
  • Node is being wrtReparented, update recorded sample positions to reflect

  • new parent

*/

hasMostRecentTimestamp()

C++ Interface: has_most_recent_timestamp(SmoothMover self)

/**
  • Returns true if we have most recently recorded timestamp

*/

has_most_recent_timestamp()

C++ Interface: has_most_recent_timestamp(SmoothMover self)

/**
  • Returns true if we have most recently recorded timestamp

*/

markPosition()

C++ Interface: mark_position(const SmoothMover self)

/**
  • Stores the position, orientation, and timestamp (if relevant) indicated by

  • previous calls to set_pos(), set_hpr(), and set_timestamp() in a new

  • position report.

  • When compute_smooth_position() is called, it uses these stored position

  • reports to base its computation of the known position.

*/

mark_position()

C++ Interface: mark_position(const SmoothMover self)

/**
  • Stores the position, orientation, and timestamp (if relevant) indicated by

  • previous calls to set_pos(), set_hpr(), and set_timestamp() in a new

  • position report.

  • When compute_smooth_position() is called, it uses these stored position

  • reports to base its computation of the known position.

*/

output()

C++ Interface: output(SmoothMover self, ostream out)

/**

*/

setAcceptClockSkew()

C++ Interface: set_accept_clock_skew(const SmoothMover self, bool flag)

/**
  • Sets the ‘accept clock skew’ flag. When this flag is true, clock skew from

  • the other clients will be tolerated by delaying each smooth mover’s

  • position an additional amount, on top of that specified by set_delay(),

  • based on the measured average latency for timestamp messages received by

  • the client.

  • In this way, if the other client has significant clock skew with respect to

  • our clock, it will be evident as a large positive or negative average

  • latency for timestamps. By subtracting out this average latency, we

  • compensate for poor clock sync.

*/

setDefaultToStandingStill()

C++ Interface: set_default_to_standing_still(const SmoothMover self, bool flag)

/**
  • Sets the flag that indicates whether to assume that the node stopped moving

  • during periods when we don’t get enough position updates. If true, the

  • object will stand still momentarily. If false, the object will

  • continuously lerp between the position updates that we did get.

*/

setDelay()

C++ Interface: set_delay(const SmoothMover self, double delay)

/**
  • Sets the amount of time, in seconds, to delay the computed position of a

  • SmoothMover. This is particularly useful when the prediction mode is off,

  • because it can allow the apparent motion of an avatar to appear smooth

  • without relying on prediction, at the cost of introducing additional lag in

  • the avatar’s apparent position.

*/

setDirectionalVelocity()

C++ Interface: set_directional_velocity(const SmoothMover self, bool flag)

/**
  • Sets the flag that indicates whether the avatar’s direction is considered

  • in computing the velocity. When this is true, velocity is automatically

  • decomposed into a forward and a lateral velocity (and both may be positive

  • or negative); when it is false, all velocity is always returned as forward

  • velocity (and it is always positive).

*/

setExpectedBroadcastPeriod()

C++ Interface: set_expected_broadcast_period(const SmoothMover self, double period)

/**
  • Sets the interval at which we expect the SmoothNodes to broadcast their

  • position, in elapsed seconds. This controls the length of time we assume

  • the object has truly stopped, when we receive a long sequence of no

  • updates.

*/

setH()

C++ Interface: set_h(const SmoothMover self, float h)

/**
  • Sets the heading only. See set_hpr().

*/

setHpr()

C++ Interface: set_hpr(const SmoothMover self, const LVecBase3f hpr) set_hpr(const SmoothMover self, float h, float p, float r)

/**
  • Specifies the orientation of the SmoothMover at a particular time in the

  • past. When mark_position() is called, this will be recorded (along with

  • hpr and timestamp) in a position report, which will then be used along with

  • all other position reports to determine the smooth position at any

  • particular instant.

  • The return value is true if any parameter has changed since the last call

  • to set_hpr(), or false if they are the same.

*/

/**
  • Specifies the orientation of the SmoothMover at a particular time in the

  • past. When mark_position() is called, this will be recorded (along with

  • hpr and timestamp) in a position report, which will then be used along with

  • all other position reports to determine the smooth position at any

  • particular instant.

  • The return value is true if any parameter has changed since the last call

  • to set_hpr(), or false if they are the same.

*/

setMaxPositionAge()

C++ Interface: set_max_position_age(const SmoothMover self, double age)

/**
  • Sets the maximum amount of time a position is allowed to remain unchanged

  • before assuming it represents the avatar actually standing still.

*/

setP()

C++ Interface: set_p(const SmoothMover self, float p)

/**
  • Sets the pitch only. See set_hpr().

*/

setPhonyTimestamp()

C++ Interface: set_phony_timestamp(const SmoothMover self, double timestamp, bool period_adjust)

/**
  • Lies and specifies that the current position report was received now. This

  • is usually used for very old position reports for which we’re not sure of

  • the actual receipt time.

*/

setPos()

C++ Interface: set_pos(const SmoothMover self, const LVecBase3f pos) set_pos(const SmoothMover self, float x, float y, float z)

// These methods are used to specify each position update. Call the // appropriate set_* function(s), as needed, and then call mark_position(). // The return value of each function is true if the parameter value has // changed, or false if it remains the same as last time.

/**
  • Specifies the position of the SmoothMover at a particular time in the past.

  • When mark_position() is called, this will be recorded (along with hpr and

  • timestamp) in a position report, which will then be used along with all

  • other position reports to determine the smooth position at any particular

  • instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos(), or false if they are the same.

*/

/**
  • Specifies the position of the SmoothMover at a particular time in the past.

  • When mark_position() is called, this will be recorded (along with hpr and

  • timestamp) in a position report, which will then be used along with all

  • other position reports to determine the smooth position at any particular

  • instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos(), or false if they are the same.

*/

setPosHpr()

C++ Interface: set_pos_hpr(const SmoothMover self, const LVecBase3f pos, const LVecBase3f hpr) set_pos_hpr(const SmoothMover self, float x, float y, float z, float h, float p, float r)

/**
  • Specifies the position and orientation of the SmoothMover at a particular

  • time in the past. When mark_position() is called, this will be recorded

  • (along with timestamp) in a position report, which will then be used along

  • with all other position reports to determine the smooth position at any

  • particular instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos_hpr(), or false if they are the same.

*/

/**
  • Specifies the position of the SmoothMover at a particular time in the past.

  • When mark_position() is called, this will be recorded (along with

  • timestamp) in a position report, which will then be used along with all

  • other position reports to determine the smooth position at any particular

  • instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos_hpr(), or false if they are the same.

*/

setPredictionMode()

C++ Interface: set_prediction_mode(const SmoothMover self, int mode)

/**
  • Sets the predictioning mode of all SmoothMovers in the world. If this is

  • PM_off, no prediction will be performed, but smoothing might still be

  • performed.

*/

setR()

C++ Interface: set_r(const SmoothMover self, float r)

/**
  • Sets the roll only. See set_hpr().

*/

setResetVelocityAge()

C++ Interface: set_reset_velocity_age(const SmoothMover self, double age)

/**
  • Sets the amount of time that should elapse after the last position report

  • before the velocity is reset to 0. This is similar to max_position_age,

  • but it is only used to determine the resetting of the reported velocity.

  • It should always be greater than or equal to max_position_age.

*/

setSmoothMode()

C++ Interface: set_smooth_mode(const SmoothMover self, int mode)

/**
  • Sets the smoothing mode of all SmoothMovers in the world. If this is

  • SM_off, no smoothing or prediction will be performed, and get_smooth_pos()

  • will simply return the position last set by mark_position().

*/

setTimestamp()

C++ Interface: set_timestamp(const SmoothMover self, double timestamp)

/**
  • Specifies the time that the current position report applies. This should

  • be called, along with set_pos() and set_hpr(), before a call to

  • mark_position().

*/

setX()

C++ Interface: set_x(const SmoothMover self, float x)

/**
  • Sets the X position only. See set_pos().

*/

setY()

C++ Interface: set_y(const SmoothMover self, float y)

/**
  • Sets the Y position only. See set_pos().

*/

setZ()

C++ Interface: set_z(const SmoothMover self, float z)

/**
  • Sets the Z position only. See set_pos().

*/

set_accept_clock_skew()

C++ Interface: set_accept_clock_skew(const SmoothMover self, bool flag)

/**
  • Sets the ‘accept clock skew’ flag. When this flag is true, clock skew from

  • the other clients will be tolerated by delaying each smooth mover’s

  • position an additional amount, on top of that specified by set_delay(),

  • based on the measured average latency for timestamp messages received by

  • the client.

  • In this way, if the other client has significant clock skew with respect to

  • our clock, it will be evident as a large positive or negative average

  • latency for timestamps. By subtracting out this average latency, we

  • compensate for poor clock sync.

*/

set_default_to_standing_still()

C++ Interface: set_default_to_standing_still(const SmoothMover self, bool flag)

/**
  • Sets the flag that indicates whether to assume that the node stopped moving

  • during periods when we don’t get enough position updates. If true, the

  • object will stand still momentarily. If false, the object will

  • continuously lerp between the position updates that we did get.

*/

set_delay()

C++ Interface: set_delay(const SmoothMover self, double delay)

/**
  • Sets the amount of time, in seconds, to delay the computed position of a

  • SmoothMover. This is particularly useful when the prediction mode is off,

  • because it can allow the apparent motion of an avatar to appear smooth

  • without relying on prediction, at the cost of introducing additional lag in

  • the avatar’s apparent position.

*/

set_directional_velocity()

C++ Interface: set_directional_velocity(const SmoothMover self, bool flag)

/**
  • Sets the flag that indicates whether the avatar’s direction is considered

  • in computing the velocity. When this is true, velocity is automatically

  • decomposed into a forward and a lateral velocity (and both may be positive

  • or negative); when it is false, all velocity is always returned as forward

  • velocity (and it is always positive).

*/

set_expected_broadcast_period()

C++ Interface: set_expected_broadcast_period(const SmoothMover self, double period)

/**
  • Sets the interval at which we expect the SmoothNodes to broadcast their

  • position, in elapsed seconds. This controls the length of time we assume

  • the object has truly stopped, when we receive a long sequence of no

  • updates.

*/

set_h()

C++ Interface: set_h(const SmoothMover self, float h)

/**
  • Sets the heading only. See set_hpr().

*/

set_hpr()

C++ Interface: set_hpr(const SmoothMover self, const LVecBase3f hpr) set_hpr(const SmoothMover self, float h, float p, float r)

/**
  • Specifies the orientation of the SmoothMover at a particular time in the

  • past. When mark_position() is called, this will be recorded (along with

  • hpr and timestamp) in a position report, which will then be used along with

  • all other position reports to determine the smooth position at any

  • particular instant.

  • The return value is true if any parameter has changed since the last call

  • to set_hpr(), or false if they are the same.

*/

/**
  • Specifies the orientation of the SmoothMover at a particular time in the

  • past. When mark_position() is called, this will be recorded (along with

  • hpr and timestamp) in a position report, which will then be used along with

  • all other position reports to determine the smooth position at any

  • particular instant.

  • The return value is true if any parameter has changed since the last call

  • to set_hpr(), or false if they are the same.

*/

set_max_position_age()

C++ Interface: set_max_position_age(const SmoothMover self, double age)

/**
  • Sets the maximum amount of time a position is allowed to remain unchanged

  • before assuming it represents the avatar actually standing still.

*/

set_p()

C++ Interface: set_p(const SmoothMover self, float p)

/**
  • Sets the pitch only. See set_hpr().

*/

set_phony_timestamp()

C++ Interface: set_phony_timestamp(const SmoothMover self, double timestamp, bool period_adjust)

/**
  • Lies and specifies that the current position report was received now. This

  • is usually used for very old position reports for which we’re not sure of

  • the actual receipt time.

*/

set_pos()

C++ Interface: set_pos(const SmoothMover self, const LVecBase3f pos) set_pos(const SmoothMover self, float x, float y, float z)

// These methods are used to specify each position update. Call the // appropriate set_* function(s), as needed, and then call mark_position(). // The return value of each function is true if the parameter value has // changed, or false if it remains the same as last time.

/**
  • Specifies the position of the SmoothMover at a particular time in the past.

  • When mark_position() is called, this will be recorded (along with hpr and

  • timestamp) in a position report, which will then be used along with all

  • other position reports to determine the smooth position at any particular

  • instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos(), or false if they are the same.

*/

/**
  • Specifies the position of the SmoothMover at a particular time in the past.

  • When mark_position() is called, this will be recorded (along with hpr and

  • timestamp) in a position report, which will then be used along with all

  • other position reports to determine the smooth position at any particular

  • instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos(), or false if they are the same.

*/

set_pos_hpr()

C++ Interface: set_pos_hpr(const SmoothMover self, const LVecBase3f pos, const LVecBase3f hpr) set_pos_hpr(const SmoothMover self, float x, float y, float z, float h, float p, float r)

/**
  • Specifies the position and orientation of the SmoothMover at a particular

  • time in the past. When mark_position() is called, this will be recorded

  • (along with timestamp) in a position report, which will then be used along

  • with all other position reports to determine the smooth position at any

  • particular instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos_hpr(), or false if they are the same.

*/

/**
  • Specifies the position of the SmoothMover at a particular time in the past.

  • When mark_position() is called, this will be recorded (along with

  • timestamp) in a position report, which will then be used along with all

  • other position reports to determine the smooth position at any particular

  • instant.

  • The return value is true if any parameter has changed since the last call

  • to set_pos_hpr(), or false if they are the same.

*/

set_prediction_mode()

C++ Interface: set_prediction_mode(const SmoothMover self, int mode)

/**
  • Sets the predictioning mode of all SmoothMovers in the world. If this is

  • PM_off, no prediction will be performed, but smoothing might still be

  • performed.

*/

set_r()

C++ Interface: set_r(const SmoothMover self, float r)

/**
  • Sets the roll only. See set_hpr().

*/

set_reset_velocity_age()

C++ Interface: set_reset_velocity_age(const SmoothMover self, double age)

/**
  • Sets the amount of time that should elapse after the last position report

  • before the velocity is reset to 0. This is similar to max_position_age,

  • but it is only used to determine the resetting of the reported velocity.

  • It should always be greater than or equal to max_position_age.

*/

set_smooth_mode()

C++ Interface: set_smooth_mode(const SmoothMover self, int mode)

/**
  • Sets the smoothing mode of all SmoothMovers in the world. If this is

  • SM_off, no smoothing or prediction will be performed, and get_smooth_pos()

  • will simply return the position last set by mark_position().

*/

set_timestamp()

C++ Interface: set_timestamp(const SmoothMover self, double timestamp)

/**
  • Specifies the time that the current position report applies. This should

  • be called, along with set_pos() and set_hpr(), before a call to

  • mark_position().

*/

set_x()

C++ Interface: set_x(const SmoothMover self, float x)

/**
  • Sets the X position only. See set_pos().

*/

set_y()

C++ Interface: set_y(const SmoothMover self, float y)

/**
  • Sets the Y position only. See set_pos().

*/

set_z()

C++ Interface: set_z(const SmoothMover self, float z)

/**
  • Sets the Z position only. See set_pos().

*/

write()

C++ Interface: write(SmoothMover self, ostream out)

/**

*/