Panda3D
Classes | Public Types | Public Member Functions | List of all members
SmoothMover Class Reference

This class handles smoothing of sampled motion points over time, e.g. More...

#include "smoothMover.h"

Classes

class  SamplePoint
 

Public Types

enum  PredictionMode { PM_off, PM_on }
 
enum  SmoothMode { SM_off, SM_on }
 

Public Member Functions

void apply_smooth_hpr (NodePath &node) const
 Applies the smoothed orientation to the indicated NodePath. More...
 
void apply_smooth_pos (NodePath &node) const
 Applies the smoothed position to the indicated NodePath. More...
 
void apply_smooth_pos_hpr (NodePath &pos_node, NodePath &hpr_node) const
 Applies the smoothed position and orientation to the indicated NodePath. More...
 
void clear_positions (bool reset_velocity)
 Erases all the old position reports. More...
 
void compute_and_apply_smooth_hpr (NodePath &hpr_node)
 A further optimization to reduce Python calls. More...
 
void compute_and_apply_smooth_pos (NodePath &node)
 A further optimization to reduce Python calls. More...
 
void compute_and_apply_smooth_pos_hpr (NodePath &pos_node, NodePath &hpr_node)
 A further optimization to reduce Python calls. More...
 
bool compute_smooth_position ()
 Computes the smoothed position (and orientation) of the mover at the indicated point in time, based on the previous position reports. More...
 
bool compute_smooth_position (double timestamp)
 Computes the smoothed position (and orientation) of the mover at the indicated point in time, based on the previous position reports. More...
 
bool get_accept_clock_skew ()
 Returns the current state of the 'accept clock skew' flag. More...
 
bool get_default_to_standing_still ()
 Returns the current state of the 'default to standing still' flag. More...
 
double get_delay ()
 Returns the amount of time, in seconds, to delay the computed position of a SmoothMover. More...
 
bool get_directional_velocity ()
 Returns the current state of the 'directional velocity' flag. More...
 
double get_expected_broadcast_period ()
 Returns the interval at which we expect the SmoothNodes to broadcast their position, in elapsed seconds. More...
 
const LVecBase3 & get_forward_axis () const
 Returns the smoothed position as computed by a previous call to compute_smooth_position(). More...
 
bool get_latest_position ()
 Updates the smooth_pos (and smooth_hpr, etc.) members to reflect the absolute latest position known for this avatar. More...
 
double get_max_position_age ()
 Returns the maximum amount of time a position is allowed to remain unchanged before assuming it represents the avatar actually standing still. More...
 
double get_most_recent_timestamp () const
 Returns most recently recorded timestamp. More...
 
PredictionMode get_prediction_mode ()
 Returns the predictioning mode of all SmoothMovers in the world. More...
 
double get_reset_velocity_age ()
 Returns the amount of time that should elapse after the last position report before the velocity is reset to 0. More...
 
const LVecBase3 & get_sample_hpr () const
 Returns the current orientation of the working sample point. More...
 
const LPoint3 & get_sample_pos () const
 Returns the current position of the working sample point. More...
 
