18 #include "ScriptProcessor.h"
35 #pragma region Variables
37 #pragma region ProjectVariables
180 #pragma region UnitScalingVariables
204 #pragma region EnvironmentVariables
238 double m_dblTimeStep;
329 #pragma region TimingVariables
427 #pragma region RecordingVariables
486 #pragma region TempVariables
505 #pragma region ProtectedMethods
507 #pragma region LoadMethods
509 virtual void LoadEnvironment(
CStdXml &oXml);
510 Structure *LoadStructure(
CStdXml &oXml);
511 Organism *LoadOrganism(
CStdXml &oXml);
512 OdorType *LoadOdorType(
CStdXml &oXml);
514 static void LoadAnimatModuleName(std::string strFile, std::string &strAnimatModule);
515 static void LoadAnimatModuleName(
CStdXml &oXml, std::string &strAnimatModule);
521 #pragma region AddRemoveMethods
542 virtual void AddOrganism(Organism *lpOrganism);
543 virtual void AddOrganism(std::string strXml);
544 virtual void RemoveOrganism(std::string strID,
bool bThrowError =
true);
554 virtual void AddStructure(Structure *lpStructure);
555 virtual void AddStructure(std::string strXml);
556 virtual void RemoveStructure(std::string strID,
bool bThrowError =
true);
558 virtual int FindAdapterListIndex(CStdArray<Adapter *> aryAdapters, std::string strID,
bool bThrowError =
true);
559 virtual int FindFoodSourceIndex(RigidBody *lpFood);
560 virtual int FindExtraDataIndex(BodyPart *lpPart);
562 virtual void AddOdorType(OdorType *lpOdorType);
563 virtual void AddOdorType(std::string strXml,
bool bDoNotInit);
564 virtual void RemoveOdorType(std::string strID,
bool bThrowError =
true);
566 virtual void AddScript(std::string strXml);
567 virtual void RemoveScript(std::string strID,
bool bThrowError =
true);
571 #pragma region UnitScaleMethods
573 float ConvertDistanceUnits(std::string strUnits);
574 float ConvertDenominatorDistanceUnits(std::string strUnits);
575 float ConvertMassUnits(std::string strUnits);
576 float ConvertDisplayMassUnits(std::string strUnits);
580 #pragma region SimulationMethods
582 virtual void InitializeRandomNumbers();
583 virtual void InitializeStructures();
585 virtual void NotifyTimeStepModified();
587 virtual bool CheckSimulationBlock();
588 virtual void CheckEndSimulationTime();
590 virtual void StepNeuralEngine();
591 virtual void StepPhysicsEngine();
592 virtual void StepExternalStimuli();
593 virtual void StepDataCharts();
594 virtual void StepSimRecorder();
595 virtual void AfterStepSimulation();
597 virtual void ResetSimulationTimingParams();
599 virtual void ProcessSimulationStep();
600 virtual void StepSimulation();
601 virtual void StepVideoFrame();
602 virtual void StepPlaybackControl();
603 virtual void SimulateBegin();
604 virtual void SimulateEnd();
607 virtual void SimStarting();
608 virtual void SimPausing();
609 virtual void SimStopping();
611 virtual void GenerateAutoSeed();
613 virtual void HandleCriticalError(std::string strError);
614 virtual void HandleNonCriticalError(std::string strError);
616 virtual void UpdateSimulationWindows() = 0;
619 virtual void StartSimulationStepTimer();
620 virtual void RecordSimulationStepTimer();
621 virtual void RecordSimulationTotalStepTimer();
622 virtual double CurrentRealTimeForStep_n();
623 virtual double CurrentRealTimeForStep_s();
624 virtual double CalculateRemainingPlaybackTime();
625 virtual void RecordAddedPlaybackTime();
626 virtual void StartVideoFrameTimer();
627 virtual double TimeBetweenVideoFrames();
628 virtual double RemainingVideoFrameTime();
632 #pragma region RecorderMethods
642 virtual SimulationRecorder *CreateSimulationRecorder() = 0;
644 virtual long CalculateSnapshotByteSize();
652 virtual void SnapshotStopFrame() = 0;
654 virtual void RecordVideoFrame();
666 #pragma region AccessorMutators
668 #pragma region ProjectVariables
670 virtual std::string ProjectPath();
671 virtual void ProjectPath(std::string strPath);
673 virtual std::string ExecutablePath();
674 virtual void ExecutablePath(std::string strPath);
676 virtual std::string SimulationFile();
677 virtual void SimulationFile(std::string strFile);
679 virtual bool Paused();
680 virtual void Paused(
bool bVal);
682 virtual bool Initialized();
683 virtual void Initialized(
bool bVal);
685 virtual CStdMap<std::string, AnimatBase *> *ObjectList();
687 virtual DataChartMgr *GetDataChartMgr();
688 virtual ExternalStimuliMgr *GetExternalStimuliMgr();
689 virtual SimulationRecorder *GetSimulationRecorder();
690 virtual Materials *GetMaterialMgr();
692 virtual LightManager *GetLightMgr();
694 virtual int VisualSelectionMode();
695 virtual void VisualSelectionMode(
int iVal);
697 virtual bool AddBodiesMode();
698 virtual void AddBodiesMode(
bool bVal);
703 virtual bool IsResetting();
707 #pragma region EnvironmentVariables
709 virtual float Time();
710 virtual long Millisecond();
711 virtual long MillisecondToSlice(
long lMillisecond);
712 virtual long SliceToMillisecond(
long lSlice);
713 virtual unsigned long long StartSimTick();
715 virtual float MinTimeStep();
716 virtual float TimeStep();
718 virtual bool SetEndSimTime();
719 virtual void SetEndSimTime(
bool bVal);
721 virtual float EndSimTime();
722 virtual void EndSimTime(
float fltVal);
724 virtual long EndSimTimeSlice();
725 virtual void EndSimTimeSlice(
long lVal);
727 virtual long TimeSlice();
728 virtual void TimeSlice(
long lVal);
730 virtual long PhysicsSliceCount();
731 virtual void PhysicsSliceCount(
long lVal);
733 virtual bool ManualStepSimulation();
734 virtual void ManualStepSimulation(
bool bVal);
736 virtual bool SimRunning();
738 virtual bool ShuttingDown();
740 virtual bool ForceFastMoving();
741 virtual void ForceFastMoving(
bool bVal);
743 virtual bool AutoGenerateRandomSeed();
744 virtual void AutoGenerateRandomSeed(
bool bVal);
746 virtual int ManualRandomSeed();
747 virtual void ManualRandomSeed(
int iSeed);
749 virtual float StabilityScale();
750 virtual void StabilityScale(
float fltVal);
752 virtual float LinearCompliance();
753 virtual void LinearCompliance(
float fltVal,
bool bUseScaling =
true);
755 virtual float AngularCompliance();
756 virtual void AngularCompliance(
float fltVal,
bool bUseScaling =
true);
758 virtual float LinearDamping();
759 virtual void LinearDamping(
float fltVal,
bool bUseScaling =
true);
761 virtual float AngularDamping();
762 virtual void AngularDamping(
float fltVal,
bool bUseScaling =
true);
764 virtual float LinearKineticLoss();
765 virtual void LinearKineticLoss(
float fltVal,
bool bUseScaling =
true);
767 virtual float AngularKineticLoss();
768 virtual void AngularKineticLoss(
float fltVal,
bool bUseScaling =
true);
770 virtual bool Stopped();
772 virtual short PhysicsStepInterval();
773 virtual void PhysicsStepInterval(
short iVal);
775 virtual void PhysicsTimeStep(
float fltVal);
776 virtual float PhysicsTimeStep();
777 virtual long PhysicsStepCount();
779 virtual void PhysicsSubsteps(
int iVal);
780 virtual int PhysicsSubsteps();
781 virtual float PhysicsSubstepTime();
783 virtual float Gravity();
784 virtual void Gravity(
float fltVal,
bool bUseScaling =
true);
786 virtual float MouseSpringStiffness();
787 virtual void MouseSpringStiffness(
float fltVal,
bool bUseScaling =
true);
789 virtual float MouseSpringDamping();
790 virtual void MouseSpringDamping(
float fltVal,
bool bUseScaling =
true);
792 virtual float MouseSpringForceMagnitude();
793 virtual void MouseSpringForceMagnitude(
float fltVal,
bool bUseScaling =
true);
795 virtual float MouseSpringDampingForceMagnitude();
796 virtual void MouseSpringDampingForceMagnitude(
float fltVal,
bool bUseScaling =
true);
798 virtual float MouseSpringLengthMagnitude();
799 virtual void MouseSpringLengthMagnitude(
float fltVal,
bool bUseScaling =
true);
801 virtual bool SimulateHydrodynamics();
802 virtual void SimulateHydrodynamics(
bool bVal);
804 virtual int GetMaterialID(std::string strID);
806 virtual bool IsPhysicsBeingUpdated();
809 virtual void BackgroundColor(
CStdColor &aryColor);
810 virtual void BackgroundColor(
float *aryColor);
811 virtual void BackgroundColor(std::string strXml);
813 virtual float AlphaThreshold();
814 virtual void AlphaThreshold(
float fltValue);
816 virtual float RecFieldSelRadius();
817 virtual void RecFieldSelRadius(
float fltValue,
bool bUseScaling =
true,
bool bUpdateAllBodies =
true);
819 virtual int PlaybackControlMode();
820 virtual void PlaybackControlMode(
int iMode);
822 virtual float PresetPlaybackTimeStep();
823 virtual void PresetPlaybackTimeStep(
float fltTimeStep);
825 virtual unsigned long long StepStartTick();
826 virtual unsigned long long StepSimEndTick();
828 virtual int DesiredFrameRate();
829 virtual float DesiredFrameStep();
830 virtual void DesiredFrameRate(
int iVal);
832 virtual float RealTime();
834 virtual bool InDrag() {
return m_bInDrag;};
835 virtual void InDrag(
bool bVal) {m_bInDrag = bVal;};
837 virtual bool RobotAdpaterSynch();
838 virtual void RobotAdpaterSynch(
bool bVal);
840 virtual bool InSimulation();
842 virtual bool ForceNoWindows();
843 virtual void ForceNoWindows(
bool bVal);
845 virtual void Script(ScriptProcessor *lpScript);
846 virtual ScriptProcessor *Script();
850 #pragma region UnitScalingVariables
852 virtual void DistanceUnits(std::string strUnits);
853 virtual float DistanceUnits();
854 virtual float InverseDistanceUnits();
855 virtual float DenominatorDistanceUnits();
857 virtual void MassUnits(std::string strUnits);
858 virtual float MassUnits();
859 virtual float InverseMassUnits();
860 virtual float DisplayMassUnits();
864 #pragma region HelperMethods
866 virtual void GetPositionAndRotationFromD3DMatrix(
float (&aryTransform)[4][4], CStdFPoint &vPos, CStdFPoint &vRot) = 0;
869 virtual unsigned long long GetTimerTick() = 0;
870 virtual double TimerDiff_u(
unsigned long long lStart,
unsigned long long lEnd) = 0;
871 virtual double TimerDiff_m(
unsigned long long lStart,
unsigned long long lEnd) = 0;
872 virtual double TimerDiff_s(
unsigned long long lStart,
unsigned long long lEnd) = 0;
873 virtual void MicroSleep(
unsigned int iMicroTime) = 0;
874 virtual void MicroWait(
unsigned int iMicroTime);
876 virtual void WriteToConsole(std::string strMessage) = 0;
878 virtual void NotifyRigidBodyAdded(std::string strID);
879 virtual void NotifyRigidBodyRemoved(std::string strID);
883 #pragma region RecordingVariables
885 virtual long VideoSliceCount();
886 virtual void VideoSliceCount(
long lVal);
888 virtual int VideoLoops();
889 virtual void VideoLoops(
int iVal);
899 virtual KeyFrame *VideoRecorder();
909 virtual void VideoRecorder(KeyFrame *lpFrame);
919 virtual KeyFrame *VideoPlayback();
929 virtual void VideoPlayback(KeyFrame *lpFrame);
931 virtual bool EnableSimRecording();
932 virtual void EnableSimRecording(
bool bVal);
934 virtual long SnapshotByteSize();
940 #pragma region PublicMethods
942 #pragma region SimulationMethods
944 virtual void BlockSimulation();
945 virtual void UnblockSimulation();
946 virtual bool SimulationBlockConfirm();
947 virtual bool WaitForSimulationBlock(
long lTimeout = 6000);
949 virtual void Reset();
950 virtual void ResetSimulation();
966 virtual void Initialize(
int argc,
const char **argv) = 0;
977 virtual void Initialize();
988 virtual void Simulate();
996 virtual void ShutdownSimulation() = 0;
1004 virtual void ToggleSimulation() = 0;
1012 virtual void StopSimulation() = 0;
1022 virtual bool StartSimulation() = 0;
1032 virtual bool PauseSimulation() = 0;
1043 virtual void RunSimulation();
1047 #pragma region LoadMethods
1049 virtual void Load(std::string strFileName =
"");
1050 virtual void Load(
CStdXml &oXml);
1051 virtual void Save(std::string strFilename);
1053 static IStdClassFactory *LoadClassFactory(std::string strModuleName,
bool bThrowError =
true);
1055 virtual void IncrementPhysicsBodyCount();
1059 #pragma region CreateMethods
1061 virtual CStdSerialize *CreateObject(std::string strModule, std::string strClassName, std::string strType,
bool bThrowError =
true);
1062 static Simulator *CreateSimulator(std::string strAnimatModule, std::string strSimulationFile,
bool bForceNoWindows =
false);
1063 static Simulator *CreateSimulator(std::string strSimFile,
bool bForceNoWindows =
false);
1064 static Simulator *CreateAndInitializeSimulator(std::string strSimFile,
bool bForceNoWindows =
false);
1065 static Simulator *CreateSimulator(std::string strAnimatModule,
CStdXml &oXml);
1066 static Simulator *CreateSimulator(std::string strAnimatModule, std::string strProjectPath, std::string strExecutablePath);
1067 static Simulator *CreateSimulator(
int argc,
const char **argv);
1068 virtual void GenerateCollisionMeshFile(std::string strOriginalMeshFile, std::string strCollisionMeshFile,
float fltScaleX,
float fltScaleY,
float fltScaleZ) = 0;
1069 virtual void ConvertV1MeshFile(std::string strOriginalMeshFile, std::string strNewMeshFile, std::string strTexture) = 0;
1074 #pragma region FindMethods
1076 virtual IStdClassFactory *FindNeuralModuleFactory(std::string strModuleName,
bool bThrowError =
false);
1077 virtual Organism *FindOrganism(std::string strOrganismID,
bool bThrowError =
true);
1078 virtual Structure *FindStructure(std::string strStructureID,
bool bThrowError =
true);
1079 virtual Structure *FindStructureFromAll(std::string strStructureID,
bool bThrowError =
true);
1080 virtual Joint *FindJoint(std::string strStructureID, std::string strJointID,
bool bThrowError =
true);
1081 virtual RigidBody *FindRigidBody(std::string strStructureID, std::string strBodyID,
bool bThrowError =
true);
1082 virtual OdorType *FindOdorType(std::string strOdorID,
bool bThrowError =
true);
1083 virtual void FindClosestFoodSources(CStdFPoint &oMouthPos,
float fltMinRadius, CStdArray<RigidBody *> &arySources, CStdArray<float> &aryDistances);
1084 virtual AnimatBase *FindByID(std::string strID,
bool bThrowError =
true);
1088 #pragma region AddRemoveMethods
1090 virtual void AddToObjectList(AnimatBase *lpItem);
1091 virtual void RemoveFromObjectList(AnimatBase *lpItem);
1092 virtual void AddNeuralModuleFactory(std::string strModuleName, NeuralModule *lpModule);
1094 virtual void AddFoodSource(RigidBody *lpFood);
1095 virtual void RemoveFoodSource(RigidBody *lpFood);
1097 virtual void AttachSourceAdapter(Structure *lpStructure, Adapter *lpAdapter);
1098 virtual void RemoveSourceAdapter(Structure *lpStructure, Adapter *lpAdapter);
1099 virtual void AttachTargetAdapter(Structure *lpStructure, Adapter *lpAdapter);
1100 virtual void RemoveTargetAdapter(Structure *lpStructure, Adapter *lpAdapter);
1101 virtual bool IsPhysicsAdapter(Adapter *lpAdapter);
1103 virtual void AddToExtractExtraData(BodyPart *lpPart);
1104 virtual void RemoveFromExtractExtraData(BodyPart *lpPart);
1108 #pragma region DataAccesMethods
1110 virtual float *GetDataPointer(
const std::string &strDataType);
1111 virtual bool SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError =
true);
1112 virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
1113 virtual bool AddItem(
const std::string &strItemType,
const std::string &strXml,
bool bThrowError =
true,
bool bDoNotInit =
false);
1114 virtual bool RemoveItem(
const std::string &strItemType,
const std::string &strID,
bool bThrowError =
true);
1118 #pragma region RecorderMethods
1120 virtual void EnableVideoPlayback(std::string strKeyFrameID);
1121 virtual void DisableVideoPlayback();
1122 virtual void StartVideoPlayback();
1123 virtual void StopVideoPlayback();
1124 virtual void StepVideoPlayback(
int iFrameCount = 1);
1125 virtual void SaveVideo(std::string strPath);
1127 virtual std::string AddKeyFrame(std::string strType,
long lStart,
long lEnd);
1128 virtual void RemoveKeyFrame(std::string strID);
1129 virtual std::string MoveKeyFrame(std::string strID,
long lStart,
long lEnd);
1130 virtual void MoveSimulationToKeyFrame(std::string strKeyFrameID);
1131 virtual void SaveKeyFrameSnapshot(byte *aryBytes,
long &lIndex);
1132 virtual void LoadKeyFrameSnapshot(byte *aryBytes,
long &lIndex);
1136 #pragma region CollisionMethods
1138 virtual void EnableCollisions(Structure *lpStruct, CStdPtrArray<CollisionPair> &m_aryCollisionList);
1139 virtual void DisableCollisions(Structure *lpStruct, CStdPtrArray<CollisionPair> &m_aryCollisionList);
1152 virtual void EnableCollision(RigidBody *lpBody);
1165 virtual void DisableCollision(RigidBody *lpBody);
1173 Simulator ANIMAT_PORT *GetSimulator();
long m_lVideoFrame
The video frame.
float m_fltPrevTotalRealTimeForStep
Previous total time for the step. Used for exponential smoothing algorithm.
CStdPtrMap< std::string, Organism > m_aryOrganisms
float m_fltMouseSpringForceMagnitude
The magnitude of the force being applied by the mosue spring at each step.
bool m_bSetEndSim
true if we the user has manually set the simulation end time.
long m_lSnapshotByteSize
Size of a memory snapshot in bytes.
bool m_bRobotAdpaterSynch
KeyFrame * m_lpSimStopPoint
The pointer to a simulation stop point.
bool m_bPaused
true if the simulation is paused.
CStdPtrMap< std::string, Structure > m_aryStructures
float m_fltAngularDamping
The angular damping of the simulation environment.
float m_fltTotalMicroSleepTime
Total time we were in microsleep during playback pause calculations;.
Simulates the entire environment.
Root namespace for the base simulation library for AnimatLab.
short m_iPhysicsStepInterval
float m_fltSimulationRealTimeToStep
int m_iVideoLoops
Zero-based index of the video loops.
bool m_bEnableSimRecording
true to enable simulation recording
CStdMap< std::string, Organism * >::iterator m_oOrganismIterator
An organism iterator.
float m_fltPhysicsStepTime
This is the time pers step for the physics engine.
ExternalStimuliMgr m_oExternalStimuliMgr
Manager for external stimuli.
Handles processing of a single thread of the simulation.
float m_fltLinearCompliance
The linear compliance of the simulation environment.
CStdMap< std::string, Structure * > m_aryAllStructures
bool m_bInitialized
true if the simulation has been initialized.
Organism * m_lpSelOrganism
The pointer to a selected organism.
int m_iDesiredFrameRate
Desired frame rate of the simulation video.
bool m_bInDrag
Tells if we are in the middle of a mouse drag operation to move or rotate a part. ...
bool m_bManualStepSimulation
If true then the user is manually stepping the simulation.
float m_fltPlaybackAdditionRealTimeToStep
float m_fltActualFrameRate
The frame rate for the current frame.
bool m_bAutoGenerateRandomSeed
long m_lPhysicsSliceCount
The number of slices that the physics engine has been updated.
bool m_bForceNoWindows
If this is set to true then no graphical simulation windows will be created regardless of what the co...
float m_fltDesiredFrameStep
The desired time value duration of the video frame step.
float m_fltInverseDistanceUnits
The inverse of the distance units.
float m_fltDataChartStepTime
time to process data charts for this step.
LightManager m_oLightMgr
Manager for the light objects.
Declares the simulation window manager class.
KeyFrame * m_lpVideoRecorder
The pointer to a video recorder.
bool m_bShuttingDown
True if the simulation is shutting down. This is used by other objects in their destructor to know wh...
unsigned long long m_lStepSimEndTick
The tick count for when the simulation procressing of the step ends.
CStdArray< BodyPart * > m_aryExtraDataParts
float m_fltDenominatorDistanceUnits
bool m_bSimBlockConfirm
true to confirm that a simulation block is in place.
int m_iSelectionMode
This is the currect visual selection mode used within the GUI.
ThreadProcessor * m_lpPhysicsThread
The pointer to the physics thread processor.
float m_fltExternalStimuliStepTime
Time to process external stimuli for this step.
int m_iVideoStepSize
Size of the i video step.
bool m_bSimulateHydrodynamics
bool m_bForceSimulationStop
Set to true to stop the simulation. This is a more forceful way of stopping the sim.
long m_lTimeSlice
The current time slice. This a long value.
CStdArray< RigidBody * > m_aryFoodSources
An Array of RigidBody parts that also act as food sources within the environment. ...
float m_fltAlphaThreshold
The threshold value to use when setting the AlphaFunc for the entire scene.
float m_fltTotalRealTimeForStep
This is the total time it takes to complete one physics time step.
float m_ftlMouseSpringDamping
The damping of the user mouse spring.
long m_lVideoStartSlice
The video start slice.
bool m_bSimRunning
true if the simulation is running
std::string m_strProjectPath
The directory path where the simulation configuration files are located.
CStdMap< std::string, Structure * >::iterator m_oStructureIterator
A structure iterator.
unsigned long long m_lLastTickTaken
This is the last tick taken by a GetTickCount. It is used in debugging.
float m_fltTotalMicroSleepCount
Total number of times we called microsleep during playback pause calculations.
SimulationWindowMgr * m_lpWinMgr
Manager for SimulationWindows.
float m_fltStabilityScale
A linear scaling factor for setting the simulation parameters.
bool m_bStopSimulation
Set to true to stop the simulation.
float m_lEndSimTimeSlice
The time slice when the simulation should end.
Declares the simulation Windows Form.
Materials m_oMaterialMgr
Manager for Materials.
bool m_bBlockSimulation
true to block simulation. See WaitForBlock for more info.
float m_fltRemainingStepTime
Manager for simulation windows.
CStdMap< std::string, AnimatBase * > m_aryObjectList
A list of all animatbase objects in the simulation.
float m_fltAngularCompliance
The angular compliance of the simulation environment.
A standard xml manipulation class.
float m_fltPhysicsSubstepTime
float m_fltEndSimTime
The time when the simulation should end.
float m_fltDisplayMassUnits
Tells how many kilograms/m^3 each unit of density is worth within the simulation environment.
DataChartMgr m_oDataChartMgr
Manager for data charts.
int m_iTargetAdapterCount
Number of target adapters.
CStdPtrMap< std::string, OdorType > m_aryOdorTypes
float m_fltTotalMicroWaitCount
Total number of loop iterations for microwait during playback pause calculations. ...
CStdMap< std::string, IStdClassFactory * > m_aryNeuralModuleFactories
int m_iPlaybackControlMode
Determines the mode used for playback control. See the accessor method for more details.
float m_fltLinearDamping
The linear damping of the simulation environment.
KeyFrame * m_lpVideoPlayback
The pointer to a video playback.
float m_fltMouseSpringLengthMagnitude
The magnitude of the length of the mouse spring at each step.
float m_fltSimRecorderStepTime
Time to process simulation recorder for this step.
ISimGUICallback * m_lpSimCallback
float m_fltGravity
The acceleration of gravity to use in the simulation.
unsigned long long m_lVideoFrameStartTick
The tick when a new video frame time starts.
SimulationRecorder * m_lpSimRecorder
The pointer to a simulation recorder.
Namespace for the standard utility objects.
Structure * m_lpSelStructure
The pointer to a selected structure.
Declares the thread processing class.
bool m_bIsResetting
True if we are in the process of resetting the simulation. False otherwise.
Callback methods for the simulation object.
float m_fltTimeStep
This is the minimum integration time step taken for all neural modules and the physics engine...
long m_lStepTimeCount
This is a temp variable for measuring sim time for a set period for each simulation.
long m_lVideoSliceCount
Current video slice time slice.
float m_fltVideoRecordFrameTime
Time of the video record frame.
std::string m_strExecutablePath
The directory path where the executable is located.
CStdArray< Adapter * > m_aryTargetPhysicsAdapters
Array of target physics adapters.
ThreadProcessor * m_lpNeuralThread
The pointer to a neural thread processor.
Declares the material pair class.
bool m_bForceFastMoving
true if we need to set the physics system to force handling of fast moving objects.
float m_fltVideoStartTime
Time of the video start.
float m_fltDistanceUnits
Tells how many meters each unit of distance is worth within the simulation environment.
float m_fltPrevPhysicsStepTime
int m_iVideoStep
Zero-based index of the video step.
bool m_bSteppingSim
true if stepping of simulation has begun. This is set to true once the Simulate methods has been call...
unsigned long long m_lStartSimTick
The tick count for when the simulation first begins running.
bool m_bAddBodiesMode
true if the AddBodies mode is enabled within the GUI.
long m_lVideoEndSlice
The video end slice.
float m_fltRealTime
This keeps track of the real time from the begginning of the simulation.
float m_fltTotalNeuralStepTime
Total time for processing of all neural items for this step.
CStdArray< Adapter * > m_arySourcePhysicsAdapters
Array of source physics adapters.
float m_fltVideoPlaybackFrameTime
Time of the video playback frame.
ThreadProcessor * m_lpIOThread
The pointer to an i/o thread processor.
std::string m_strSimulationFile
The name of the Animat Simulation (ASIM) file.
bool m_bRecordVideo
true to record video
double m_dblTotalStepTime
This is a temp variable for measuring sim time for a set period for each simulation.
float m_fltTime
The current simulation time.
Declares the materials class.
std::string m_strVideoFilename
Filename of the video file.
float m_fltVideoEndTime
Time of the video end.
unsigned long long m_lStepStartTick
This is the tick count that is taken when a step is started.
Standard serialize class.
float m_fltAngularKineticLoss
The angular kinetic loss of the simulation environment.
float m_fltMassUnits
Tells how many kilograms each unit of mass is worth within the simulation environment.
float m_fltRecFieldSelRadius
float m_fltTotalMicroWaitTime
Total time we were in microwait during playback pause calculations;.
Declares the thread processing class for a specific module.
float m_fltLinearKineticLoss
The linear kinetic loss of the simulation environment.
float m_fltTotalRealTimeForStepSmooth
Current value of the exponential smoothing algorith for real time step.
float m_fltInverseMassUnits
The inverse of the mass units.
int m_iExtraDataCount
Number of parts that require extra data to be collected.
float m_fltPhysicsTimeStep
The time increment for each time slice of the physics simulation.
float m_fltPresetPlaybackTimeStep
float m_fltMouseSpringDampingForceMagnitude
The magnitude of the damping component of the force being applied by the mosue spring at each step...
IStdClassFactory * m_lpAnimatClassFactory
float m_fltMouseSpringStiffness
The stiffness of the user mouse spring.
CStdColor m_vBackgroundColor
The background color to use when drawing the environment.