webgpu-app/src/node.cpp

20 lines
460 B
C++

#include <stddef.h>
#include "memory.h"
#include "node.h"
#include "directxmath/directxmath.h"
size_t node_alloc(int count)
{
return mem_alloc((sizeof (XMFLOAT4X4)) * count);
}
void node_init_translation(size_t handle, int index, float x, float y, float z)
{
XMFLOAT4X4 * nodes = reinterpret_cast<XMFLOAT4X4 *>(handle);
//XMMATRIX XMLoadFloat4x4(&nodes[index]);
XMMATRIX mat = XMMatrixTranslation(x, y, z);
XMStoreFloat4x4(&nodes[index], mat);
}