m3g/m3gcore11/inc/m3g_transformable.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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: Transformable interface
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __M3G_TRANSFORMABLE_H__
       
    19 #define __M3G_TRANSFORMABLE_H__
       
    20 
       
    21 /*!
       
    22  * \internal
       
    23  * \file
       
    24  * \brief Transformable interface
       
    25  */
       
    26 
       
    27 #include "m3g_object.h"
       
    28 
       
    29 /*----------------------------------------------------------------------
       
    30  * Class definition
       
    31  *--------------------------------------------------------------------*/
       
    32 
       
    33 /*!
       
    34  * \internal
       
    35  * \brief Transformable class virtual functions
       
    36  *
       
    37  * \note This is currently empty, but may find use in the future, so
       
    38  * we're retaining it for the time being.
       
    39  */
       
    40 typedef struct
       
    41 {
       
    42 	ObjectVFTable object;
       
    43 } TransformableVFTable;
       
    44 
       
    45 /*!
       
    46  * \internal
       
    47  * \brief Transformable object instance data
       
    48  */
       
    49 struct M3GTransformableImpl
       
    50 {
       
    51     Object object;
       
    52     
       
    53 	Quat orientation;
       
    54 	M3Gfloat sx, sy, sz;
       
    55 	M3Gfloat tx, ty, tz;
       
    56 	Matrix *matrix;
       
    57 };
       
    58 
       
    59 /* Sanity check; if this assert fires, check the compiler padding
       
    60  * settings */
       
    61 
       
    62 M3G_CT_ASSERT(sizeof(Transformable) == sizeof(Object) + 44);
       
    63 
       
    64 
       
    65 /*----------------------------------------------------------------------
       
    66  * Internal functions
       
    67  *--------------------------------------------------------------------*/
       
    68 
       
    69 static void     m3gInitTransformable    (Transformable *tf, Interface *m3g, M3GClass classID);
       
    70 static void     m3gDestroyTransformable (Object *obj);
       
    71 
       
    72 static M3Gbool  m3gGetInverseCompositeTransform (M3GTransformable handle,
       
    73                                                  M3GMatrix *transform);
       
    74 static M3Gbool  m3gTransformableIsCompatible    (M3Gint property);
       
    75 static void     m3gTransformableUpdateProperty  (Object *self, M3Gint property, M3Gint valueSize, const M3Gfloat *value);
       
    76 static M3Gbool  m3gTransformableDuplicate       (const Object *original, Object **clone, Object **pairs, M3Gint *numPairs);
       
    77 
       
    78 static void m3gInvalidateTransformable(Transformable *self);
       
    79 
       
    80 #endif /*__M3G_TRANSFORMABLE_H__*/