1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Merge branch 'addpropstartingposandrot' into 'master'

Add startingPosition and startingRotation property to GameObject

See merge request OpenMW/openmw!3106
This commit is contained in:
psi29a 2023-06-06 13:16:33 +00:00
commit 54b0ab9e01
2 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,10 @@ namespace MWLua
[](const ObjectT& o) -> osg::Vec3f { return o.ptr().getRefData().getPosition().asVec3(); });
objectT["rotation"] = sol::readonly_property(
[](const ObjectT& o) -> osg::Vec3f { return o.ptr().getRefData().getPosition().asRotationVec3(); });
objectT["startingPosition"] = sol::readonly_property(
[](const ObjectT& o) -> osg::Vec3f { return o.ptr().getCellRef().getPosition().asVec3(); });
objectT["startingRotation"] = sol::readonly_property(
[](const ObjectT& o) -> osg::Vec3f { return o.ptr().getCellRef().getPosition().asRotationVec3(); });
objectT["getBoundingBox"] = [](const ObjectT& o) {
MWRender::RenderingManager* renderingManager
= MWBase::Environment::get().getWorld()->getRenderingManager();

View File

@ -111,6 +111,8 @@
-- @field #boolean enabled Whether the object is enabled or disabled. Global scripts can set the value. Items in containers or inventories can't be disabled.
-- @field openmw.util#Vector3 position Object position.
-- @field openmw.util#Vector3 rotation Object rotation (ZXY order).
-- @field openmw.util#Vector3 startingPosition The object original position
-- @field openmw.util#Vector3 startingRotation The object original rotation
-- @field #string ownerRecordId NPC who owns the object (nil if missing). Global and self scripts can set the value.
-- @field #string ownerFactionId Faction who owns the object (nil if missing). Global and self scripts can set the value.
-- @field #number ownerFactionRank Rank required to be allowed to pick up the object. Global and self scripts can set the value.