Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Box3D.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_BOX_3D_H_
34#define DVD_BOX_3D_H_
35
37
38namespace Divide {
39
41{
42 public:
43 explicit Box3D( const ResourceDescriptor<Box3D>& descriptor );
44
45 bool load( PlatformContext& context ) override;
46
47 void setHalfExtent(const vec3<F32>& halfExtent);
48
49 const vec3<F32>& getHalfExtent() const noexcept;
50
51 void fromPoints(const std::initializer_list<vec3<F32>>& points,
52 const vec3<F32>& halfExtent);
53
54 void saveToXML(boost::property_tree::ptree& pt) const override;
55 void loadFromXML(const boost::property_tree::ptree& pt) override;
56
57 private:
58 const ResourceDescriptor<Box3D>& _descriptor;
59 vec3<F32> _halfExtent;
60};
61
63
64}; // namespace Divide
65
66#endif //DVD_BOX_3D_H_
#define TYPEDEF_SMART_POINTERS_FOR_TYPE(T)
#define DEFINE_3D_OBJECT_TYPE(Name, Enum)
Definition: SceneNodeFwd.h:128
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
bool load() override