VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvDiGuy
DtDiGuyMotionModel.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2015 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
10
#pragma once
11
12
#include <
vrvDiGuy/vrvDiGuy.h
>
13
#include <
vrvCore/DtMotionModel.h
>
14
#include <vlpi/exponentialSmoother.h>
15
#include <diguyMotionDirection.h>
16
#include <diguyMotionPosture.h>
17
#include <matrix/vlVector.h>
18
19
class
DtTaitBryan;
20
class
diguyCharacterGuide;
21
22
namespace
makVrv
23
{
24
class
DtModel;
25
class
DtDiGuyCharacterModel;
26
class
DtDe;
27
30
class
DT_DLL_VRVDIGUY
DtDiGuyMotionModel
:
public
DtVRLDeadReckonerMotionModel
<DtExponentialSmoother>
31
{
32
public
:
33
35
DtDiGuyMotionModel
(
DtDe
& igs,
DtSceneObject
* owner);
36
38
DtDiGuyMotionModel
(
const
DtDiGuyMotionModel
& orig,
double
time);
39
41
virtual
~
DtDiGuyMotionModel
();
42
44
virtual
DtMotionModel
* clone(
double
simTime);
45
48
virtual
bool
motionModelHandlesUpdate()
const
;
49
51
virtual
void
updateMotion(
double
simulationTime);
52
54
virtual
const
char
* getActionFromDescription(diguyMotionDirection direction, diguyMotionPosture posture,
double
actualSpeed);
55
57
virtual
void
modelAdded(
DtModel
*);
58
60
virtual
void
modelRemoved(
DtModel
*);
61
62
virtual
void
setLocation(
const
DtVector
& loc,
DtTime
t);
63
64
//#ifdef USE_DIGUY_GUIDES
65
virtual
const
DtVector
& approxLocation(
DtTime
curTime)
const
;
66
//#endif
67
68
virtual
void
setOrientation(
const
DtTaitBryan& ori,
DtTime
curTime);
69
virtual
void
setVelocity(
const
DtVector32& vel,
DtTime
curTime);
70
virtual
void
setRotationalVelocity(
const
DtVector32& vel,
DtTime
curTime);
71
72
protected
:
73
74
//Calculate the direction Forward/Back/Left/Right
75
int
calculateDirectionFBLR(
const
DtTaitBryan& ori,
const
DtVector32& vel);
76
77
//Calculate the direction Forward/Back
78
int
calculateDirectionFB(
const
DtTaitBryan& ori,
const
DtVector32& vel);
79
81
void
setCharacter(
DtDiGuyCharacterModel
* character);
82
83
84
protected
:
85
DtDe
&
myDe
;
86
87
mutable
DtVector
myPositionReturn
;
88
mutable
DtTaitBryan
myOrientationReturn
;
89
mutable
DtVector
mApproxLocation
;
90
DtVector
myLastTopoUpdateLocation
;
91
92
DtVector
myAcceleration
;
93
DtDiGuyCharacterModel
*
myCharacter
;
94
DtSceneObject
*
myObjectToMove
;
95
int
myLastDirection
;
96
int
myLastPosture
;
97
double
myLastSpeed
;
98
const
char
*
myLastAction
;
99
double
myLastActionTime
;
100
bool
myLastWeaponDeployed
;
101
int
myNeedsInit
;
102
103
// These are the last values known to have come across the network,
104
// before any smoothing is applied.
105
DtVector
myLastFirmLocation
;
106
DtTaitBryan
myLastFirmOrientation
;
107
DtVector32
myLastFirmVelocity
;
108
DtVector32
myLastFirmRotationalVelocity
;
109
DtTime
myLastFirmRotationalVelocityTime
;
110
};
111
114
class
DT_DLL_VRVDIGUY
DtDiGuyMotionModelCreator
:
public
DtMotionModelCreator
115
{
116
public
:
118
virtual
~
DtDiGuyMotionModelCreator
();
119
121
virtual
DtMotionModel
* create(
DtSceneObject
* owner,
DtDe
& de);
122
};
123
}
Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)