/*********************************************************************************************************************** * * Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc. * The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret * as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event * of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized * employees of Tech Soft 3D, Inc. is granted only under a written non-disclosure agreement, expressly prescribing the * scope and manner of such use. * ***********************************************************************************************************************/ /** \file AnimDefStep4.cpp Animation for Step 4 ***********************************************************************************************************************/ // Do not define INITIALIZE_A3D_API here. It should be only included once in a project. #include "AnimDef.hpp" //###################################################################################################################### /* Orbit back to the front of the micro engine Pause 1 second. Change color of the front casing from original color to yellow three times over one second. Pause 0.5 seconds and then remove the casing */ A3DStatus BuildAnimationStep4(A3DPDFAnimation **ppAnim, double dStepInitTimeOffset, double& dStepTimeDuration) { A3DStatus iRet = A3D_SUCCESS; // ANIMATION = set of MOTIONS const int INBMOTIONS = 20; A3DPDFAnimMotion** ppMotion; ppMotion = (A3DPDFAnimMotion**) malloc(INBMOTIONS * A3DUns32(sizeof(A3DPDFAnimMotion*))); int idxMotion = 0; double dInitTimeOffset = dStepInitTimeOffset; double dTimeDuration; // MOTIONS to specify init state CreateMotionsInitState(ppMotion, idxMotion, 4, dInitTimeOffset, dTimeDuration); dInitTimeOffset += dTimeDuration; // MOTION CAMERA CreateMotionCameraInit(ppMotion, idxMotion, 143.727493, -160.918030, -101.847794, 44.578068, 19.042654, -51.351418, 0.875282, 0.410491, 0.255690, 10, kA3DPDFOrthographicMode, 1.0/(2*59), 365.935852, 286.484344, 218.981415, 14.348255, 10.195333, -58.078251, -0.390901, -0.354405, 0.849470, 10, kA3DPDFOrthographicMode, 1.0/(2*149), dInitTimeOffset, dTimeDuration); dInitTimeOffset += dTimeDuration; // MOTION 1 // Flash the color of the front casing to yellow three times over one second. CreateMotionFlash(ppMotion, idxMotion, ppTargetsHousingFront, idxTargetsHousingFront, 54.0/255.0, 188.0/255.0, 252.0/255.0, // color init 1, 1, 0, // color blink kA3DPDFRenderingSolid, dInitTimeOffset, dTimeDuration); dInitTimeOffset += dTimeDuration; // MOTION 2 // Pause 0.5 seconds and then remove the front casing. dInitTimeOffset += PAUSEDEMISEC; CreateMotionMoveAndHide(ppMotion, idxMotion, ppTargetsHousingFront, idxTargetsHousingFront, 0.0, 0.0, 0.0, // init pos +80.0, 0.0, 0.0, // translation to apply 54.0/255.0, 188.0/255.0, 252.0/255.0, // color init true, //bHide kA3DPDFRenderingSolid, dInitTimeOffset, dTimeDuration); dInitTimeOffset += dTimeDuration; dStepTimeDuration = dInitTimeOffset - dStepInitTimeOffset; // --- ANIMATION CREATION A3DPDFAnimationData sAnimationData; A3D_INITIALIZE_DATA(A3DPDFAnimationData, sAnimationData); sAnimationData.m_pcName = const_cast("step4"); sAnimationData.m_iFramesPerSecond = 20; sAnimationData.m_iNumAnimationMotions = idxMotion; sAnimationData.m_ppAnimationMotions = ppMotion; iRet = A3DPDFAnimationCreate(&sAnimationData, ppAnim); return iRet; }