|
| SmoothNetworkBody (bool enable=false) |
|
void | reset () |
|
void | setEnable (bool val) |
|
bool | isEnabled () const |
|
void | setSmoothRotation (bool val) |
|
void | setAdjustVerticalOffset (bool val) |
|
void | prepareSmoothing (const btTransform ¤t_transform, const Vec3 ¤t_velocity) |
|
void | checkSmoothing (const btTransform ¤t_transform, const Vec3 ¤t_velocity) |
| Adds a new error between graphical and physical position/rotation.
|
|
void | updateSmoothedGraphics (const btTransform ¤t_transform, const Vec3 ¤t_velocity, float dt) |
|
void | setSmoothedTransform (const btTransform &t) |
|
const btTransform & | getSmoothedTrans () const |
|
const Vec3 & | getSmoothedXYZ () const |
|
void | setMinAdjustLength (float val) |
|
void | setMaxAdjustLength (float val) |
|
void | setMinAdjustSpeed (float val) |
|
void | setMaxAdjustTime (float val) |
|
void | setAdjustLengthThreshold (float val) |
|
|
enum | SmoothingState { SS_NONE = 0
, SS_TO_ADJUST
, SS_TO_REAL
} |
|
|
std::pair< Vec3, btQuaternion > | m_start_smoothing_postion |
| Client prediction in networked games might cause the visual and physical position to be different.
|
|
std::pair< Vec3, btQuaternion > | m_adjust_position |
|
Vec3 | m_adjust_control_point |
|
std::pair< btTransform, Vec3 > | m_prev_position_data |
|
btTransform | m_smoothed_transform |
|
float | m_adjust_time |
|
float | m_adjust_time_dt |
|
SmoothingState | m_smoothing |
|
bool | m_enabled |
|
bool | m_smooth_rotation |
|
bool | m_adjust_vertical_offset |
|
float | m_min_adjust_length |
|
float | m_max_adjust_length |
|
float | m_min_adjust_speed |
|
float | m_max_adjust_time |
|
float | m_adjust_length_threshold |
|
◆ checkSmoothing()
void SmoothNetworkBody::checkSmoothing |
( |
const btTransform & |
current_transform, |
|
|
const Vec3 & |
current_velocity |
|
) |
| |
Adds a new error between graphical and physical position/rotation.
Called in case of a rewind to allow to for smoothing the visuals in case of incorrect client prediction.
◆ m_start_smoothing_postion
std::pair<Vec3, btQuaternion> SmoothNetworkBody::m_start_smoothing_postion |
|
private |
Client prediction in networked games might cause the visual and physical position to be different.
For visual smoothing these variable accumulate the error and reduces it over time.
The documentation for this class was generated from the following files: