Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acgl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACGL
acgl
Commits
7ae41f65
Commit
7ae41f65
authored
Oct 20, 2015
by
Robert Menzel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed deprecated and unsupported functions and updated lodepng
parent
dedbf29b
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1405 additions
and
3962 deletions
+1405
-3962
include/ACGL/Animations/Animation.hh
include/ACGL/Animations/Animation.hh
+0
-405
include/ACGL/Animations/EaseFunctions.hh
include/ACGL/Animations/EaseFunctions.hh
+0
-176
include/ACGL/Animations/Interpolator.hh
include/ACGL/Animations/Interpolator.hh
+0
-301
include/ACGL/Math/Constants.hh
include/ACGL/Math/Constants.hh
+8
-27
include/ACGL/Math/Functions.hh
include/ACGL/Math/Functions.hh
+3
-25
include/ACGL/OpenGL/Controller.hh
include/ACGL/OpenGL/Controller.hh
+0
-13
include/ACGL/OpenGL/Controller/ShaderControlFile.hh
include/ACGL/OpenGL/Controller/ShaderControlFile.hh
+0
-22
include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh
include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh
+0
-22
include/ACGL/OpenGL/Controller/VertexArrayObjectControlFile.hh
...de/ACGL/OpenGL/Controller/VertexArrayObjectControlFile.hh
+0
-22
include/ACGL/OpenGL/Data/GeometryData.hh
include/ACGL/OpenGL/Data/GeometryData.hh
+0
-3
include/ACGL/OpenGL/Debug.hh
include/ACGL/OpenGL/Debug.hh
+99
-0
include/ACGL/OpenGL/HiLevelObjects/RenderObject.hh
include/ACGL/OpenGL/HiLevelObjects/RenderObject.hh
+0
-195
include/ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.hh
include/ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.hh
+0
-124
include/ACGL/OpenGL/HiLevelObjects/Uniform.hh
include/ACGL/OpenGL/HiLevelObjects/Uniform.hh
+0
-229
include/ACGL/OpenGL/Tools.hh
include/ACGL/OpenGL/Tools.hh
+1
-99
include/ACGL/Scene/CoordinateSystem.hh
include/ACGL/Scene/CoordinateSystem.hh
+0
-72
include/ACGL/Scene/NURBSControlPoint.hh
include/ACGL/Scene/NURBSControlPoint.hh
+0
-160
include/ACGL/Scene/NURBSCurve.hh
include/ACGL/Scene/NURBSCurve.hh
+0
-302
include/ACGL/Scene/NURBSDataVector.hh
include/ACGL/Scene/NURBSDataVector.hh
+0
-180
include/lodepng/lodepng.h
include/lodepng/lodepng.h
+129
-99
src/ACGL/OpenGL/Debug.cc
src/ACGL/OpenGL/Debug.cc
+19
-0
src/ACGL/OpenGL/HiLevelObjects/RenderObject.cc
src/ACGL/OpenGL/HiLevelObjects/RenderObject.cc
+0
-101
src/ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.cc
src/ACGL/OpenGL/HiLevelObjects/ShaderProgramObject.cc
+0
-32
src/ACGL/OpenGL/Tools.cc
src/ACGL/OpenGL/Tools.cc
+21
-27
src/ACGL/Scene/CoordinateSystem.cc
src/ACGL/Scene/CoordinateSystem.cc
+0
-124
src/lodepng/lodepng.cpp
src/lodepng/lodepng.cpp
+1125
-1202
No files found.
include/ACGL/Animations/Animation.hh
deleted
100644 → 0
View file @
dedbf29b
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
// See http://www.graphics.rwth-aachen.de/redmine/projects/acgl/wiki/ACGL_compile_time_settings
// for a comment what unsupported means.
#ifdef ACGL_INCLUDE_UNSUPPORTED
#ifndef ACGL_ANIMATIONS_ANIMATION_HH
#define ACGL_ANIMATIONS_ANIMATION_HH
#include <ACGL/ACGL.hh>
#include <ACGL/Types.hh>
#include <ACGL/Base/Macros.hh>
#include <ACGL/Animations/EaseFunctions.hh>
#include <ACGL/Animations/Interpolator.hh>
#include <list>
#include <queue>
namespace
ACGL
{
namespace
Animations
{
// Animation *************************************************************************************
class
Animation
{
public:
enum
RepeatMode
{
Endless
=
-
1
,
EndlessNoRepeat
=
-
2
};
Animation
()
:
mInited
(
false
),
mStopped
(
false
)
{}
virtual
~
Animation
()
{}
virtual
void
init
()
=
0
;
virtual
long
update
(
uint_t
msec
)
=
0
;
virtual
bool
finished
()
=
0
;
inline
const
bool
&
isInited
()
const
;
inline
const
bool
&
isStopped
()
const
;
inline
void
restart
();
inline
void
stop
();
protected:
bool
mInited
;
bool
mStopped
;
private:
};
ACGL_SMARTPOINTER_TYPEDEFS
(
Animation
)
typedef
std
::
list
<
SharedAnimation
>
AnimationList
;
typedef
std
::
queue
<
SharedAnimation
>
AnimationQueue
;
class
AnimationManager
{
public:
static
void
push
(
const
SharedAnimation
&
_animation
);
static
void
update
(
uint_t
_msec
);
static
void
cleanUp
();
protected:
private:
static
AnimationList
mAnimations
;
};
class
AnimationEventCallbackFunction
{
public:
typedef
void
(
*
Function
)(
uint_t
);
AnimationEventCallbackFunction
(
Function
_pFunction
,
uint_t
_id
)
:
mpFunction
(
_pFunction
),
mId
(
_id
)
{
}
inline
void
call
()
{
mpFunction
(
mId
);
}
private:
Function
mpFunction
;
uint_t
mId
;
};
template
<
class
T
>
class
AnimationEventCallbackMemberFunction
{
public:
typedef
void
(
T
::*
Function
)(
uint_t
);
AnimationEventCallbackMemberFunction
(
const
T
*
_pTarget
,
Function
_pFunction
,
uint_t
_id
)
:
mpTarget
(
_pTarget
),
mpFunction
(
_pFunction
),
mId
(
_id
)
{
}
inline
void
call
()
{
mpTarget
->
mpFunction
(
mId
);
}
private:
const
T
*
mpTarget
;
Function
mpFunction
;
uint_t
mId
;
};
// AnimationEvent *************************************************************************************
template
<
class
Callback
>
class
AnimationEvent
:
public
Animation
{
public:
AnimationEvent
(
const
Callback
&
_callback
)
:
Animation
(),
mCallback
(
_callback
),
mEventCalled
(
false
)
{
}
virtual
void
init
()
{
mEventCalled
=
false
;
mInited
=
true
;
}
virtual
long
update
(
uint_t
_msec
)
{
mCallback
.
call
();
mEventCalled
=
true
;
return
_msec
;
}
virtual
bool
finished
()
{
return
mEventCalled
;
}
Callback
&
getCallback
()
{
return
mCallback
;
}
private:
Callback
mCallback
;
bool
mEventCalled
;
};
// AnimationWait *************************************************************************************
class
AnimationWait
:
public
Animation
{
public:
AnimationWait
(
const
uint_t
_duration
);
virtual
void
init
();
virtual
long
update
(
uint_t
_msec
);
virtual
bool
finished
();
private:
long
mTimeLeft
;
long
mDuration
;
};
ACGL_SMARTPOINTER_TYPEDEFS
(
AnimationWait
)
// AnimationSequential *************************************************************************************
class
AnimationSequential
:
public
Animation
{
public:
AnimationSequential
(
const
int_t
_loops
=
0
);
virtual
~
AnimationSequential
();
virtual
void
init
();
virtual
long
update
(
uint_t
_msec
);
virtual
bool
finished
();
void
push_animation
(
const
SharedAnimation
&
_animation
);
private:
int_t
mLoops
;
AnimationList
::
iterator
mCurrentPosition
;
AnimationList
mAnimations
;
};
ACGL_SMARTPOINTER_TYPEDEFS
(
AnimationSequential
)
// AnimationParallel *************************************************************************************
class
AnimationParallel
:
public
Animation
{
public:
AnimationParallel
(
const
int_t
_loops
=
0
);
virtual
~
AnimationParallel
();
virtual
void
init
();
virtual
long
update
(
uint_t
_msec
);
virtual
bool
finished
();
void
push_animation
(
const
SharedAnimation
&
animation
);
private:
int_t
mLoops
;
AnimationList
mAnimations
;
uint_t
mRunningAnimations
;
};
ACGL_SMARTPOINTER_TYPEDEFS
(
AnimationParallel
)
// AnimationVariable *************************************************************************************
template
<
class
T
,
class
Interpolator
>
class
AnimationVariable
:
public
Animation
{
public:
AnimationVariable
(
T
&
_data
,
uint_t
_duration
,
const
SharedEaseFunction
&
_ease_function
,
const
Interpolator
&
_interpolator
=
Interpolator
())
:
mpEaseFunction
(
_ease_function
),
mInterpolator
(
_interpolator
),
mCurrentTime
(
0
),
mDuration
(
_duration
),
mpData
(
_data
)
{
}
virtual
~
AnimationVariable
()
{
mBlendInterpolators
.
clear
();
}
virtual
void
init
()
{
mCurrentTime
=
0
;
mInterpolator
.
init
(
mpData
);
mInited
=
true
;
}
virtual
long
update
(
uint_t
_msec
)
{
long
time_span
;
if
(
mDuration
-
mCurrentTime
>=
_msec
)
time_span
=
_msec
;
else
time_span
=
mDuration
-
mCurrentTime
;
mCurrentTime
+=
time_span
;
float
progress
=
(
float
)
mCurrentTime
/
(
float
)
mDuration
;
mpData
=
mInterpolator
.
interpolate
(
mpEaseFunction
->
value
(
progress
)
);
float
sub_progress
;
for
(
unsigned
int
i
=
0
;
i
<
mBlendInterpolators
.
size
();
i
++
)
{
sub_progress
=
(
progress
-
mBlendInterpolators
[
i
].
start
)
/
(
mBlendInterpolators
[
i
].
end
-
mBlendInterpolators
[
i
].
start
);
if
(
0.0
f
<=
sub_progress
&&
sub_progress
<=
1.0
f
)
{
mBlendInterpolators
[
i
].
mpInterpolator
->
blend
(
&
mpData
,
mBlendInterpolators
[
i
].
mpEaseFunction
->
value
(
sub_progress
)
);
}
}
return
_msec
-
time_span
;
}
virtual
bool
finished
()
{
if
(
mCurrentTime
>=
mDuration
)
mpData
=
mInterpolator
.
finish
();
return
mCurrentTime
>=
mDuration
;
}
void
add_blend_interpolator
(
const
SharedBlendInterpolator
&
_interpolator
,
const
SharedEaseFunction
&
_ease_function
,
float
_start
=
0.0
f
,
float
_end
=
1.0
f
)
{
mBlendInterpolators
.
push_back
((
blend_interpolator_t
){
_interpolator
,
_ease_function
,
_start
,
_end
,
false
});
}
inline
const
SharedEaseFunction
&
get_ease_function
(){
return
mpEaseFunction
;}
inline
void
set_ease_function
(
const
SharedEaseFunction
&
_ease_function
){
mpEaseFunction
.
reset
();
mpEaseFunction
=
_ease_function
;}
inline
Interpolator
&
get_interpolator
(){
return
mInterpolator
;
}
//void set_interpolator(Interpolator* interpolator){ this->interpolator = interpolator; }
protected:
private:
SharedEaseFunction
mpEaseFunction
;
Interpolator
mInterpolator
;
uint_t
mCurrentTime
;
uint_t
mDuration
;
T
&
mpData
;
struct
blend_interpolator_t
{
SharedBlendInterpolator
mpInterpolator
;
SharedEaseFunction
mpEaseFunction
;
float
start
,
end
;
bool
active
;
};
typedef
std
::
vector
<
blend_interpolator_t
>
BlendInterpolators
;
BlendInterpolators
mBlendInterpolators
;
};
typedef
AnimationVariable
<
float
,
LinearInterpolatorFloat
>
AnimationFloatLinear
;
ACGL_SMARTPOINTER_TYPEDEFS
(
AnimationFloatLinear
)
typedef
AnimationVariable
<
glm
::
vec2
,
LinearInterpolatorVec2
>
AnimationVec2Linear
;
ACGL_SMARTPOINTER_TYPEDEFS
(
AnimationVec2Linear
)
typedef
AnimationVariable
<
glm
::
vec3
,
LinearInterpolatorVec3
>
AnimationVec3Linear
;
ACGL_SMARTPOINTER_TYPEDEFS
(
AnimationVec3Linear
)
template
<
class
T
,
class
SpeedInterpolator
>
class
AnimationSpeed
:
public
Animation
{
public:
AnimationSpeed
(
T
&
_data
,
float
_targetSpeed
,
float
_acceleration
=
1.0
f
,
float
_decceleration
=
1.0
f
,
float
_startSpeed
=
0.0
f
,
const
SpeedInterpolator
&
_interpolator
=
SpeedInterpolator
())
:
mCurrentSpeed
(
_startSpeed
),
mTargetSpeed
(
_targetSpeed
),
mAcceleration
(
_acceleration
),
mDecceleration
(
_decceleration
),
mpData
(
_data
),
mInterpolator
(
_interpolator
){
}
virtual
void
init
()
{
mInterpolator
.
init
(
mpData
);
mInited
=
true
;
}
virtual
long
update
(
uint_t
_msec
)
{
//Calculate the distance
float
distance
=
mCurrentSpeed
*
((
float
)
_msec
)
/
1000.0
f
;
//Move on that distance
float
realDistance
=
mInterpolator
.
interpolate
(
mpData
,
distance
);
long
msecLeft
=
(
uint_t
)((
distance
-
realDistance
)
*
1000.0
f
/
mCurrentSpeed
);
//Adjust the speed
if
(
mCurrentSpeed
>
mTargetSpeed
)
mCurrentSpeed
-=
fmin
(
mCurrentSpeed
-
mTargetSpeed
,
mDecceleration
*
((
float
)
_msec
)
/
1000.0
f
);
else
mCurrentSpeed
+=
fmin
(
mTargetSpeed
-
mCurrentSpeed
,
mAcceleration
*
((
float
)
_msec
)
/
1000.0
f
);
return
msecLeft
;
}
virtual
bool
finished
()
{
if
(
mInterpolator
.
finished
())
mInited
=
false
;
return
mInterpolator
.
finished
();
}
SpeedInterpolator
&
getSpeedInterpolator
(){
return
mInterpolator
;}
void
setTargetSpeed
(
float
_value
)
{
mTargetSpeed
=
_value
;
}
void
setSpeed
(
float
_value
)
{
mCurrentSpeed
=
_value
;
}
void
setAcceleration
(
float
_value
)
{
mAcceleration
=
_value
;
}
void
setDecceleration
(
float
_value
)
{
mDecceleration
=
_value
;
}
private:
float
mCurrentSpeed
;
float
mTargetSpeed
;
float
mAcceleration
;
float
mDecceleration
;
T
&
mpData
;
SpeedInterpolator
mInterpolator
;
};
}
}
#endif // ACGL_ANIMATIONS_ANIMATION_HH
#endif
include/ACGL/Animations/EaseFunctions.hh
deleted
100644 → 0
View file @
dedbf29b
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
// See http://www.graphics.rwth-aachen.de/redmine/projects/acgl/wiki/ACGL_compile_time_settings
// for a comment what unsupported means.
#ifdef ACGL_INCLUDE_UNSUPPORTED
#ifndef ACGL_ANIMATIONS_EASEFUNCTIONS_HH
#define ACGL_ANIMATIONS_EASEFUNCTIONS_HH
#include <ACGL/ACGL.hh>
#include <ACGL/Math/Math.hh>
#include <ACGL/Base/Macros.hh>
namespace
ACGL
{
namespace
Animations
{
class
EaseFunction
{
public:
virtual
~
EaseFunction
(){}
virtual
float
value
(
const
float
_progress
)
=
0
;
};
ACGL_SMARTPOINTER_TYPEDEFS
(
EaseFunction
)
/*
float Linear(float progress, ease_function_parameter& parameter);
float InQuad(float progress, ease_function_parameter& parameter);
float OutQuad(float progress, ease_function_parameter& parameter);
float InOutQuad(float progress, ease_function_parameter& parameter);
float BlendLinear(float progress, ease_function_parameter& parameter);
float BlendSin(float progress, ease_function_parameter& parameter);
float BlendCos(float progress, ease_function_parameter& parameter);
float BlendSinDamped(float progress, ease_function_parameter& parameter);
float BlendCosDamped(float progress, ease_function_parameter& parameter);
*/
namespace
EaseFunctions
{
class
Linear
:
public
EaseFunction
{
public:
Linear
(){
}
virtual
~
Linear
(){}
virtual
float
value
(
const
float
_progress
)
{
return
_progress
;
}
};
class
InQuad
:
public
EaseFunction
{
public:
InQuad
(){
}
virtual
~
InQuad
(){}
virtual
float
value
(
const
float
_progress
)
{
return
_progress
*
_progress
;
}
};
class
OutQuad
:
public
EaseFunction
{
public:
OutQuad
(){
}
virtual
~
OutQuad
(){}
virtual
float
value
(
const
float
_progress
)
{
return
1.0
f
-
_progress
*
_progress
;
}
};
class
InOutQuad
:
public
EaseFunction
{
public:
InOutQuad
(){
}
virtual
~
InOutQuad
(){}
virtual
float
value
(
const
float
_progress
)
{
if
(
_progress
<
0.5
)
return
2.0
f
*
_progress
*
_progress
;
else
return
1.0
f
-
2.0
f
*
pow
(
_progress
-
1.0
f
,
2.0
f
);
}
};
class
Sin
:
public
EaseFunction
{
public:
Sin
(
float
_frequency
=
1.0
f
)
:
mFrequency
(
_frequency
)
{
}
virtual
~
Sin
(){}
virtual
float
value
(
const
float
_progress
)
{
return
sin
(
0.5
f
*
(
float
)
M_PI
*
mFrequency
*
_progress
);
}
float
mFrequency
;
};
class
BlendLinear
:
public
EaseFunction
{
public:
BlendLinear
(){
}
virtual
~
BlendLinear
(){}
virtual
float
value
(
const
float
_progress
)
{
return
2.0
f
*
Math
::
Functions
::
min
(
_progress
,
1.0
f
-
_progress
);
}
};
class
BlendSin
:
public
EaseFunction
{
public:
BlendSin
(){
}
virtual
~
BlendSin
(){}
virtual
float
value
(
const
float
_progress
)
{
return
sin
(
20
*
(
float
)
M_PI
*
_progress
);
}
};
class
BlendCos
:
public
EaseFunction
{
public:
BlendCos
(){
}
virtual
~
BlendCos
(){}
virtual
float
value
(
const
float
_progress
)
{
return
cos
(
6
*
(
float
)
M_PI
*
_progress
)
-
1.0
f
;
}
};
class
BlendSinDamped
:
public
EaseFunction
{
public:
BlendSinDamped
(){
}
virtual
~
BlendSinDamped
(){}
virtual
float
value
(
const
float
_progress
)
{
return
2.0
f
*
Math
::
Functions
::
min
(
_progress
,
1.0
f
-
_progress
)
*
sin
(
10.0
f
*
(
float
)
M_PI
*
_progress
);
}
};
class
BlendCosDamped
:
public
EaseFunction
{
public:
BlendCosDamped
(){
}
virtual
~
BlendCosDamped
(){}
virtual
float
value
(
const
float
_progress
)
{
return
2.0
f
*
Math
::
Functions
::
min
(
_progress
,
1.0
f
-
_progress
)
*
cos
(
10.0
f
*
(
float
)
M_PI
*
_progress
);
}
};
}
}
}
#endif // ACGL_ANIMATIONS_EASEFUNCTIONS_HH
#endif
include/ACGL/Animations/Interpolator.hh
deleted
100644 → 0
View file @
dedbf29b
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
// See http://www.graphics.rwth-aachen.de/redmine/projects/acgl/wiki/ACGL_compile_time_settings
// for a comment what unsupported means.
#ifdef ACGL_INCLUDE_UNSUPPORTED
#ifndef ACGL_ANIMATIONS_INTERPOLATOR_HH
#define ACGL_ANIMATIONS_INTERPOLATOR_HH
#include <ACGL/ACGL.hh>
#include <ACGL/Animations/EaseFunctions.hh>
#include <ACGL/Scene/NURBSCurve.hh>
#include <ACGL/Types.hh>
#include <ACGL/Base/Macros.hh>
#include <vector>
namespace
ACGL
{
namespace
Animations
{
class
BlendInterpolator
{
public:
virtual
void
blend
(
const
void
*
value
,
const
float
progress
)
=
0
;
};
ACGL_SMARTPOINTER_TYPEDEFS
(
BlendInterpolator
)
struct
interpolator_blend_t
{
EaseFunction
*
ease_function
;
BlendInterpolator
*
interpolator
;
float
start
,
end
;
};
typedef
std
::
vector
<
interpolator_blend_t
>
BlendVector
;
// Interpolator *************************************************************************************
template
<
class
T
>
class
LinearInterpolator
:
public
BlendInterpolator
{
public:
LinearInterpolator
()
:
mStartValue
(),