Comments (2)
May be worth noting that this this cframe is being sent as part of a struct.
from bytenet.
Fixed version of the cframe type (provided by Arkiuma)
local bufferWriter = require(script.Parent.Parent.process.bufferWriter)
local types = require(script.Parent.Parent.types)
local f32NoAlloc = bufferWriter.f32NoAlloc
local alloc = bufferWriter.alloc
local cframe = {
read = function(b: buffer, cursor: number)
local x = buffer.readf32(b, cursor)
local y = buffer.readf32(b, cursor + 4)
local z = buffer.readf32(b, cursor + 8)
local rx = buffer.readf32(b, cursor + 12)
local ry = buffer.readf32(b, cursor + 16)
local rz = buffer.readf32(b, cursor + 20)
return CFrame.new(x, y, z) * CFrame.Angles(rx, ry, rz), 24
end,
write = function(value: CFrame)
local x, y, z = value.X, value.Y, value.Z
local rx, ry, rz = value:ToEulerAnglesXYZ()
-- Math done, write it now
alloc(24)
f32NoAlloc(x)
f32NoAlloc(y)
f32NoAlloc(z)
f32NoAlloc(rx)
f32NoAlloc(ry)
f32NoAlloc(rz)
end,
}
return function(): types.dataTypeInterface<CFrame>
return cframe
end
from bytenet.
Related Issues (7)
- struct's inside of array's are not typed correctly (ts) HOT 1
- `Packet:sendExcept` and `Packet:sendList` methods HOT 1
- Suggestion for even higher performance gains HOT 3
- Consistent error when firing events on PlayerAdded. HOT 2
- Packet type has invalid methods defined. HOT 4
- Using Float64 type cause error. Float32 type causes slightly malformed number. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bytenet.