thinkingParticles 7.3

Force Input Functions

The ExpressionME-L node is able to process standard 3ds Max force fields or thinkingParticles' own Force Node. To ensure the most efficient parallel processing of particles and application of forces, create the "Group" input as the first input of the ExpressionME-L node. This will allow to use a highly efficient multi-threading method to apply force field data to particles in parallel.

Below is a list of functions and variables dedicated to handling Force-Field input.

Global Variable:

force_in_id returns the index of the input you created (starting with 0 excluding Time and On). 

 

force_in_force

Evaluates the force on a particle with the specified ID.


Parameters:

Parameter Description
pid_in The particle ID of the particle to evaluate the force on.
affect_in A boolean value indicating whether to affect the particle velocity with the force (default is False).
multiplier_in A value to multiply the force by (default is 1).
fpos_in For the Force Node,only. Sets the position of the force center.
fdir_in For the Force Node,only. Sets the direction of the force, e.g direction of a planar force.

Output:

Return Description
scalar 0: no force, or not in the force field, 1: force present

 

force_in_data

This function retrieves the force data for a given particle. It can return either a scalar or vector value, depending on the parameter passed in.

Calls:

force_in_data(data_which_in, scalar_out)
force_in_data(data_which_in, vector_out)

Parameters:

Parameter Type Description
data_which_in int Specifies which data to retrieve. Valid options are data_pos The position to which the force is applied. data_vel The sum of the force and the particle velocity. data_force The force value alone, which represents the acceleration of the particle.
scalar_out float The scalar value to be returned.
vector_out float[3] The vector value to be returned.

Returns:

There is no return value..

 

Example 1Simple force applied to the current particle

force_in_force(pid, true);

 

Example 2Do the same without affecting the particle, and set the new velocity explicitly

var nvel[3];

if(force_in_force(pid))
{

force_in_data(data_vel, nvel);

set_pdata(pid, data_vel, nvel);
}

 

©2023, cebas Visual Technology Inc.