Commit Graph

26 Commits

Author SHA1 Message Date
Matthias Richter
40f0820d3c Add viewport support to camera (fixes #64) 2016-05-01 16:20:43 +02:00
vrld
2de9a30153 Fix #57: remove writing to global variable in smooth.linear 2015-11-27 10:34:38 +01:00
Matthias Richter
2cf3f19ff0 Fix documentation errors found by z0rg 2015-11-08 23:02:46 +01:00
Alejandro Seguí
00a3f9becc fixing scale for camera:lockWindow 2015-10-31 00:04:42 +01:00
vrld
5e02dcdba2 Fix #53: Typo in camera.lua 2015-10-16 11:20:08 +02:00
vrld
523502ca80 [camera] More consistent naming 2015-10-13 15:35:46 +02:00
Matthias Richter
f6c5f621e7 Code cleanup 2015-10-12 08:21:16 +02:00
Matthias Richter
eb05aee86f Add support for camera locking.
Currently supports:

- Position locking (lock camera at target)
- Window locking (constrain target to be inside rectangular region)
- Position smoothing (none, linear, damped)

With these you can also implement horizontal/vertical camera windows,
target focus, projected focus, etc.

See the great article "Scroll Back: The Theory and Practice of Cameras
in Side-Scrollers" by Itay Keren [1] for details.

[1] http://gamasutra.com/blogs/ItayKeren/20150511/243083/Scroll_Back_The_Theory_and_Practice_of_Cameras_in_SideScrollers.php#h.949uhirhz51j
2015-05-30 20:21:48 +02:00
Matthias Richter
8d4e5bb65f Update license header 2013-02-20 16:54:57 +01:00
Matthias Richter
bf862c9b40 Issue 9: Add camera:zoom[To]() 2012-11-01 18:59:08 +01:00
Matthias Richter
9b6aba60dd Add camera:lookAt(x,y). Augment camera:rotation([phi]). 2012-10-07 13:24:28 +02:00
Matthias Richter
0f29310dcf Remove camera dependencies. Add pos + rotation getter.
hump.camera is not independent of hump.vector-light.
camera:pos() returns the camera position.
camera:rotation() returns the camera rotation.
2012-09-10 10:38:24 +02:00
Matthias Richter
ca7977d7da Make hump.camera use vector-light 2012-04-10 17:32:01 +02:00
Matthias Richter
f5adba2cb8 Camera to require vector in any case.
Before custom vector classes named Vector or vector could override hump
vector class. This feature may result in confusing bugs, so it should
better be removed.
2012-02-17 21:13:18 +01:00
Matthias Richter
cd3df0c49f Camera: More intuitive functions names 2011-11-16 13:45:20 +01:00
Matthias Richter
28b698fb00 Eliminate use of module(...) function 2011-07-06 14:19:31 +02:00
Matthias Richter
5abd0f599d Add 'local' 2011-01-20 15:26:28 +01:00
Matthias Richter
d1d6dbb056 Make proper modules 2011-01-18 17:44:38 +01:00
Matthias Richter
d306ce88fb Fix world to camera coordinate transformation 2010-09-19 15:38:39 +02:00
Matthias Richter
8311ddbad1 Add license header 2010-09-19 15:37:55 +02:00
Matthias Richter
b8dc9b6592 Function rename 2010-09-15 11:28:06 +02:00
Matthias Richter
1f69ddb249 add functions to convert from camera coords to screen coords 2010-09-15 11:17:11 +02:00
Matthias Richter
0e6ce6d8a9 remove possible bug when converting to camera coords 2010-09-15 11:15:58 +02:00
Matthias Richter
cfd4cfb28e Function renames 2010-09-15 11:15:23 +02:00
Matthias Richter
ded2110ab3 Bug: camera:transform(p) changed argument 2010-09-03 23:39:54 +02:00
Matthias Richter
f491a92eaa Initial commit 2010-08-09 17:52:48 +02:00