CHuiM3GMesh Class Reference

class CHuiM3GMesh

CHuiM3GMesh is a 3D mesh that can be used in Hitchcock UI Toolkit to incorporate M3G (Mobile 3D Graphics) objects into the user interface.

Public Member Functions
CHuiM3GMesh()
~CHuiM3GMesh()
IMPORT_C voidAnimateControllers()
IMPORT_C TIntAnimationControllerCount()
IMPORT_C voidDraw(CHuiGc &, const THuiImage *, const THuiImage *, TReal32)
IMPORT_C voidLoadSceneL(const TDesC &)
IMPORT_C voidRestoreCamera()
IMPORT_C voidRotatePitch(TReal32)
IMPORT_C voidRotateYaw(TReal32)
IMPORT_C voidSetAnimationPosition(TInt, TReal32, TInt)
IMPORT_C voidSetViewportRect(const THuiRealRect &)
IMPORT_C voidStartAnimationController(TInt)
IMPORT_C voidStopAnimationController(TInt)
IMPORT_C voidStoreCamera()
Protected Member Functions
IMPORT_C voidConstructL()
IMPORT_C voidLoadSceneL(const TDesC &, M3GInterface)
IMPORT_C voidM3GMeshExtension(const TUid &, TAny **)
IMPORT_C voidReleaseScene()
Private Member Functions
voidDoLoadSceneL(const TDesC &, M3GInterface)
voidFindObjectCenter(M3GGroup, TReal32, TBool)
voidPopulateAnimationControllerArrayL(const M3GObject)
voidRotateObjects(TReal32, TReal32, TReal32, TReal32)
Protected Attributes
TReal32 iCamRotation
TReal32 iCamTranslation
M3GCamera iCamera
RArray< THuiM3GMeshAnimationController >iControllers
TInt iNumObjects
M3GObject *iObjects
TInt iSpare
TBool iUpdateCamera
THuiRealRectiViewportRect
M3GWorld iWorld

Constructor & Destructor Documentation

CHuiM3GMesh()

IMPORT_CCHuiM3GMesh()

Default constructor.

~CHuiM3GMesh()

IMPORT_C~CHuiM3GMesh()[virtual]

Destructor.

Member Functions Documentation

AnimateControllers()

IMPORT_C voidAnimateControllers()[virtual]

Goes through animation controllers and does animations.

AnimationControllerCount()

IMPORT_C TIntAnimationControllerCount()const [virtual]

Returns number of (hitchcock) animation controllers

ConstructL()

IMPORT_C voidConstructL()[protected, virtual]

2nd phase constructor.

DoLoadSceneL(const TDesC &, M3GInterface)

voidDoLoadSceneL(const TDesC &aFileName,
M3GInterfaceaInterface
)[private]

Execute the actual scene graph loading.

Parameters

const TDesC & aFileName
M3GInterface aInterface

Draw(CHuiGc &, const THuiImage *, const THuiImage *, TReal32)

IMPORT_C voidDraw(CHuiGc &aGc,
const THuiImage *aImage = 0,
const THuiImage *aSecondaryImage = 0,
TReal32aSecondaryAlpha = 0.0
)const [virtual]

Draws the loaded M3G scene.

Parameters

CHuiGc & aGc
const THuiImage * aImage = 0
const THuiImage * aSecondaryImage = 0
TReal32 aSecondaryAlpha = 0.0

FindObjectCenter(M3GGroup, TReal32, TBool)

voidFindObjectCenter(M3GGroupaGroup,
TReal32aTrans,
TBoolaFirst = ETrue
)[private]

Finds the center point of the groups objects. Goes the groups inside the group recursively.

Parameters

M3GGroup aGroupgroup thats center position is needed
TReal32 aTranstranslation values to be returned
TBool aFirst = ETrueindicates if aTrans has been initiliazed

LoadSceneL(const TDesC &)

IMPORT_C voidLoadSceneL(const TDesC &aFileName)[virtual]

Loads an M3G scene graph from an M3G file. The M3G mesh scene graph is loaded from the file given as a parameter. If the filename string is malformed and does not adhere to file path syntax this method leaves with KErrBadName error code. If the file path is not found this method leaves with KErrPathNotFound error code. If the specified file is not found this method leaves with KErrNotFound error code. If the M3G file does not contain any M3G objects or is corrupted this method leaves with KErrCorrupt error code. If this method leaves the whole scene graph content is released. This means that no partial scene graph content can be accessed through this object.

