VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Shoot Interaction Encoder

shootEnc encodes Shoot interactions.


/*********************************************************************
** Copyright (c) 1999 MaK Technologies, Inc.
** All rights reserved.
*********************************************************************/
#ifndef ShootEncoder_H_
#define ShootEncoder_H_
#if DtHLA
#include "myFomMap.h"
#define DtDECLARE_SHOOT_PARAM_ENCODER(paramName) \
DtDECLARE_PARAM_ENCODER(DtFireInteraction, paramName)
{
public:
virtual ~ShootEncoder();
protected:
};
#endif
#endif

/*********************************************************************
** Copyright (c) 1997 MAK Technologies, Inc.
** All rights reserved.
*********************************************************************/
/*********************************************************************
** $RCSfile: shootEnc.cxx,v $ $Revision: 1.3 $ $State: Exp $
*********************************************************************/
#if DtHLA
#include "shootEnc.h"
// Constructor.
DtExerciseConn* exConn,
DtInterClassDesc* classDesc) :
DtInteractionEncoder(exConn, classDesc)
{
// Register the individual encoding functions for Shoot's parameters with
// object. The encoding functions have names like encodeShooter and
// encodeShootee. The macro expands to look like this:
// addEncoder("Shooter", (DtParameterEncoder) encodeShooter);
// addEncoder("Shootee", (DtParameterEncoder) encodeShootee);
}
{
}
// Decoding functions
// Macros can help with definitions of simple encoding functions, as in in
// examples/extend/testObj/testEnc.cxx but here we do not rely on them.
void ShootEncoder::encodeShooter(const DtFireInteraction& inter,
RTI::ParameterHandle paramHandle)
{
// Get the value from the inspector function, convert to FOM representation
// (in this case, a trivial conversion), and add it to the phvps.
const char* val = inter.attackerId().string();
params->add(paramHandle, val, strlen(val));
}
void ShootEncoder::encodeShootee(const DtFireInteraction& inter,
RTI::ParameterHandle paramHandle)
{
// Get the value from the inspector function, convert to FOM representation
// (in this case, a trivial conversion), and add it to the phvps.
const char* val = inter.targetId().string();
params->add(paramHandle, val, strlen(val));
}
#endif

Document ID: Generated on Mon Apr 25 03:39:01 EDT 2022 from SVN revision 242502
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)