PhysicalForce Class
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Inherits from: | Physical |
This class is used to simulate a point force that pulls physical bodies up to or away from the point. It can also rotate them around the force center.
See also#
- An article on Physical Force
- A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/physicals/ folder:
- force_00
- force_01
PhysicalForce Class
Members
static PhysicalForce ( float radius ) #
Constructor. Creates a physical force node with the specified radius in units.Arguments
- float radius - The radius of the physical force node in units.
void setAttenuation ( float attenuation ) #
Updates the attenuation factor for the physical force.Arguments
- float attenuation - Attenuation factor.
float getAttenuation ( ) #
Returns the current attenuation factor for the physical force.Return value
Attenuation factor.void setAttractor ( float attractor ) #
Updates attraction force that will be applied to objects in the physical force radius.Arguments
- float attractor - Attraction force value. If a positive value is specified, objects will be pulled away from the force point. If a negative value is specified, objects will be pulled up to the force center.
float getAttractor ( ) #
Returns the current attraction force applied to objects in the physical force radius. Positive values pull objects away from the force point, negative values pull them up to it.Return value
Attraction force value.void setRadius ( float radius ) #
Updates the radius for applying the physical force.Arguments
- float radius - Radius in units. If a negative value is provided, 0 will be used instead.
float getRadius ( ) #
Returns the current radius set for applying the physical force.Return value
Radius in units.void setRotator ( float rotator ) #
Updates rotation force that will be applied to objects in the physical force radius.Arguments
- float rotator - Rotation force value. If a positive value is specified, object will be rotated clockwise. If a negative value is specified, objects will be rotated counterclockwise.
float getRotator ( ) #
Returns the current rotation force that will be applied to objects in the physical force radius. Positive values rotate objects clockwise, negative values rotate them counterclockwise.Return value
Rotation force value.static int type ( ) #
Returns the type of the node.Return value
Physical type identifier.Last update:
2021-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)