Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
WarScene.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_WAR_SCENE_H
34#define DVD_WAR_SCENE_H
35
37
38namespace Divide {
39class NPC;
40class GUIMessageBox;
41class TransformComponent;
42class RigidBodyComponent;
43class SkinnedSubMesh;
44
45namespace AI {
46 class AITeam;
47 class AIEntity;
48 class WarSceneOrder;
49};
50
51BEGIN_SCENE(WarScene)
52 explicit WarScene(PlatformContext& context, Project& parent, const SceneEntry& entry);
53 ~WarScene() override;
54
55 bool load() override;
56 bool unload() override;
57 void postLoadMainThread() override;
58 void updateSceneStateInternal(U64 deltaTimeUS) override;
60
61 void registerPoint(U16 teamID, const string& unitName);
62 void printMessage(U8 eventId, const string& unitName) const;
63 void debugDraw( GFX::CommandBuffer& bufferInOut, GFX::MemoryBarrierCommand& memCmdInOut ) override;
64
65 private:
66 void onSetActive() override;
67 void startSimulation(I64 btnGUID);
68 void toggleCamera(InputParams param);
69 bool removeUnits();
70 bool addUnits();
71 bool resetUnits();
73 void weaponCollision(const RigidBodyComponent& collider);
75 bool initializeAI(bool continueOnErrors);
76 bool deinitializeAI(bool continueOnErrors);
77
78 void toggleTerrainMode();
79
80 private:
83
84 private: // Game
89 bool _sceneReady = false;
90 bool _resetUnits = false;
91 bool _terrainMode = false;
96 SceneGraphNode* _flag[2]{nullptr, nullptr};
100 AI::AITeam* _faction[2]{nullptr, nullptr};
101END_SCENE(WarScene)
102
103} // namespace Divide
104
105#endif //DVD_WAR_SCENE_H
#define BEGIN_SCENE(SceneName)
Definition: Scene.h:554
#define END_SCENE(SceneName)
Definition: Scene.h:558
Based on OgreCrowd.
Definition: AIEntity.h:60
IMPrimitive replaces immediate mode calls to VB based rendering.
Definition: IMPrimitive.h:58
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
void updateSceneStateInternal(U64 deltaTimeUS) override
bool load() override
void weaponCollision(const RigidBodyComponent &collider)
Definition: WarScene.cpp:819
void onSetActive() override
AI::AITeam * _faction[2]
Teams are factions for AIEntites so they can manage friend/foe situations.
Definition: WarScene.h:100
U64 _lastNavMeshBuildTime
Definition: WarScene.h:92
U64 _elapsedGameTime
Definition: WarScene.h:88
SceneGraphNode * _firstPersonWeapon
Definition: WarScene.h:98
bool unload() override
bool removeUnits()
Definition: WarSceneAI.cpp:160
bool deinitializeAI(bool continueOnErrors)
Definition: WarSceneAI.cpp:436
uint8_t U8
bool addUnits()
Definition: WarSceneAI.cpp:176
void toggleCamera(InputParams param)
Definition: WarScene.cpp:548
vector< TransformComponent * > _lightNodeTransforms
Definition: WarScene.h:82
~WarScene() override
Definition: WarScene.cpp:61
vector< SceneGraphNode * > _armyNPCs[2]
NPC's are the actual game entities.
Definition: WarScene.h:94
SceneGraphNode * _particleEmitter
Definition: WarScene.h:97
eastl::vector< Type > vector
Definition: Vector.h:42
U32 _scoreLimit
Definition: WarScene.h:86
bool _sceneReady
Definition: WarScene.h:89
Project & parent
Definition: DefaultScene.h:41
uint16_t U16
U32 _runCount
Definition: WarScene.h:87
SceneGraphNode * _flag[2]
Definition: WarScene.h:96
IMPrimitive * _targetLines
Definition: WarScene.h:95
bool _resetUnits
Definition: WarScene.h:90
bool initializeAI(bool continueOnErrors)
Definition: WarSceneAI.cpp:138
bool _terrainMode
Definition: WarScene.h:91
void startSimulation(I64 btnGUID)
Definition: WarSceneAI.cpp:457
void toggleTerrainMode()
Definition: WarScene.cpp:69
AI::AIEntity * findAI(SceneGraphNode *node)
Definition: WarSceneAI.cpp:412
U32 _timeLimitMinutes
Definition: WarScene.h:85
void debugDraw(GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) override
void registerPoint(U16 teamID, const string &unitName)
Definition: WarSceneAI.cpp:113
GUIMessageBox * _infoBox
Definition: WarScene.h:81
bool resetUnits()
Definition: WarSceneAI.cpp:426
void checkGameCompletion()
Definition: WarSceneAI.cpp:45
void postLoadMainThread() override
int64_t I64
uint32_t U32
Project const SceneEntry & entry
Definition: DefaultScene.h:41
void printMessage(U8 eventId, const string &unitName) const
Definition: WarSceneAI.cpp:25
uint64_t U64
U16 registerInputActions() override
Definition: Scene.h:112