Public Member Functions | |
PROUD_API void | SetGravity (const Vector3 &value) |
PROUD_API void | SetTargetVelocity (const Vector3 &value) |
PROUD_API void | SetTargetPosition (const Vector3 &value) |
PROUD_API Vector3 | GetSplineFollowerPosition () const |
PROUD_API Vector3 | GetSplineFollowerVelocity () const |
PROUD_API Vector3 | GetGravity () const |
PROUD_API Vector3 | GetTargetVelocity () const |
PROUD_API Vector3 | GetTargetPosition () const |
PROUD_API void | SetFollowerVelocity (const Vector3 &value) |
PROUD_API void | SetFollowerPosition (const Vector3 &value) |
PROUD_API Vector3 | GetFollowerVelocity () const |
PROUD_API Vector3 | GetFollowerPosition () const |
PROUD_API void | SetWarpThreshold (double warpThreshold) |
PROUD_API bool | IsFirstUse () |
PROUD_API void | SetFollowDuration (double duration) |
PROUD_API double | GetFollowDuration () |
PROUD_API void | EnableAutoFollowDuration (bool val) |
PROUD_API void | GetTarget (Vector3 &position, Vector3 &velocity) const |
PROUD_API void | GetFollower (Vector3 &position, Vector3 &velocity) const |
PROUD_API void | SetFollower (Vector3 position, Vector3 velocity) |
virtual PROUD_API void | FrameMove (double elapsedTime) |
virtual PROUD_API void | SetTarget (Vector3 position, Vector3 velocity) |
Class that smoothing processes position,velocity of remote object that are 'jittering'ed into linear interpolation
For an example, it is useful when dead reckoning remote object.
(Later, it'd be useful if this class is strengthened to have interpolation function that converts orientation into quarternion.)
General usage
Considerations on gravity
PROUD_API void Proud::CPositionFollower::EnableAutoFollowDuration | ( | bool | val | ) |
If set as true then it automatically controls the time taken for follower to get to taget.
|
virtual |
This method must be called by each time frame.
elapsedTime | length of a frame(in second) |
PROUD_API double Proud::CPositionFollower::GetFollowDuration | ( | ) |
Outputs the last value entered to SetFollowDuration
PROUD_API void Proud::CPositionFollower::GetFollower | ( | Vector3 & | position, |
Vector3 & | velocity | ||
) | const |
TODO:translate needed. Gets position, velocity of follower
PROUD_API Vector3 Proud::CPositionFollower::GetFollowerPosition | ( | ) | const |
Gets the current location of position follower itself
PROUD_API Vector3 Proud::CPositionFollower::GetFollowerVelocity | ( | ) | const |
Gets the current speed of position follower itself
PROUD_API Vector3 Proud::CPositionFollower::GetGravity | ( | ) | const |
Gets the last input value of gravity
PROUD_API Vector3 Proud::CPositionFollower::GetSplineFollowerPosition | ( | ) | const |
Gets the location of follower that moves in spline shape
PROUD_API Vector3 Proud::CPositionFollower::GetSplineFollowerVelocity | ( | ) | const |
Gets the current speed of follower moves in spline shape
TODO:translate needed. Gets pos, vel of target that follower follows
PROUD_API Vector3 Proud::CPositionFollower::GetTargetPosition | ( | ) | const |
Get the current location of target location that position follower is following
PROUD_API Vector3 Proud::CPositionFollower::GetTargetVelocity | ( | ) | const |
Gets the current speed of target location that position follower is following
PROUD_API bool Proud::CPositionFollower::IsFirstUse | ( | ) |
FrameMove() used more than once?
PROUD_API void Proud::CPositionFollower::SetFollowDuration | ( | double | duration | ) |
Sets the time taken that follower gets to target
duration | time taken that follower gets to target (in second) |
Calls SetFollowerVelocity,SetFollowerPosition at the same time
PROUD_API void Proud::CPositionFollower::SetFollowerPosition | ( | const Vector3 & | value | ) |
Sets the location of position follower itself
PROUD_API void Proud::CPositionFollower::SetFollowerVelocity | ( | const Vector3 & | value | ) |
Sets the speed of position follower itself
PROUD_API void Proud::CPositionFollower::SetGravity | ( | const Vector3 & | value | ) |
Sets gravity
|
virtual |
Calls SetTargetPosition and SetTargetVelocity at the same time
PROUD_API void Proud::CPositionFollower::SetTargetPosition | ( | const Vector3 & | value | ) |
Sets the location of invisible object that position follower is to follow
PROUD_API void Proud::CPositionFollower::SetTargetVelocity | ( | const Vector3 & | value | ) |
Sets the speed of invisible object that position follower is to follow
PROUD_API void Proud::CPositionFollower::SetWarpThreshold | ( | double | warpThreshold | ) |
If newly received target position is too far from the location of follower, it may be location error due to intentional warp, resapwn or extreme lags. In this case, performing location correction will make the situation worse. if warp threshold is set then it does not perform correction but forcefully synchronizes follower with target location.
warpThreshold | distance as critical value that can ignore location correction |