VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Entity State Repository Extension

The MyEntityStateRep class contains the new mass variable


Header file:

/*******************************************************************************
** Copyright (c) 2007 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: myEsr.h,v $ $Revision: 1.8 $ $State: Exp $
*******************************************************************************/
#pragma once
#if DtHLA
#include <stdio.h>
//Because this example adds a concept that did not already exist in VR-Link's
//DtEntityStateRepository class, we create this subclass of
//DtEntityStateRepository that adds the concept of mass.
{
public:
, myMass(0.)
{
}
{
}
//Set/Get the value of mass
virtual void setMass(float mass);
virtual float mass() const;
//Virtual function override: print the state rep's data.
virtual void printData() const;
public:
//Create a MyEntityStateRep. Caller is reponsible for deletion.
//Copy shallow (false) or deep (true).
virtual DtStateRepository* clone(bool copy = false) const;
protected:
float myMass;
};
//Inline functions
inline void MyEntityStateRep::setMass(float temp)
{
myMass = temp;
}
inline float MyEntityStateRep::mass() const
{
return myMass;
}
inline void MyEntityStateRep::printData() const
{
printf("Mass: %lf\n", mass());
}
{
return new MyEntityStateRep();
}
{
if (copy)
{
return new MyEntityStateRep(*this);
}
else
{
return new MyEntityStateRep();
}
}
#endif

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)