mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-20 16:39:57 +00:00
Merge branch 'fix_lua_doc_transform' into 'master'
[Lua] Fix usage example of util.transform in documentation See merge request OpenMW/openmw!3184
This commit is contained in:
commit
5a871d4b27
1 changed files with 2 additions and 2 deletions
|
@ -588,12 +588,12 @@
|
|||
-- @usage
|
||||
-- local util = require('openmw.util')
|
||||
-- local trans = util.transform
|
||||
-- local fromActorSpace = trans.move(actor.position) * trans.rotateZ(actor.rotation.z)
|
||||
-- local fromActorSpace = trans.move(actor.position) * trans.rotateZ(actor.rotation:getYaw())
|
||||
--
|
||||
-- -- rotation is applied first, movement is second
|
||||
-- local posBehindActor = fromActorSpace * util.vector3(0, -100, 0)
|
||||
--
|
||||
-- -- equivalent to trans.rotateZ(-actor.rotation.z) * trans.move(-actor.position)
|
||||
-- -- equivalent to trans.rotateZ(-actor.rotation:getYaw()) * trans.move(-actor.position)
|
||||
-- local toActorSpace = fromActorSpace:inverse()
|
||||
-- local relativeTargetPos = toActorSpace * target.position
|
||||
-- local deltaAngle = math.atan2(relativeTargetPos.y, relativeTargetPos.x)
|
||||
|
|
Loading…
Reference in a new issue