CHuiTextureManager::ImagePath().

Parameters

const TDesC & aFileNamePath to the M3G file from which the M3G scene graph is loaded into this M3G mesh. The texture image path is prepended to this resource file name.

LoadSceneL(const TDesC &, M3GInterface)

IMPORT_C voidLoadSceneL(const TDesC &aFileName,
M3GInterfaceaInterface
)[protected]

Load scene with m3g interface parameter

Parameters

const TDesC & aFileName
M3GInterface aInterface

M3GMeshExtension(const TUid &, TAny **)

IMPORT_C voidM3GMeshExtension(const TUid &aExtensionUid,
TAny **aExtensionParams
)[protected, virtual]

Provides expandability, helps keeping the binary compatibility. Since virtual table is now exported and this class is dll derivable and the implementation is more difficult to change, hence this method, which can provide additional extension APIs.

Parameters

const TUid & aExtensionUidUID, which is being used for recognizing the extension
TAny ** aExtensionParamsReturn pointer to the extension API, once recognized from the extension uid

PopulateAnimationControllerArrayL(const M3GObject)

voidPopulateAnimationControllerArrayL(const M3GObjectaObject)[private]

Populates the iControllers array with animation controllers found from below given object in the M3G object net.

Parameters

const M3GObject aObject

ReleaseScene()

IMPORT_C voidReleaseScene()[protected, virtual]

Will release the loaded scene.

RestoreCamera()

IMPORT_C voidRestoreCamera()[virtual]

Restore camera transformations of the M3G world.

RotateObjects(TReal32, TReal32, TReal32, TReal32)

voidRotateObjects(TReal32aAngle,
TReal32aAxisX,
TReal32aAxisY,
TReal32aAxisZ
)[private]

Parameters

TReal32 aAngle
TReal32 aAxisX
TReal32 aAxisY
TReal32 aAxisZ

RotatePitch(TReal32)

IMPORT_C voidRotatePitch(TReal32aAngle)[virtual]

Rotate world around X axis.

Parameters

TReal32 aAngle

RotateYaw(TReal32)

IMPORT_C voidRotateYaw(TReal32aAngle)[virtual]

Rotate world around Y axis.

Parameters

TReal32 aAngle

SetAnimationPosition(TInt, TReal32, TInt)

IMPORT_C voidSetAnimationPosition(TIntaControllerId,
TReal32aTarget,
TIntaTime
)[virtual]

Set position of animation in animation controller.

Parameters

TInt aControllerIdID of the controller.
TReal32 aTargetTarget position in the timeline (seconds)
TInt aTimeTime to be used in animation

SetViewportRect(const THuiRealRect &)

IMPORT_C voidSetViewportRect(const THuiRealRect &aRect)[virtual]

Set viewport of the m3g mesh.

Parameters

const THuiRealRect & aRect

StartAnimationController(TInt)

IMPORT_C voidStartAnimationController(TIntaControllerId)[virtual]

Start animation of the controller

Parameters

TInt aControllerIdID of the animation controller.

StopAnimationController(TInt)

IMPORT_C voidStopAnimationController(TIntaControllerId)[virtual]

Stop animation of the controller

Parameters

TInt aControllerIdID of the animation controller.

StoreCamera()

IMPORT_C voidStoreCamera()[virtual]

Store camera transformations of the M3G world so those can be restored later on and this way animations doesn't mess with camera manipulations.

Member Data Documentation

TReal32 iCamRotation

TReal32 iCamRotation[protected]

TReal32 iCamTranslation

TReal32 iCamTranslation[protected]

M3GCamera iCamera

M3GCamera iCamera[protected]

RArray< THuiM3GMeshAnimationController > iControllers

RArray< THuiM3GMeshAnimationController >iControllers[protected]

TInt iNumObjects

TInt iNumObjects[protected]

M3GObject * iObjects

M3GObject *iObjects[protected]

TInt iSpare

TInt iSpare[protected]

Spare member to help keeping binary compatibility, since HuiM3GMesh is now dll derivable

TBool iUpdateCamera

TBool iUpdateCamera[protected]

THuiRealRect iViewportRect

THuiRealRectiViewportRect[protected]

M3GWorld iWorld

M3GWorld iWorld[protected]