World Space Modifiers - Force-Related Methods

The following methods can be used to calculate forces defined by World Space Modifiers (Space Warps).

These methods are available in 3ds Max 2008 and higher. They were previously available in the Avguard Extensions.

WSMApplyFC <WSM_node_array> <pos_point3_array> <vel_point3_array> <force_point3_array> interval:<interval> stepsize:<time>

Applies force-field (Particles & Dynamics + Displace) and deflector (Particles Only) type Space Warps to the position, velocity, and force array values.

Units:

The position values are in 3ds Max units, the velocity values are in 3ds Max units/tick, the force values are in 3ds Max units/tick^2 (mass assumed to be == 1).

The position, velocity, and force arrays must be the same size.

Evaluation Interval and Order:

The effects of the space warps are evaluated over the specified interval, with a default interval of (interval currenttime (currenttime+1f)), using the specified stepsize, with a default of 1 frame.

The effect of the force-field space warps are first evaluated in the order specified, followed by the deflector space warps in the order specified.

The values in the position, velocity, and force arrays are replaced with the results of the evaluation of the effects of the space warps

The supplied force values are applied prior to the space warps being applied.

Initial Values:

Normally you want to set the force array to contain values of [0,0,0] prior to calling this method. Only if you are calculating an additional force in your script would you set the force array to other values. The position and velocity arrays would normally contain the results of the last call to this method.

Supported Space Warps:

Any force-field space warp, including 3rd party plug-ins, should work correctly.

Only the deflector space warps that ship with 3ds Max are supported.

The Path Follow space warp is not supported as it requires a particle system.

EXAMPLE USAGE:

(
resetMaxFile #noPrompt
gravity pos:[41.7827,242.9,0] isSelected:on iconSize:33.4742 transform:(matrix3 [1,0,0] [0,-1,0] [0,0,-1] [41.7827,242.9,0])
Deflector bounce:1 width:101.617 length:74.9636 transform:(matrix3 [1,0,0] [0,0.751713,0.659491] [0,-0.659491,0.751713] [16.7722,4.28949,-146.329])
posArray=#([10,0,0],[10,10,0])
velArray=#([0,0,0],[0,0,0])
forceArray=#([0,0,0],[0,0,0])
for i = 0 to 40 do(
point pos:posArray[1] wirecolor:red
point pos:posArray[2] wirecolor:blue
at time i WSMApplyFC #($gravity01,$deflector01) posArray velArray forceArray
)
)
 

<bool>WSMSupportsForce <node> 	 

Returns true if the specified node can be used as a force-field type space warp for WSMApplyFC().

   

<bool>WSMSupportsCollision <node>   

Returns true if the specified node can be used as a deflector type space warp for WSMApplyFC().