Skip to content

KorolevSoftware/defold-faststream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastStream Defold Extension

FastStream is a Defold extension that provides efficient buffer stream operations for handling vector data.

API Reference

Functions

faststream.set_table_raw(stream, table)

Sets multiple vector values from a table to the buffer stream without converting values to stream type. The table should contain either Vector3 or Vector4 values.

Parameters:

  • stream (userdata) - The buffer stream to modify
  • table (table) - Table containing Vector3 or Vector4 values to set

faststream.set_table_universal(stream, table)

Sets multiple values from a table to the buffer stream. Supports Vector3, Vector4, or number values.

Parameters:

  • stream (userdata) - The buffer stream to modify
  • table (table) - Table containing Vector3, Vector4, or number values to set

faststream.set_vector2(stream, index, vector)

Sets a Vector3 value at the specified index in the buffer stream.

Parameters:

  • stream (userdata) - The buffer stream to modify
  • index (number) - The 1-based index where to set the vector
  • vector (vector3) - The Vector3 value to set (x,y components will be used)

faststream.set_vector3(stream, index, vector)

Sets a Vector3 value at the specified index in the buffer stream.

Parameters:

  • stream (userdata) - The buffer stream to modify
  • index (number) - The 1-based index where to set the vector
  • vector (vector3) - The Vector3 value to set

faststream.set_vector4(stream, index, vector)

Sets a Vector4 value at the specified index in the buffer stream.

Parameters:

  • stream (userdata) - The buffer stream to modify
  • index (number) - The 1-based index where to set the vector
  • vector (vector4) - The Vector4 value to set

Usage Examples

-- Set a single Vector3 value
local stream = ... -- your buffer stream, like buffer.get_stream(buf, "position")
local vector = vmath.vector3(1, 2, 3)
faststream.set_vector3(stream, 1, vector)

-- Set multiple values using a table
local values = {
    vmath.vector3(1, 2, 3),
    vmath.vector3(4, 5, 6),
    vmath.vector3(7, 8, 9)
}
faststream.set_table_universal(stream, values)

-- Set raw vector values without conversion
local raw_values = {
    vmath.vector4(1, 2, 3, 4),
    vmath.vector4(5, 6, 7, 8)
}
faststream.set_table_raw(stream, raw_values)

About

This library help fast push vector vector 3, vector 4, to buffer stream

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •