AnyPortrait > Script > Physic Effect

Physic Effect


Physics Modifier's physics effects can be controlled by script.
You can turn physical effects on or off, and you can further control external force and pull.


public void SetPhysicEnabled ( bool isPhysicEnabled )
Description

   Turn physical effects on or off.


Parameters

   bool isPhysicEnabled : Whether the physics modifier is processed


public apForceUnit AddForce_Point ( Vector2 pointPosW, float radius )
Description

   Add a radial force based on the point.
   It returns apForceUnit, then you have to add properties.


Parameters

   Vector2 pointPosW : The position where the force is applied (World coordinate system)
   float radius : Radius of radial force


Return

   apForceUnit : Generated force


public apForceUnit AddForce_Direction ( Vector2 directionW )
Description

   Adds a directional force.
   It returns apForceUnit, then you have to add properties.


Parameters

   Vector2 directionW : The direction in which the force is applied (World coordinate system)


Return

   apForceUnit : Generated force


public apForceUnit AddForce_Direction ( Vector2 directionW,
                float waveSizeX, float waveSizeY,
                float waveTimeX, float waveTimeY )
Description

   Adds a directional force.
   It has a repetitive directional change that draws a sin curve with respect to the X and Y axes, making it suitable for expressions like wind.
   It returns apForceUnit, then you have to add properties.


Parameters

   Vector2 directionW : The direction in which the force is applied (World coordinate system)
   float waveSizeX : The maximum X value in the periodically changing direction
   float waveSizeY : The maximum Y value in the periodically changing direction
   float waveTimeX : The cycle in which the direction changes about the X axis
   float waveTime : The cycle in which the direction changes about the Y axis


Return

   apForceUnit : Generated force


public bool IsAnyForceEvent
Description

   Make sure that there is currently added force.


Return

   bool : Whether there is added forces


public Vector2 GetForce ( Vector2 targetPosW )
Description

   The calculated force is measured at the input position.


Parameters

   Vector2 targetPosW : Position to be measured (World coordinate system)


Return

   Vector2 : Measured force vector


public void ClearForce ()
Description

   Eliminate all the forces you have added with the AddForce function.


public void RemoveForce ( apForceUnit forceUnit )
1.3.2
Description

   Remove the specified force.


Parameters

   apForceUnit forceUnit : The force data you want to delete. You can get it as the return of the AddForce function.


public apPullTouch AddTouch ( Vector2 posW, float radius )
Description

   Start "pull" by touch input.


Parameters

   Vector2 posW : Touch position (World coordinate system)
   float radius : Radius to be pulled


Return

   apPullTouch : Objects distinguished by unique IDs with information about "pull by touch"


public void SetTouchPosition ( int touchID, Vector2 posW )
Description

   Updates the current position of the touch corresponding to the apPullTouch returned after the call to AddTouch.
   Select using apPullTouch.TouchID.


Parameters

   ​int touchID : ID corresponding to the TouchID of apPullTouch returned from AddTouch
   Vector2 posW : The position of the current touch​


public void SetTouchPosition ( apPullTouch touch, Vector2 posW )
Description

   Updates the current position of the touch corresponding to the apPullTouch returned after the call to AddTouch.
   Select apPullTouch by entering parameters.


Parameters

   apPullTouch touch, : The apPullTouch returned from AddTouch
   Vector2 posW : The position of the current touch


public bool IsAnyTouchEvent
Description

   Returns if there is a touch currently added.


Return

   bool : Whether there is an added touch


public apPullTouch GetTouch ( int touchID )
Description

   Returns an apPullTouch object with an ID corresponding to touchID.


Parameters

   int touchID : ID of touch event to find


Return


public void RemoveTouch ( int touchID )
public void RemoveTouch ( apPullTouch touch )
Description

   Removes the touch event object that is calculating the pulling.


Parameters

   ​int touchID : ID corresponding to the TouchID of apPullTouch returned from AddTouch
   apPullTouch touch : apPullTouch returned from AddTouch


public void ClearTouch ()
Description

   Remove all touch events.


public void ClearForceAndTouch ()
Description

   Remove all forces and touch events.