Skyscraper
2.0
src
sbs
step.cpp
Go to the documentation of this file.
1
/*
2
Scalable Building Simulator - Step Object
3
The Skyscraper Project - Version 2.0
4
Copyright (C)2004-2024 Ryan Thoryk
5
https://www.skyscrapersim.net
6
https://sourceforge.net/projects/skyscraper/
7
Contact - ryan@skyscrapersim.net
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License
11
as published by the Free Software Foundation; either version 2
12
of the License, or (at your option) any later version.
13
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
18
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
*/
23
24
#include "
globals.h
"
25
#include "
sbs.h
"
26
#include "
camera.h
"
27
#include "
step.h
"
28
29
namespace
SBS
{
30
31
Step::Step
(
Object
* parent,
const
std::string &name,
DynamicMesh
* wrapper,
int
max_render_distance) :
MeshObject
(parent, name, wrapper,
""
,
""
, max_render_distance)
32
{
33
vector
= Vector3::ZERO;
34
speed
= 0;
35
start
= Vector3::ZERO;
36
}
37
38
void
Step::Move
(
const
Vector3
&vector,
Real
speed)
39
{
40
//move step according to vector and speed
41
42
MeshObject::Move
(
vector
,
speed
);
43
this->vector =
vector
;
44
this->speed =
speed
;
45
}
46
47
void
Step::OnHit
()
48
{
49
//move camera along with step, when user is on it
50
51
sbs
->
camera
->
MovePosition
(
vector
* 1.675,
speed
);
52
}
53
54
}
camera.h
SBS::Camera::MovePosition
bool MovePosition(Vector3 vector, Real speed=1.0)
Definition
camera.cpp:353
SBS::DynamicMesh
Definition
dynamicmesh.h:30
SBS::MeshObject
Definition
mesh.h:44
SBS::ObjectBase::sbs
SBS * sbs
Definition
object.h:48
SBS::Object
Definition
object.h:56
SBS::Object::Move
virtual void Move(const Vector3 &vector, Real speed=1.0)
Definition
object.cpp:253
SBS::SBS::camera
Camera * camera
Definition
sbs.h:160
SBS::Step::vector
Vector3 vector
Definition
step.h:39
SBS::Step::start
Vector3 start
Definition
step.h:41
SBS::Step::OnHit
void OnHit()
Definition
step.cpp:47
SBS::Step::speed
Real speed
Definition
step.h:40
SBS::Step::Move
void Move(const Vector3 &vector, Real speed=1.0f)
Definition
step.cpp:38
SBS::Step::Step
Step(Object *parent, const std::string &name, DynamicMesh *wrapper, int max_render_distance=0)
Definition
step.cpp:31
globals.h
Vector3
Ogre::Vector3 Vector3
Definition
globals.h:58
Real
Ogre::Real Real
Definition
globals.h:57
SBS
Definition
skyscraper.h:45
sbs.h
step.h
Generated by
1.11.0