Skip to content

Freeze Object

Description

Causes an object to lose all internal energy, and informs Modalys to stop computing the motion of the object.

(freeze-object ... )

Syntax and Default Values

The (freeze-object ... ) function can be called using the following Lisp syntax:

(freeze-object  object_reference)

Parameters

The (freeze-object ... ) function requires just one argument:

  • object_reference: an object to be frozen.

Discussion

This function is often employed in situations where an object is no longer useful (for example a hammer that has finished striking its target). You can save computation time by not calculating the movement of the object, i.e.:

(setq h ...) ; hammer 
(setq s ...) ; string 
(setq c (make-connection 'strike s h ...)) 
... 
(run 2) ; we are sure the strike is finished by now
(destroy-connection c) 
(freeze-object h)
(run 2) ; string continues to vibrate
Another use of freeze-object is to “reset” an object's state after an event. For instance, imagine that in the above example, we want to use a force controller to push the hammer, and that we haven't destroyed the strike connection and frozen the object yet (i.e., right after the first run command). Now we might want to do another strike, but we really haven't got a clue where the hammer is because it bounced off the string and flew away into outer space. So we do the following:

(freeze-object my-hammer)
(set-info 'access-position my-hammer-mov 0.1)
(set-info 'access-position my-hammer-hit 0.1)
(unfreeze-object my-hammer)
In other words, we freeze the hammer (causing it to lose all its vibrations and energy). Then we stick numbers in the position boxes of each access on the hammer in order to “reset” their positions. Finally we unfreeze the object so that Modalys starts computing its motion again. The hammer is now ready to go again! Back in a known state.

Options

There are no special options for this function.