PN_stdfloat get_smooth_forward_velocity () const
 Returns the speed at which the avatar is moving, in feet per second, along its own forward axis (after applying the avatar's hpr). More...
 
const LVecBase3 & get_smooth_hpr () const
 Returns the smoothed orientation as computed by a previous call to compute_smooth_position(). More...
 
PN_stdfloat get_smooth_lateral_velocity () const
 Returns the speed at which the avatar is moving, in feet per second, along its own lateral axis (after applying the avatar's hpr). More...
 
SmoothMode get_smooth_mode ()
 Returns the smoothing mode of all SmoothMovers in the world. More...
 
const LPoint3 & get_smooth_pos () const
 Returns the smoothed position as computed by a previous call to compute_smooth_position(). More...
 
PN_stdfloat get_smooth_rotational_velocity () const
 Returns the speed at which the avatar is rotating in the horizontal plane (i.e. More...
 
void handle_wrt_reparent (NodePath &old_parent, NodePath &new_parent)
 Node is being wrtReparented, update recorded sample positions to reflect new parent. More...
 
bool has_most_recent_timestamp () const
 Returns true if we have most recently recorded timestamp. More...
 
void mark_position ()
 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. More...
 
void output (std::ostream &out) const
 
void set_accept_clock_skew (bool flag)
 Sets the 'accept clock skew' flag. More...
 
void set_default_to_standing_still (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. More...
 
void set_delay (double delay)
 Sets the amount of time, in seconds, to delay the computed position of a SmoothMover. More...
 
void set_directional_velocity (bool flag)
 Sets the flag that indicates whether the avatar's direction is considered in computing the velocity. More...
 
void set_expected_broadcast_period (double period)
 Sets the interval at which we expect the SmoothNodes to broadcast their position, in elapsed seconds. More...
 
bool set_h (PN_stdfloat h)
 Sets the heading only. More...
 
bool set_hpr (const LVecBase3 &hpr)
 Specifies the orientation of the SmoothMover at a particular time in the past. More...
 
bool set_hpr (PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
 Specifies the orientation of the SmoothMover at a particular time in the past. More...
 
void set_max_position_age (double age)
 Sets the maximum amount of time a position is allowed to remain unchanged before assuming it represents the avatar actually standing still. More...
 
bool set_p (PN_stdfloat p)
 Sets the pitch only. More...
 
void set_phony_timestamp (double timestamp=0.0, bool period_adjust=false)
 Lies and specifies that the current position report was received now. More...
 
bool set_pos (const LVecBase3 &pos)
 Specifies the position of the SmoothMover at a particular time in the past. More...
 
bool set_pos (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
 Specifies the position of the SmoothMover at a particular time in the past. More...
 
bool set_pos_hpr (const LVecBase3 &pos, const LVecBase3 &hpr)
 Specifies the position and orientation of the SmoothMover at a particular time in the past. More...
 
bool set_pos_hpr (PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat h, PN_stdfloat p, PN_stdfloat r)
 Specifies the position of the SmoothMover at a particular time in the past. More...
 
void set_prediction_mode (PredictionMode mode)
 Sets the predictioning mode of all SmoothMovers in the world. More...
 
bool set_r (PN_stdfloat r)
 Sets the roll only. More...
 
void set_reset_velocity_age (double age)
 Sets the amount of time that should elapse after the last position report before the velocity is reset to 0. More...
 
void set_smooth_mode (SmoothMode mode)
 Sets the smoothing mode of all SmoothMovers in the world. More...
 
void set_timestamp (double timestamp)
 Specifies the time that the current position report applies. More...
 
bool set_x (PN_stdfloat x)
 Sets the X position only. More...
 
bool set_y (PN_stdfloat y)
 Sets the Y position only. More...
 
bool set_z (PN_stdfloat z)
 Sets the Z position only. More...
 
void write (std::ostream &out) const
 

Detailed Description

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.

Definition at line 41 of file smoothMover.h.

Member Function Documentation

◆ apply_smooth_hpr()

void SmoothMover::apply_smooth_hpr ( NodePath node) const
inline

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.

Definition at line 347 of file smoothMover.I.

References get_smooth_hpr(), and NodePath::set_hpr().

Referenced by compute_and_apply_smooth_hpr(), and compute_and_apply_smooth_pos_hpr().

◆ apply_smooth_pos()

void SmoothMover::apply_smooth_pos ( NodePath node) const
inline

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.

Definition at line 323 of file smoothMover.I.

References get_smooth_pos().

Referenced by compute_and_apply_smooth_pos(), and compute_and_apply_smooth_pos_hpr().

◆ apply_smooth_pos_hpr()

void SmoothMover::apply_smooth_pos_hpr ( NodePath pos_node,
NodePath hpr_node 
) const
inline

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.

Definition at line 335 of file smoothMover.I.

References get_smooth_hpr(), get_smooth_pos(), and NodePath::set_hpr().

◆ clear_positions()

void SmoothMover::clear_positions ( 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.

Definition at line 167 of file smoothMover.cxx.

Referenced by compute_smooth_position().

◆ compute_and_apply_smooth_hpr()

void SmoothMover::compute_and_apply_smooth_hpr ( NodePath hpr_node)
inline

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.

Definition at line 381 of file smoothMover.I.

References apply_smooth_hpr(), and compute_smooth_position().

◆ compute_and_apply_smooth_pos()

void SmoothMover::compute_and_apply_smooth_pos ( NodePath node)
inline

A further optimization to reduce Python calls.

This computes the smooth position and applies it to the indicated node in one call.

Definition at line 356 of file smoothMover.I.

References apply_smooth_pos(), and compute_smooth_position().

◆ compute_and_apply_smooth_pos_hpr()

void SmoothMover::compute_and_apply_smooth_pos_hpr ( NodePath pos_node,
NodePath hpr_node 
)
inline

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.

Definition at line 368 of file smoothMover.I.

References apply_smooth_hpr(), apply_smooth_pos(), and compute_smooth_position().

◆ compute_smooth_position() [1/2]

bool SmoothMover::compute_smooth_position ( )
inline

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.

Definition at line 285 of file smoothMover.I.

References ClockObject::get_global_clock().

Referenced by compute_and_apply_smooth_hpr(), compute_and_apply_smooth_pos(), and compute_and_apply_smooth_pos_hpr().

◆ compute_smooth_position() [2/2]

bool SmoothMover::compute_smooth_position ( 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.

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.

Definition at line 197 of file smoothMover.cxx.

References clear_positions().

◆ get_accept_clock_skew()

bool SmoothMover::get_accept_clock_skew ( )
inline

Returns the current state of the 'accept clock skew' flag.

See set_accept_clock_skew().

Definition at line 500 of file smoothMover.I.

◆ get_default_to_standing_still()

bool SmoothMover::get_default_to_standing_still ( )
inline

Returns the current state of the 'default to standing still' flag.

See set_default_to_standing_still().

Definition at line 599 of file smoothMover.I.

◆ get_delay()

double SmoothMover::get_delay ( )
inline

Returns the amount of time, in seconds, to delay the computed position of a SmoothMover.

See set_delay().

Definition at line 474 of file smoothMover.I.

◆ get_directional_velocity()

bool SmoothMover::get_directional_velocity ( )
inline

Returns the current state of the 'directional velocity' flag.

See set_directional_velocity().

Definition at line 579 of file smoothMover.I.

◆ get_expected_broadcast_period()

double SmoothMover::get_expected_broadcast_period ( )
inline

Returns the interval at which we expect the SmoothNodes to broadcast their position, in elapsed seconds.

See set_expected_broadcast_period().

Definition at line 538 of file smoothMover.I.

◆ get_forward_axis()

const LVecBase3 & SmoothMover::get_forward_axis ( ) const
inline

Returns the smoothed position as computed by a previous call to compute_smooth_position().

Definition at line 303 of file smoothMover.I.

◆ get_latest_position()

bool SmoothMover::get_latest_position ( )

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.

Definition at line 509 of file smoothMover.cxx.

◆ get_max_position_age()

double SmoothMover::get_max_position_age ( )
inline

Returns the maximum amount of time a position is allowed to remain unchanged before assuming it represents the avatar actually standing still.

Definition at line 518 of file smoothMover.I.

◆ get_most_recent_timestamp()

double SmoothMover::get_most_recent_timestamp ( ) const
inline

Returns most recently recorded timestamp.

Definition at line 271 of file smoothMover.I.

◆ get_prediction_mode()

SmoothMover::PredictionMode SmoothMover::get_prediction_mode ( )
inline

Returns the predictioning mode of all SmoothMovers in the world.

See set_prediction_mode().

Definition at line 453 of file smoothMover.I.

◆ get_reset_velocity_age()

double SmoothMover::get_reset_velocity_age ( )
inline

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().

Definition at line 558 of file smoothMover.I.

◆ get_sample_hpr()

const LVecBase3 & SmoothMover::get_sample_hpr ( ) const
inline

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.

Definition at line 212 of file smoothMover.I.

◆ get_sample_pos()

const LPoint3 & SmoothMover::get_sample_pos ( ) const
inline

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.

Definition at line 201 of file smoothMover.I.

◆ get_smooth_forward_velocity()

PN_stdfloat SmoothMover::get_smooth_forward_velocity ( ) const
inline

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.

Definition at line 394 of file smoothMover.I.

◆ get_smooth_hpr()

const LVecBase3 & SmoothMover::get_smooth_hpr ( ) const
inline

Returns the smoothed orientation as computed by a previous call to compute_smooth_position().

Definition at line 312 of file smoothMover.I.

Referenced by apply_smooth_hpr(), and apply_smooth_pos_hpr().

◆ get_smooth_lateral_velocity()

PN_stdfloat SmoothMover::get_smooth_lateral_velocity ( ) const
inline

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.

Definition at line 405 of file smoothMover.I.

◆ get_smooth_mode()

SmoothMover::SmoothMode SmoothMover::get_smooth_mode ( )
inline

Returns the smoothing mode of all SmoothMovers in the world.

See set_smooth_mode().

Definition at line 434 of file smoothMover.I.

◆ get_smooth_pos()

const LPoint3 & SmoothMover::get_smooth_pos ( ) const
inline

Returns the smoothed position as computed by a previous call to compute_smooth_position().

Definition at line 294 of file smoothMover.I.

Referenced by apply_smooth_pos(), and apply_smooth_pos_hpr().

◆ get_smooth_rotational_velocity()

PN_stdfloat SmoothMover::get_smooth_rotational_velocity ( ) const
inline

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.

Definition at line 415 of file smoothMover.I.

◆ handle_wrt_reparent()

void SmoothMover::handle_wrt_reparent ( NodePath old_parent,
NodePath new_parent 
)

Node is being wrtReparented, update recorded sample positions to reflect new parent.

Definition at line 712 of file smoothMover.cxx.

◆ has_most_recent_timestamp()

bool SmoothMover::has_most_recent_timestamp ( ) const
inline

Returns true if we have most recently recorded timestamp.

Definition at line 263 of file smoothMover.I.

◆ mark_position()

void SmoothMover::mark_position ( )

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.

Definition at line 78 of file smoothMover.cxx.

References ClockObject::get_frame_time, and ClockObject::get_global_clock().

◆ set_accept_clock_skew()

void SmoothMover::set_accept_clock_skew ( bool  flag)
inline

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.

Definition at line 491 of file smoothMover.I.

◆ set_default_to_standing_still()

void SmoothMover::set_default_to_standing_still ( bool  flag)
inline

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.

Definition at line 590 of file smoothMover.I.

◆ set_delay()

void SmoothMover::set_delay ( double  delay)
inline

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.

Definition at line 465 of file smoothMover.I.

◆ set_directional_velocity()

void SmoothMover::set_directional_velocity ( bool  flag)
inline

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).

Definition at line 570 of file smoothMover.I.

◆ set_expected_broadcast_period()

void SmoothMover::set_expected_broadcast_period ( double  period)
inline

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.

Definition at line 529 of file smoothMover.I.

◆ set_h()

bool SmoothMover::set_h ( PN_stdfloat  h)
inline

Sets the heading only.

See set_hpr().

Definition at line 123 of file smoothMover.I.

Referenced by set_hpr(), and set_pos_hpr().

◆ set_hpr() [1/2]

bool SmoothMover::set_hpr ( const LVecBase3 &  hpr)
inline

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.

Definition at line 100 of file smoothMover.I.

References set_h(), set_p(), and set_r().

◆ set_hpr() [2/2]

bool SmoothMover::set_hpr ( PN_stdfloat  h,
PN_stdfloat  p,
PN_stdfloat  r 
)
inline

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.

Definition at line 115 of file smoothMover.I.

References set_h(), set_p(), and set_r().

◆ set_max_position_age()

void SmoothMover::set_max_position_age ( double  age)
inline

Sets the maximum amount of time a position is allowed to remain unchanged before assuming it represents the avatar actually standing still.

Definition at line 509 of file smoothMover.I.

◆ set_p()

bool SmoothMover::set_p ( PN_stdfloat  p)
inline

Sets the pitch only.

See set_hpr().

Definition at line 138 of file smoothMover.I.

Referenced by set_hpr(), and set_pos_hpr().

◆ set_phony_timestamp()

void SmoothMover::set_phony_timestamp ( double  timestamp = 0.0,
bool  period_adjust = false 
)
inline

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.

Definition at line 222 of file smoothMover.I.

References ClockObject::get_frame_time, and ClockObject::get_global_clock().

◆ set_pos() [1/2]

bool SmoothMover::set_pos ( const LVecBase3 &  pos)
inline

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.

Definition at line 25 of file smoothMover.I.

References set_x(), set_y(), and set_z().

◆ set_pos() [2/2]

bool SmoothMover::set_pos ( PN_stdfloat  x,
PN_stdfloat  y,
PN_stdfloat  z 
)
inline

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.

Definition at line 40 of file smoothMover.I.

References set_x(), set_y(), and set_z().

◆ set_pos_hpr() [1/2]

bool SmoothMover::set_pos_hpr ( const LVecBase3 &  pos,
const LVecBase3 &  hpr 
)
inline

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.

Definition at line 175 of file smoothMover.I.

References set_h(), set_p(), set_r(), set_x(), set_y(), and set_z().

◆ set_pos_hpr() [2/2]

bool SmoothMover::set_pos_hpr ( PN_stdfloat  x,
PN_stdfloat  y,
PN_stdfloat  z,
PN_stdfloat  h,
PN_stdfloat  p,
PN_stdfloat  r 
)
inline

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.

Definition at line 191 of file smoothMover.I.

References set_h(), set_p(), set_r(), set_x(), set_y(), and set_z().

◆ set_prediction_mode()

void SmoothMover::set_prediction_mode ( SmoothMover::PredictionMode  mode)
inline

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.

Definition at line 444 of file smoothMover.I.

◆ set_r()

bool SmoothMover::set_r ( PN_stdfloat  r)
inline

Sets the roll only.

See set_hpr().

Definition at line 153 of file smoothMover.I.

Referenced by set_hpr(), and set_pos_hpr().

◆ set_reset_velocity_age()

void SmoothMover::set_reset_velocity_age ( double  age)
inline

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.

Definition at line 549 of file smoothMover.I.

◆ set_smooth_mode()

void SmoothMover::set_smooth_mode ( SmoothMover::SmoothMode  mode)
inline

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().

Definition at line 425 of file smoothMover.I.

◆ set_timestamp()

void SmoothMover::set_timestamp ( double  timestamp)
inline

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().

Definition at line 247 of file smoothMover.I.

◆ set_x()

bool SmoothMover::set_x ( PN_stdfloat  x)
inline

Sets the X position only.

See set_pos().

Definition at line 48 of file smoothMover.I.

Referenced by set_pos(), and set_pos_hpr().

◆ set_y()

bool SmoothMover::set_y ( PN_stdfloat  y)
inline

Sets the Y position only.

See set_pos().

Definition at line 63 of file smoothMover.I.

Referenced by set_pos(), and set_pos_hpr().

◆ set_z()

bool SmoothMover::set_z ( PN_stdfloat  z)
inline

Sets the Z position only.

See set_pos().

Definition at line 78 of file smoothMover.I.

Referenced by set_pos(), and set_pos_hpr().


The documentation for this class was generated from the following files: