Reactor Controllers

float_Reactor : floatController
point3_Reactor : point3Controller
position_Reactor : positionController
rotation_Reactor : rotationController
scale_Reactor : scaleController

Constructor

float_Reactor ...

point3_Reactor ...

position_Reactor ...

rotation_Reactor ...

scale_Reactor ...

Methods

createReaction <reactor_controller>

Creates a new reaction for the specified reactor controller.

deleteReaction <reactor_controller> <index_integer>

Deletes the specified reaction. <index_integer> is the reaction you want to delete. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

reactTo <reactor_controller> ( <controller> | <node> )

Sets the controller that the reactor controller reacts to. You can either specify either a controller you want to react to or a node whose world position to react to.

getReactionCount <reactor_controller>

Returns the number of reactions for the specified reactor controller.

selectReaction <reactor_controller> <index_integer>

Selects the specified reaction. <index_integer> is the reaction you want to select. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

getSelectedReactionNum <reactor_controller>

Returns the number of the selected reaction.

getReactionFalloff <reactor_controller> <index_integer>

Returns the specified reaction's falloff. <index_integer> is the reaction you want to get the falloff from. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

setReactionFalloff <reactor_controller> <index_integer> <float>

Sets the specified reaction's falloff to the specified value. <index_integer> is the reaction you want to set the falloff for. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

getReactionInfluence <reactor_controller> <index_integer>

Returns the specified reaction's influence. <index_integer> is the reaction you want to get the influence from. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

setReactionInfluence <reactor_controller> <index_integer> <float>

Sets the specified reaction's influence to the specified value. <index_integer> is the reaction you want to set the influence for. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

getReactionStrength <reactor_controller> <index_integer>

Returns the specified reaction's strength. <index_integer> is the reaction you want to get the strength from. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

setReactionStrength <reactor_controller> <index_integer> <float>

Sets the specified reaction's strength to the specified value. <index_integer> is the reaction you want to set the strength for. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

getReactionState <reactor_controller> <index_integer>

Returns the specified reaction's state. The value type returned matches the reactor controller type. <index_integer> is the reaction you want to get the state from. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

setReactionState <reactor_controller> <index_integer> <value>

Sets the specified reaction's state to the specified value. <index_integer> is the reaction you want to set the state for. The order of reactions is the order in which they are created, and the order in which the reactions are listed in. The <value> type must match the reactor controller type.

getReactionValue <reactor_controller> <index_integer>

Returns the specified reaction's value. The return value type is the same as the controller type being reacted to. <index_integer> is the reaction you want to get the value from. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

setReactionValue <reactor_controller> <index_integer> <value>

Sets the specified reaction's value to the specified value. <index_integer> is the reaction you want to set the value for. The order of reactions is the order in which they are created, and the order in which the reactions are listed in. The <value> type must match the controller type being reacted to.

setReactionName <reactor_controller> <index_integer> <string>

Sets the name of the specified reaction. <index_integer> is the reaction you want to set the name for. The order of reactions is the order in which they are created, and the order in which the reactions are listed in.

getReactionName <reactor_controller> <which>

Returns the specified reaction's name. <index_integer> is the reaction you want to get the name of. The order of reactions is the order in which they are created, and the order in which the reactions are listed in the Reactor Parameters dialog.

Example:

-- Setup a scene

b1 = box name:"box01" pos:[-32.5492,-21.2796,0] -- create two boxes

b2 = box name:"box02" pos:[51.3844,-17.2801,0]

animate on at time 100 b1.pos = [-48.2522,167.132,0] -- animate position of one box

--

-- Assign a reactor, pick the react to object, and create reactions

cont = b2.pos.controller = position_Reactor()

--

-- you can either react to a controller

reactTo cont b1.pos.controller

-- or a node (the World Space position of the box)

-- reactTo cont b1

--

slidertime = 100

createReaction cont

slidertime = 50

createReaction cont

deleteReaction cont 3

--

-- Set the reaction parameters

setReactionState cont 2 [65.8385,174.579,0]

selectReaction cont 1

setReactionInfluence cont 1 100

setReactionStrength cont 1 1.2

setReactionFalloff cont 1 1.0

setReactionValue cont 1 [-40.5492,-20.0,0]

setReactionName cont 1 "My Reaction"

--

-- get the reaction parameters

getReactionInfluence cont 1

getReactionStrength cont 1

getReactionFalloff cont 1

getReactionState cont 1

getReactionValue cont 1

getSelectedReactionNum cont

getReactionCount cont

getReactionName cont 1

See also