Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* Copyright (c) 2017 DIVIDE-Studio
Copyright (c) 2009 Ionut Cava

This file is part of DIVIDE Framework.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software
and associated documentation files (the "Software"), to deal in the Software
without restriction,
including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software
is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/

#ifndef _SGN_COMPONENT_H_
#define _SGN_COMPONENT_H_

#include "Platform/Headers/PlatformDefines.h"

namespace Divide {

/// A generic component for the SceneGraphNode class
enum class RenderStage : U32;
class SceneGraphNode;
class RenderStagePass;
class SceneRenderState;

class SGNComponent : private NonCopyable {
   public:
    enum class ComponentType : U32 {
        ANIMATION = toBit(1),
        INVERSE_KINEMATICS = toBit(2),
        RAGDOLL = toBit(3),
        NAVIGATION = toBit(4),
        PHYSICS = toBit(5),
        BOUNDS = toBit(6),
        RENDERING = toBit(7),
        NETWORKING = toBit(8),
        UNIT = toBit(9),
        COUNT = 10
    };
    
    SGNComponent(ComponentType type, SceneGraphNode& parentSGN);
    virtual ~SGNComponent();

    virtual bool onRender(const SceneRenderState& sceneRenderState,
                          const RenderStagePass& renderStagePass) {
        ACKNOWLEDGE_UNUSED(sceneRenderState);
        ACKNOWLEDGE_UNUSED(renderStagePass);
        return true;
    }

    virtual void update(const U64 deltaTime) {
        _deltaTime = deltaTime;
        _elapsedTime += deltaTime;
    }

    virtual void resetTimers() {
        _deltaTime = 0UL;
        _elapsedTime = 0UL;
    }

    virtual void setActive(const bool state) {
        _parentNodeActive = state;
    }

    virtual void postLoad() {
    }

    inline ComponentType getType() const { return _type; }
    inline SceneGraphNode& getSGN() const { return _parentSGN; }
    
   protected:
    std::atomic_bool _parentNodeActive;
    /// Pointer to the SGN owning this instance of AnimationComponent
    SceneGraphNode& _parentSGN;
    ComponentType _type;
    U64 _elapsedTime;
    U64 _deltaTime;
};

};  // namespace Divide
#endif

Commits for Divide-Framework/trunk/Source Code/Graphs/Components/Headers/SGNComponent.h

Diff revisions: vs.
Revision Author Commited Message
949 Diff Diff IonutCava picture IonutCava Thu 19 Oct, 2017 21:48:37 +0000

[Ionut]
- More command buffer refactoring

948 Diff Diff IonutCava picture IonutCava Tue 17 Oct, 2017 22:41:09 +0000

[Ionut]
- Move rendering data caching outside of CommandBuffer and into RenderPackage for better control.

895 Diff Diff IonutCava picture IonutCava Wed 21 Jun, 2017 21:10:26 +0000

[IonutCava]
- Reorder and cleanup OpenGL backend a bit.
- Small code cleanup
- Some small profile-guided optimizations

851 Diff Diff IonutCava picture IonutCava Mon 06 Feb, 2017 23:38:14 +0000

[IonutCava]
- Replaced most RenderStage params with RenderStagePass types
- More work on water rendering

838 Diff Diff IonutCava picture IonutCava Mon 30 Jan, 2017 17:28:35 +0000

[IonutCava]
- Added a NetworkingComponent to SGNs
- Started cleaning up Client / Server architecture

836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

817 Diff Diff IonutCava picture IonutCava Sun 15 Jan, 2017 21:29:59 +0000

[IonutCava]
- Add a new Unit component to SGNs that holds NPC/Player/etc. objects
- Add support for multiple keyboard+mouse combos and joysticks and add mapping between these and players

773 Diff Diff IonutCava picture IonutCava Tue 04 Oct, 2016 15:53:18 +0000

[IonutCava]
- Split GenericDrawCommand gathering system into Init/Update to facilitate future threading support
- Fix drawCount() == 0 case in submitRenderCommand
- Make _cameraPool (more) threadsafe

650 Diff Diff IonutCava picture IonutCava Tue 23 Feb, 2016 16:54:54 +0000

[IonutCava]
- Fix decoupling between PhysicsComponent and BoundsComponent
— SceneNodes now keep references to all owning SGNs and informs them when the bounds change
- AnimationComponent does not need a SceneAnimator on creation but most functionality will assert if one is not specified
— This was needed for the new component configuration system
- Added placeholder classes for an Inverse Kinematic component and a Ragdoll component
- SNG component configuration is now an upfront requirement: pass a component type mask when adding a node the the scenegraph
- SGN SpatialPartitionFlag is now an update flag that is set and cleared. More flags can be added in a similar fashion to nodes

648 IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these