TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iDampedSpringPosition2 Struct Referenceabstract
Inheritance diagram for iDampedSpringPosition2:
iDampedSpring2 iUnknown

Detailed Description

2D Damped spring position interface.

Public Member Functions

virtual void SetIdealPosition (const sVec2f &avPos)=0
 Set the ideal (target) position of the spring. {Property}. More...
 
virtual sVec2f GetIdealPosition () const =0
 Get the ideal (target) position of the spring. {Property}. More...
 
virtual void SetCurrentPosition (const sVec2f &avPos)=0
 Set the current position of the spring. {Property}. More...
 
virtual sVec2f GetCurrentPosition () const =0
 Get the current position of the spring. {Property}. More...
 
virtual sVec2f UpdatePosition (ni::tF32 afDeltaTime)=0
 Update the current position of the spring. More...
 
virtual void SetStep (tF32 afD)=0
 Set the maximum update step size. {Property}. More...
 
virtual tF32 GetStep () const =0
 Get the update step size. {Property}. More...
 
virtual void SetSpeed (tF32 afD)=0
 Set the animation speed. {Property}. More...
 
virtual tF32 GetSpeed () const =0
 Get the animation speed. {Property}. More...
 
virtual void SetEndThreshold (tF32 afD)=0
 Set the end threshold. {Property}. More...
 
virtual tF32 GetEndThreshold () const =0
 Get the end threshold. {Property}. More...
 
virtual tBool GetIsEnded () const =0
 Get the whether the distance between the ideal and the current positions are below the end threshold. {Property}. More...
 
- Public Member Functions inherited from iDampedSpring2
virtual void SetKd (tF32 afD)=0
 Set the Kd constant. {Property}. More...
 
virtual tF32 GetKd () const =0
 Get the Kd constant. {Property}. More...
 
virtual void SetKs (tF32 afD)=0
 Set the Ks constant. {Property}. More...
 
virtual tF32 GetKs () const =0
 Get the Ks constant. {Property}. More...
 
virtual void SetStiffnessAndDampingRatio (tF32 afKs, tF32 afE)=0
 Set the value of Kd for the specified Ks that will result in a spring with the specified damping ratio. More...
 
virtual void SetDampingRatio (tF32 afE)=0
 Set the spring's damping ratio. {Property}. More...
 
virtual tF32 GetDampingRatio () const =0
 Get the spring's damping ratio. {Property}. More...
 
virtual void SetVelocity (const sVec2f &avVel)=0
 Set the spring's velocity. {Property}. More...
 
virtual sVec2f GetVelocity () const =0
 Get the spring's velocity. {Property}. More...
 
virtual sVec2f ComputeAcceleration (const sVec2f &avD)=0
 Compute the spring's acceleration for the specified displacement. More...
 
virtual void UpdateVelocity (ni::tF32 afDeltaTime, const sVec2f &avD)=0
 Update the spring's velocity from the specified displacement. More...
 
virtual void UpdateVelocityWithAcceleration (ni::tF32 afDeltaTime, const sVec2f &avAcc)=0
 Update the spring's velocity from the specified acceleration. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual void SetIdealPosition ( const sVec2f avPos)
pure virtual

Set the ideal (target) position of the spring. {Property}.

virtual sVec2f GetIdealPosition ( ) const
pure virtual

Get the ideal (target) position of the spring. {Property}.

virtual void SetCurrentPosition ( const sVec2f avPos)
pure virtual

Set the current position of the spring. {Property}.

virtual sVec2f GetCurrentPosition ( ) const
pure virtual

Get the current position of the spring. {Property}.

virtual sVec2f UpdatePosition ( ni::tF32  afDeltaTime)
pure virtual

Update the current position of the spring.

Returns
The current position of the spring.
virtual void SetStep ( tF32  afD)
pure virtual

Set the maximum update step size. {Property}.

Remarks
Default is 1.0/50.0
If the step is zero the value is updated at once in UpdatePosition (effectivly disable step update)
virtual tF32 GetStep ( ) const
pure virtual

Get the update step size. {Property}.

virtual void SetSpeed ( tF32  afD)
pure virtual

Set the animation speed. {Property}.

Remarks
This value just multiplies afDeltaTime to ariticially speed up the spring's animation.
Default is 1.0.
virtual tF32 GetSpeed ( ) const
pure virtual

Get the animation speed. {Property}.

virtual void SetEndThreshold ( tF32  afD)
pure virtual

Set the end threshold. {Property}.

Remarks
Default is 1e-3f
virtual tF32 GetEndThreshold ( ) const
pure virtual

Get the end threshold. {Property}.

virtual tBool GetIsEnded ( ) const
pure virtual

Get the whether the distance between the ideal and the current positions are below the end threshold. {Property}.