Minor cleanup.

This commit is contained in:
Martin Felis 2025-04-11 09:59:04 +02:00
parent c173707a18
commit 3b5537fc9d
4 changed files with 22 additions and 30 deletions

View File

@ -129,7 +129,7 @@ struct AnimGraphBlendTree : public AnimNode {
* *
* @tparam T Type of the Socket. * @tparam T Type of the Socket.
* @param name Name of the Socket. * @param name Name of the Socket.
* @param value_ptr Pointer where the graph output output is written to at the end of evaluation. * @param value_ptr Pointer where the graph output is written to at the end of evaluation.
*/ */
template <typename T> template <typename T>
void SetOutput(const char* name, T* value_ptr) { void SetOutput(const char* name, T* value_ptr) {

View File

@ -380,11 +380,6 @@ struct NodeDescriptorBase {
*socket->m_reference.ptr_ptr = value_ptr; *socket->m_reference.ptr_ptr = value_ptr;
} }
void SetOutputUnchecked(const char* name, void* value_ptr) {
Socket* socket = FindSocket(name, m_outputs);
*socket->m_reference.ptr_ptr = value_ptr;
}
Socket* GetOutputSocket(const char* name) const { Socket* GetOutputSocket(const char* name) const {
return FindSocket(name, m_outputs); return FindSocket(name, m_outputs);
} }

View File

@ -42,8 +42,8 @@ inline void Camera_Init(Camera* camera) {
camera->pitch = 10 * M_PI / 180.0f; camera->pitch = 10 * M_PI / 180.0f;
memcpy(&camera->mtxView, &mtx_identity, sizeof(camera->mtxView)); memcpy(&camera->mtxView, &mtx_identity, sizeof(camera->mtxView));
Camera_CalcToMatrix(camera, &camera->mtxView); Camera_CalcToMatrix(camera, &camera->mtxView[0]);
Camera_CalcFromMatrix(camera, &camera->mtxView); Camera_CalcFromMatrix(camera, &camera->mtxView[0]);
} }
void Camera_CalcFromMatrix(Camera* camera, float* mat) { void Camera_CalcFromMatrix(Camera* camera, float* mat) {
@ -87,7 +87,8 @@ void Camera_CalcToMatrix(Camera* camera, float* mat) {
const float d = 10.0f; const float d = 10.0f;
simd4f eye = simd4f_create (camera->pos[0], camera->pos[1], camera->pos[2], 1.f); simd4f eye =
simd4f_create(camera->pos[0], camera->pos[1], camera->pos[2], 1.f);
simd4f forward = simd4f_create(-cp * ch, -sp, cp * sh, 0.f); simd4f forward = simd4f_create(-cp * ch, -sp, cp * sh, 0.f);
simd4f right = simd4f_cross3(forward, simd4f_create(0.f, 1.f, 0.f, 1.f)); simd4f right = simd4f_cross3(forward, simd4f_create(0.f, 1.f, 0.f, 1.f));
simd4f up = simd4f_cross3(right, forward); simd4f up = simd4f_cross3(right, forward);
@ -153,6 +154,6 @@ inline void Camera_Update(
camera->vel[i] = camera->vel[i] * 0.1; camera->vel[i] = camera->vel[i] * 0.1;
} }
Camera_CalcToMatrix(camera, &camera->mtxView); Camera_CalcToMatrix(camera, &camera->mtxView[0]);
} }
} }

View File

@ -175,10 +175,6 @@ TEST_CASE_METHOD(
AnimNodeResource* blend_node = blend_tree_resource->GetNode(blend_node_index); AnimNodeResource* blend_node = blend_tree_resource->GetNode(blend_node_index);
blend_node->m_name = "BlendWalkRun"; blend_node->m_name = "BlendWalkRun";
// Setup graph outputs and inputs
AnimNodeResource* graph_output_node =
blend_tree_resource->GetGraphOutputNode();
blend_tree_resource->RegisterBlendTreeInputSocket<float>("GraphFloatInput"); blend_tree_resource->RegisterBlendTreeInputSocket<float>("GraphFloatInput");
// Wire up nodes // Wire up nodes