@quenty/cframeserializer 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE.md +1 -1
- package/README.md +5 -13
- package/package.json +2 -2
- package/src/Shared/CFrameSerializer.lua +21 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/cframeserializer@2.0.0...@quenty/cframeserializer@2.0.1) (2021-12-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/cframeserializer
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/cframeserializer@1.2.0...@quenty/cframeserializer@2.0.0) (2021-09-05)
|
|
7
15
|
|
|
8
16
|
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## CFrameSerializer
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
@@ -13,17 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
Optimized these functions for speed as well as preserving fidality. In the future, use Roblox's orthogonal angle format.
|
|
15
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/CFrameSerializer">View docs →</a></div>
|
|
17
|
+
|
|
16
18
|
## Installation
|
|
17
19
|
```
|
|
18
20
|
npm install @quenty/cframeserializer --save
|
|
19
21
|
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
Usage is designed to be simple.
|
|
23
|
-
|
|
24
|
-
### `CFrameSerializer.outputRotationAzure(cf)`
|
|
25
|
-
|
|
26
|
-
### `CFrameSerializer.readPosition(data)`
|
|
27
|
-
|
|
28
|
-
### `CFrameSerializer.readRotationAzure(data)`
|
|
29
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/cframeserializer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Optimized these functions for speed as well as preserving fidality. In the future, use Roblox's orthogonal angle format.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d146c77d0a8e452824de0ab0b4b03ba0370bcc1b"
|
|
31
31
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Optimized these functions for speed as well as preserving fidality.
|
|
3
|
+
In the future, use Roblox's orthogonal angle format.
|
|
4
|
+
|
|
5
|
+
@class CFrameSerializer
|
|
6
|
+
]=]
|
|
4
7
|
|
|
5
8
|
local CFrameSerializer = {}
|
|
6
9
|
|
|
@@ -15,6 +18,11 @@ end
|
|
|
15
18
|
|
|
16
19
|
local PRECISION = 10000
|
|
17
20
|
|
|
21
|
+
--[=[
|
|
22
|
+
Outputs the rotation
|
|
23
|
+
@param cf CFrame
|
|
24
|
+
@return { number, number, number, number, number, number }
|
|
25
|
+
]=]
|
|
18
26
|
function CFrameSerializer.outputRotationAzure(cf)
|
|
19
27
|
local lookVector = cf.LookVector
|
|
20
28
|
local azumith = atan2(-lookVector.X, -lookVector.Z)
|
|
@@ -40,10 +48,20 @@ function CFrameSerializer.outputRotationAzure(cf)
|
|
|
40
48
|
return {px, py, pz, azumith, roll, elevation}
|
|
41
49
|
end
|
|
42
50
|
|
|
51
|
+
--[=[
|
|
52
|
+
Returns the position
|
|
53
|
+
@param data { number, number, number, number, number, number }
|
|
54
|
+
@return Vector3
|
|
55
|
+
]=]
|
|
43
56
|
function CFrameSerializer.readPosition(data)
|
|
44
57
|
return Vector3.new(data[1], data[2], data[3])
|
|
45
58
|
end
|
|
46
59
|
|
|
60
|
+
--[=[
|
|
61
|
+
Returns the CFrame
|
|
62
|
+
@param data { number, number, number, number, number, number }
|
|
63
|
+
@return Vector3
|
|
64
|
+
]=]
|
|
47
65
|
function CFrameSerializer.readRotationAzure(data)
|
|
48
66
|
local azumith = data[4]
|
|
49
67
|
local roll = data[5] --Buffer:ReadSigned(21)
|