Ejemplo n.º 1
0
/** Builds a scaling matrix */
kmMat3* const kmMat3Scaling(kmMat3* pOut, const kmScalar x, const kmScalar y)
{
//	memset(pOut->mat, 0, sizeof(float) * 9);
	kmMat3Identity(pOut);
	pOut->mat[0] = x;
	pOut->mat[4] = y;

	return pOut;
}
Ejemplo n.º 2
0
kmMat3* const kmMat3Translation(kmMat3* pOut, const kmScalar x, const kmScalar y)
{
//    memset(pOut->mat, 0, sizeof(float) * 9);
	kmMat3Identity(pOut);
	pOut->mat[6] = x;
	pOut->mat[7] = y;
//    pOut->mat[8] = 1.0;

    return pOut;
}
Ejemplo n.º 3
0
lite3d_scene_node *lite3d_scene_node_init(lite3d_scene_node *node)
{
    SDL_assert(node);
    memset(node, 0, sizeof (lite3d_scene_node));
    lite3d_list_link_init(&node->nodeLink);
    kmMat4Identity(&node->localView);
    kmMat4Identity(&node->worldView);
    kmMat3Identity(&node->normalModel);
    kmQuaternionIdentity(&node->rotation);
    kmVec3Fill(&node->position, 0, 0, 0);
    kmVec3Fill(&node->scale, 1.0f, 1.0f, 1.0f);
    node->recalc = LITE3D_TRUE;
    node->invalidated = LITE3D_TRUE;
    node->rotationCentered = LITE3D_TRUE;
    node->isCamera = LITE3D_FALSE;
    node->renderable = LITE3D_TRUE;
    node->enabled = LITE3D_TRUE;
    node->visible = LITE3D_TRUE;
    node->frustumTest = LITE3D_TRUE;
    lite3d_list_init(&node->childNodes);

    return node;
}