Skip to content
This repository was archived by the owner on Jan 3, 2019. It is now read-only.

[proposition] Serialisation of standard types #5

Open
frankiezafe opened this issue Mar 14, 2018 · 2 comments
Open

[proposition] Serialisation of standard types #5

frankiezafe opened this issue Mar 14, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@frankiezafe
Copy link
Contributor

frankiezafe commented Mar 14, 2018

In the idea of VVVV osc implementation, adding methods to pack and unpack vector2, vector3, vector4, quaternion, matrix3x3 and matrix4x4, with or without adding special types in the OSC messages.

For instance, you do:

var va = Vector3(1,2,3)
var vb = Vector3(4,5,6)
setAddress("/test")
appendV3(va)
appendV3(vb)

to send and to retrieve, you do:

var va = msg.getAsV3(0)
var vb = msg.getAsV3(3)

If no new types are added, the vectors and matrices are sent as an array of floats. Therefore, it is always possible to retrieve them by doing:

var x = msg.getAsFloat(0)
var y = msg.getAsFloat(1)
var z = msg.getAsFloat(2)

I did something like that in another implementation, and it is quite practical to serialise info from the 3d world.

@frankiezafe frankiezafe changed the title Serialisation of standard types [proposition] [proposition] Serialisation of standard types Mar 14, 2018
@djiamnot
Copy link
Owner

Yeah, it's definitely worth it. Ultimately, it should support the OSC spec (http://opensoundcontrol.org/spec-1_0) and utility function specific for Godot are definitely useful, including serialization.

@frankiezafe
Copy link
Contributor Author

sending part is done in OSCsender for vector2, vector3, quaternion and transform

@djiamnot djiamnot added the enhancement New feature or request label Mar 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants