Wednesday, September 15, 2010

Due to Popular Demand...

My Physics Flowgraph





Explanation


The reason i created this flowgraph was because I couldn't find away to toggle the physics on and off without the engine crashing. The "," key is built into the engine to pause the physics but this would cause the editor to instantly crash, so i created this flow graph to pause and un pause the physics at will. Originally i was hoping to be able to pause the physics and then re-enable them and have the objects continue the pre-frozen trajectory but this was not the case. However when the physics were disabled, i was able to move the entity without worry of collision just like a "brush object".

How it works...


On key press a condition is called (which is initially set to false), then from there a TooBoolean module is called as is the PhysicsEnable Module from the same outputs of the condition. I like to think of the condition as "Is the Physics Frozen" in this case. From the False Output of the condition the Physics are then Disabled as well as a new input to the condition to make the condition true. This input comes from the ToBoolean module that with the combination of inputs and outputs im using, outputs the opposite of the input. This way a loop is created in a away so that the physics can be enabled and disabled at will.

No comments:

Post a Comment