| 1 | = Howto Scriptable Camera = |
| 2 | {{{ |
| 3 | #!html |
| 4 | <div style="border:1px outset #8c5b00;padding: 0.5em 1em 0.5em 1em;background: #ffe17b;-moz-border-radius:10px"><table style="width:100%"><tr><td align="left"> |
| 5 | }}} |
| 6 | [[Image(icons:archive.png, 50)]] |
| 7 | {{{ |
| 8 | #!html |
| 9 | </td><td align="center"><b>This is an archived page!</b><br/>This page is very old and the content is not up to date.<br/>Not everything (if any) which is written here will be in the final game!</td><td align="right"> |
| 10 | }}} |
| 11 | [[Image(icons:archive.png, 50)]] |
| 12 | {{{ |
| 13 | #!html |
| 14 | </td></tr></table></div> |
| 15 | }}} |
| 16 | |
| 17 | To use it, just use the CameraMan class. |
| 18 | The basic principle is that the camera is always attached |
| 19 | to something. |
| 20 | |
| 21 | There are two different attach modes: |
| 22 | |
| 23 | * attaching it to a world entity |
| 24 | and that's it! The camera follows it. |
| 25 | |
| 26 | * attaching it to a virtual pnode |
| 27 | This mode is used to move the camera independently. |
| 28 | Internal it's done by moving the virtual pnode. |
| 29 | |
| 30 | To attach the cam to a pnode use |
| 31 | {{{ |
| 32 | attach(pnode*) |
| 33 | }}} |
| 34 | To detach the cam (that means to attach it to the virtual |
| 35 | pnode) use |
| 36 | {{{ |
| 37 | detach(). |
| 38 | }}} |
| 39 | |
| 40 | |
| 41 | The CameraMan helps you to manage your cameras. |
| 42 | Every method with the key word '''Curr''' in its name |
| 43 | will apply the change on the current cam ;) |
| 44 | |
| 45 | If you want to apply some changes on an inactive |
| 46 | camera just forget the '''Curr''' key word and put instead |
| 47 | the number of the cam you wish to modify into the |
| 48 | argument of the method you're using. |
| 49 | |
| 50 | == Example: == |
| 51 | |
| 52 | If you want to tell the current camera to look at a |
| 53 | specific pnode you'll just have to use |
| 54 | {{{ |
| 55 | changeCurrTarget(pnode*) |
| 56 | }}} |
| 57 | |
| 58 | You can change the target of any camera. just put the camera number into the method's argument. |
| 59 | {{{ |
| 60 | changeTarget(Pnode*, cameraNumber) |
| 61 | }}} |
| 62 | |
| 63 | '''Note:''' The camera numbers are given in the order of creating it. The first camera which is attached to the playable by default is number 0. Nothing should happen if you try to use a camera number which doesn't exists ;) |
| 64 | |
| 65 | |
| 66 | There are more nice methods in the CameraMan class. For example to create a new cam, set a cam as the current cam etc. |
| 67 | |
| 68 | http://doc.orxonox.net for more information |
| 69 | or cameraman.h |
| 70 | |
| 71 | |