Main Page
Namespaces
Classes
Files
File List
File Members
include
Graphics
GteController.h
Go to the documentation of this file.
1
// David Eberly, Geometric Tools, Redmond WA 98052
2
// Copyright (c) 1998-2017
3
// Distributed under the Boost Software License, Version 1.0.
4
// http://www.boost.org/LICENSE_1_0.txt
5
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6
// File Version: 3.0.0 (2016/06/19)
7
8
#pragma once
9
10
#include <
GTEngineDEF.h
>
11
#include <string>
12
13
namespace
gte
14
{
15
16
class
ControlledObject;
17
18
class
GTE_IMPEXP
Controller
19
{
20
protected
:
21
// Abstract base class.
22
Controller
();
23
public
:
24
virtual
~
Controller
();
25
26
// Member access.
27
inline
ControlledObject
* GetObject()
const
;
28
inline
void
SetApplicationTime(
double
applicationTime);
29
inline
double
GetApplicationTime()
const
;
30
31
// The animation update. The application time is in milliseconds.
32
virtual
bool
Update(
double
applicationTime);
33
34
// Time management. A controller may use its own time scale, and it
35
// specifies how times are to be mapped to application time.
36
enum
GTE_IMPEXP
RepeatType
37
{
38
RT_CLAMP
,
39
RT_WRAP
,
40
RT_CYCLE
41
};
42
43
// Member access.
44
RepeatType
repeat
;
// default = RT_CLAMP
45
double
minTime
;
// default = 0
46
double
maxTime
;
// default = 0
47
double
phase
;
// default = 0
48
double
frequency
;
// default = 1
49
bool
active
;
// default = true
50
51
// Allow user-readable names for nodes in a scene graph.
52
std::string
name
;
53
54
public
:
// INTERNAL USE ONLY
55
// The class ControlledObject needs to set the object during a call to
56
// AttachController. Derived classes that manage a set of controllers
57
// also need to set the objects during a call to AttachController.
58
virtual
void
SetObject(
ControlledObject
*
object
);
59
60
protected
:
61
// Conversion from application time units to controller time units.
62
// Derived classes may use this in their update routines.
63
double
GetControlTime(
double
applicationTime);
64
65
// The controlled object. This is a regular pointer rather than a
66
// shared pointer to avoid the reference-count cycle between mObject
67
// and 'this'. Because the pointer links are set internally rather
68
// than by an external manager, it is not possible to use std::weak_ptr
69
// to avoid the cycle because we do not know the shared_ptr object
70
// that owns mObject.
71
ControlledObject
*
mObject
;
72
73
// The application time in milliseconds.
74
double
mApplicationTime
;
75
};
76
77
}
gte::Controller::mObject
ControlledObject * mObject
Definition:
GteController.h:71
GTEngineDEF.h
gte::Controller::name
std::string name
Definition:
GteController.h:52
gte::Controller
Definition:
GteController.h:18
RT_CLAMP
RT_CLAMP
Definition:
GteController.h:38
gte::Controller::active
bool active
Definition:
GteController.h:49
string
GLsizei const GLchar *const * string
Definition:
glcorearb.h:809
gte
Definition:
GLX/GteWICFileIO.h:16
gte::Controller::frequency
double frequency
Definition:
GteController.h:48
gte::Controller::phase
double phase
Definition:
GteController.h:47
gte::Controller::repeat
RepeatType repeat
Definition:
GteController.h:44
gte::Controller::maxTime
double maxTime
Definition:
GteController.h:46
gte::ControlledObject
Definition:
GteControlledObject.h:17
RT_WRAP
RT_WRAP
Definition:
GteController.h:38
gte::Controller::mApplicationTime
double mApplicationTime
Definition:
GteController.h:74
GTE_IMPEXP
#define GTE_IMPEXP
Definition:
GTEngineDEF.h:63
gte::Controller::minTime
double minTime
Definition:
GteController.h:45
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59