Quantcast
Viewing all articles
Browse latest Browse all 169

Lib3D-v3 (3.10)

Change Log:
--------------------
v3.10
- the Is* functions will now return proper booleans instead of truthy/falsy values

v3.9
- fixed typo that caused a nil error

v3.8
- added zoneMeasurement objects. You can query them via lib:GetZoneMeasurementForZoneId(zoneId) and then use zoneMeasurement:LocalToWorld etc.
This is just to help addons cache results, the old functions are still available.
- when the player enters a loading screen, the library will reset.
This way the conversion functions will not return wrong result if your addon does something after the loading screen, before the library measured the zone.

v3.4
- fixed WorldToGlobal conversion

v3.3
- fixed a bug where the coordinate conversion would not work when leaving and re-visiting a zone.

v3.2
- updated to standalone version.

Description:
--------------------
This library offers utility functions for the 3D control API, such as

converting between 3D API coordinates and 2D map coordinates
converting 2D map distances and "real" distances in meters
functions to obtain the player's 3D position



How To Use:
Add Lib3D as DependsOn library, i.e. in your addon's manifest you should write

## DependsOn: Lib3D

And either install this library directly, or include it in your addon.
Note that this library depends on LibGPS, so you need to install/include LibGPS as well.

Coordinate Systems

There exist 4 different coordinate systems:
Local:
The coordinates with respect to the currently open 2D map (see LibGPS)
(0,0) is the top left corner and (1,1) is the bottom right corner of the current 2D map.
Global:
The coordinates with respect to the Tamriel 2D map (see LibGPS)
(0,0) is the top left corner and (1,1) is the bottom right corner of the Tamriel 2D map.
Note that these coords can be negative for zones such as Coldharbor.
GUI (also called 3DRenderSpace):
The coordinates used by ZOS' 3D controls API. 1 unit is 1 meter, but the origin of the coordinate system changes over time.
E.g. when moving 1km away from the GUI origin, the current player position becomes the new origin.
(0,y,0) is a point at the current world origin and at height y.
(1,y,0) is 1 meter to the east, while (0,y,1) is 1 meter to the south.
When the origin moves, ZOS' 3D control API will automatically move all 3D-TopLevelControls as well, so the controls are still visible at the correct locations. Just something I want to point out, because this means the result of TopLevelControl:Get3DRenderSpaceOrigin() can change without you calling TopLevelControl:Set3DRenderSpaceOrigin(x,y,z) !
World (ZOS):[/C...

Viewing all articles
Browse latest Browse all 169

Trending Articles