Public Member Functions | |
void | SetGravity (const Vector3 &value) |
void | SetTargetVelocity (const Vector3 &value) |
void | SetTargetPosition (const Vector3 &value) |
Vector3 | GetSplineFollowerPosition () const |
Vector3 | GetSplineFollowerVelocity () const |
Vector3 | GetGravity () const |
Vector3 | GetTargetVelocity () const |
Vector3 | GetTargetPosition () const |
void | SetFollowerVelocity (const Vector3 &value) |
void | SetFollowerPosition (const Vector3 &value) |
Vector3 | GetFollowerVelocity () const |
Vector3 | GetFollowerPosition () const |
void | SetWarpThreshold (double warpThreshold) |
bool | IsFirstUse () |
void | SetFollowDuration (double duration) |
double | GetFollowDuration () |
void | EnableAutoFollowDuration (bool val) |
void | GetTarget (Vector3 &position, Vector3 &velocity) const |
void | GetFollower (Vector3 &position, Vector3 &velocity) const |
void | SetFollower (Vector3 position, Vector3 velocity) |
virtual void | FrameMove (double elapsedTime) |
virtual 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
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) |
double Proud::CPositionFollower::GetFollowDuration | ( | ) |
Outputs the last value entered to SetFollowDuration
TODO:translate needed. Gets position, velocity of follower
Vector3 Proud::CPositionFollower::GetFollowerPosition | ( | ) | const |
Gets the current location of position follower itself
Vector3 Proud::CPositionFollower::GetFollowerVelocity | ( | ) | const |
Gets the current speed of position follower itself
Vector3 Proud::CPositionFollower::GetGravity | ( | ) | const |
Gets the last input value of gravity
Vector3 Proud::CPositionFollower::GetSplineFollowerPosition | ( | ) | const |
Gets the location of follower that moves in spline shape
Vector3 Proud::CPositionFollower::GetSplineFollowerVelocity | ( | ) | const |
Gets the current speed of follower moves in spline shape
TODO:translate needed. Calculate the pos and vel of the target followed by the follower.
position | Vector 3 location of the target to be obtained for the position. |
velocity | Vector 3 speed of the target to be obtained for the velocity. |
Vector3 Proud::CPositionFollower::GetTargetPosition | ( | ) | const |
Get the current location of target location that position follower is following
Vector3 Proud::CPositionFollower::GetTargetVelocity | ( | ) | const |
Gets the current speed of target location that position follower is following
bool Proud::CPositionFollower::IsFirstUse | ( | ) |
FrameMove() used more than once?
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
void Proud::CPositionFollower::SetFollowerPosition | ( | const Vector3 & | value | ) |
Sets the location of position follower itself
void Proud::CPositionFollower::SetFollowerVelocity | ( | const Vector3 & | value | ) |
Sets the speed of position follower itself
void Proud::CPositionFollower::SetGravity | ( | const Vector3 & | value | ) |
Sets gravity
Calls SetTargetPosition and SetTargetVelocity at the same time
void Proud::CPositionFollower::SetTargetPosition | ( | const Vector3 & | value | ) |
Sets the location of invisible object that position follower is to follow
void Proud::CPositionFollower::SetTargetVelocity | ( | const Vector3 & | value | ) |
Sets the speed of invisible object that position follower is to follow
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 |