os/graphics/m3g/m3gcore11/inc/m3g_mesh.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: Mesh interface
    15 *
    16 */
    17 
    18 #ifndef __M3G_MESH_H__
    19 #define __M3G_MESH_H__
    20 
    21 /*!
    22  * \internal
    23  * \file
    24  * \brief Mesh interface
    25  */
    26 
    27 #include "m3g_gl.h"
    28 #include "m3g_node.h"
    29 #include "m3g_appearance.h"
    30 #include "m3g_indexbuffer.h"
    31 #include "m3g_vertexbuffer.h"
    32 
    33 struct M3GMeshImpl
    34 {
    35 	Node node;
    36     
    37 	VertexBuffer *vertexBuffer;
    38 	Appearance **appearances;
    39 	IndexBuffer **indexBuffers;
    40 
    41     M3Gint vbTimestamp;
    42     
    43 	M3Gushort trianglePatchCount;
    44     M3Gushort totalAlphaFactor;
    45 };
    46 
    47 /*----------------------------------------------------------------------
    48  * Internal functions
    49  *--------------------------------------------------------------------*/
    50 
    51 static void m3gDestroyMesh(Object *obj);
    52 
    53 static M3Gint m3gMeshApplyAnimation(Object *self, M3Gint time);
    54 static M3Gbool m3gInitMesh(Interface *m3g,
    55                            Mesh *mesh,
    56                            M3GVertexBuffer hVertices,
    57                            M3GIndexBuffer *hTriangles,
    58                            M3GAppearance *hAppearances,
    59                            M3Gint trianglePatchCount,
    60                            M3GClass classID);
    61 static M3Gint m3gMeshDoGetReferences(Object *self, Object **references);
    62 static Object *m3gMeshFindID(Object *self, M3Gint userID);
    63 static M3Gbool m3gMeshDuplicate(const Object *original, Object **clone, Object **pairs, M3Gint *numPairs);
    64 static M3Gbool m3gMeshValidate(Node *self, M3Gbitmask stateBits, M3Gint scope);
    65 
    66 static M3Gbool m3gMeshRayIntersectInternal(	Mesh *mesh,
    67                                             VertexBuffer *vertices,
    68             								M3Gint mask,
    69             								M3Gfloat *ray,
    70             								RayIntersection *ri,
    71             								Matrix *toGroup);
    72 
    73 #if 0
    74 static M3Gint m3gMeshRenderingCost(const Mesh *mesh);
    75 #endif
    76 
    77 static M3Gbool m3gQueueMesh(Mesh *mesh, const Matrix *toCamera,
    78                             RenderQueue *renderQueue);
    79 
    80 
    81 #endif /*__M3G_MESH_H__*/