src/scene.c

changeset 133
823626940dc9
parent 130
c3fce2a543ee
child 136
768e6eac1ab0
equal deleted inserted replaced
132:a407a2b18c7c 133:823626940dc9
120 node->update_func(node); 120 node->update_func(node);
121 } 121 }
122 if (asc_test_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM)) { 122 if (asc_test_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM)) {
123 asc_set_flag(node->flags, ASC_SCENE_NODE_TRANSFORM_UPDATED); 123 asc_set_flag(node->flags, ASC_SCENE_NODE_TRANSFORM_UPDATED);
124 asc_clear_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM); 124 asc_clear_flag(node->flags, ASC_SCENE_NODE_UPDATE_TRANSFORM);
125 // TODO: FIXME: this makes it impossible to directly modify the transform with matrix operations! 125
126 asc_transform_from_vec3f( 126 // Only recalculate from components if not using custom transform
127 node->transform, 127 if (!asc_test_flag(node->flags, ASC_SCENE_NODE_CUSTOM_TRANSFORM)) {
128 node->position, 128 asc_transform_from_vec3f(
129 node->scale, 129 node->transform,
130 node->rotation 130 node->position,
131 ); 131 node->scale,
132 node->rotation
133 );
134 }
135
132 asc_mat4f_mulst( 136 asc_mat4f_mulst(
133 node->world_transform, 137 node->world_transform,
134 node->transform, 138 node->transform,
135 node->parent->world_transform 139 node->parent->world_transform
136 ); 140 );

mercurial