CORGI
An open source project by FPL.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
component_utils.h
Go to the documentation of this file.
1 // Copyright 2015 Google Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef CORGI_COMPONENT_LIBRARY_COMPONENT_UTILS_H_
16 #define CORGI_COMPONENT_LIBRARY_COMPONENT_UTILS_H_
17 
18 #include <cfloat>
19 #include "corgi/component.h"
20 #include "mathfu/glsl_mappings.h"
21 
22 namespace corgi {
23 namespace component_library {
24 /// @file
25 /// @addtogroup corgi_component_library
26 /// @{
27 ///
28 /// @fn bool GetMaxMinPositionsForEntity(corgi::EntityRef& entity,
29 /// corgi::EntityManager& entity_manager, mathfu::vec3* max,
30 /// mathfu::vec3* min)
31 ///
32 /// @brief Get the minimum and maximum positions of an Entity, based on its
33 /// and its children's rendermeshes.
34 ///
35 /// @param[in] entity An EntityRef reference to the Entity whose minimum and
36 /// maximum positions should be returned through the `min` and `max` parameters.
37 /// @param[in] entity_manager An EntityManager reference to the EntityManager
38 /// reponsible for managing this Entity.
39 /// @param[out] max A mathfu::vec3 pointer that is used to capture the output
40 /// value of the maximum Entity position.
41 /// @param[out] min A mathfu::vec3 pointer that is used to capture the output
42 /// value of the minimum Entity position.
43 ///
44 /// @return Returns `true` if `min` and `max` were set successfully. Otherwise
45 /// it returns false.
47  corgi::EntityManager& entity_manager,
48  mathfu::vec3* max, mathfu::vec3* min);
49 /// @}
50 
51 } // component_library
52 } // corgi
53 
54 #endif // CORGI_COMPONENT_LIBRARY_COMPONENT_UTILS_H_
bool GetMaxMinPositionsForEntity(corgi::EntityRef &entity, corgi::EntityManager &entity_manager, mathfu::vec3 *max, mathfu::vec3 *min)
Get the minimum and maximum positions of an Entity, based on its and its children's rendermeshes...
The EntityManager is the code that manages all Entities and Components in the game. Normally the game will instantiate EntityManager, and then use it to create and control all of its Entities.
Definition: entity_manager.h:61
A reference object for pointing into the vector pool. It acts as a pointer for vector pool elements a...
Definition: vector_pool.h:72