This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| pf:createbond [2015/03/01 19:35] – Add detail stewbasic | pf:createbond [2015/03/04 18:32] (current) – removed pawel345 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~DISCUSSION~~ | ||
| - | <- [[pf: | ||
| - | ===== CreateBond | ||
| - | |||
| - | ^Arguments^Result^Notation^ | ||
| - | |Particle UIDs, visible, distance | Bond UID | '' | ||
| - | |||
| - | === Description === | ||
| - | Creates a bond between two particles. Set " | ||
| - | |||
| - | The command returns the bond UID, which can be passed to other bond related commands like [[pf: | ||
| - | |||
| - | === How to use === | ||
| - | |||
| - | | Standard CRPL | p1 p2 visible distance CreateBond | | ||
| - | | Warp notation | CreateBond(p1 p2 visible distance) | | ||
| - | |||
| - | === Examples === | ||
| - | |||
| - | Create two particles with a fixed distance of 40 pixels moving to the right, and capture the bond UID. | ||
| - | < | ||
| - | CreateParticle(CurrentPixelCoords 20 add 0 20 1 1) ->p1 | ||
| - | CreateParticle(CurrentPixelCoords 20 sub 0 20 1 1) ->p2 | ||
| - | CreateBond(< | ||
| - | </ | ||
| - | Instead have them move in opposite directions; the bond forces them to rotate. | ||
| - | < | ||
| - | CreateParticle(CurrentPixelCoords 20 add 0 20 1 1) ->p1 | ||
| - | CreateParticle(CurrentPixelCoords 20 sub 180 20 1 1) ->p2 | ||
| - | CreateBond(< | ||
| - | </ | ||
| - | |||
| - | === Raw Code === | ||
| - | < | ||
| - | case STATEMENT.CREATEBOND: | ||
| - | f1 = GetFloatFromStack(); | ||
| - | i3 = GetIntFromStack(); | ||
| - | i2 = GetIntFromStack(); | ||
| - | i1 = GetIntFromStack(); | ||
| - | </ | ||