3#include "../../../../Source/Components/Core/DynamicComponent.h"
4#include "../../../../Source/Resources/Resources.h"
7#include "Foundation/ComponentModel/Entity.h"
8#include "Components/Core/RenderComponent.h"
10#include <glm/vec3.hpp>
11#include <glm/vec4.hpp>
12#include <glm/mat4x4.hpp>
73 float tickSizeOffset = 0.05f;
93 static void registerType();
95 void initialize(
Context * context);
99 bool initialUpdate =
true;
107 std::vector<EntityPtr> unprocessedAutoNodes;
111 bool visible =
false;
123 bool visible =
false;
130 void updateQuadGeometry(
int face,
EntityPtr material);
132 void updateCorners();
136 void updateTickSizes();
138 void updateFaceVisibilites(
bool forceUpdate);
140 void updateEdgeVisibilites(
bool forceUpdate);
142 void updateAxisLabels(
bool forceUpdate);
144 void updateGridGeometry(
int face);
146 void updateAnnotationAxes();
151template<>
inline Cogs::StringView getName<Cogs::Core::AxisCubeComponent>() {
return "AxisCubeComponent"; }
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Base class for components implementing dynamic behavior.
Provides a weakly referenced view over the contents of a string.
std::shared_ptr< ComponentModel::Entity > EntityPtr
Smart pointer for Entity access.
RenderLayers
Contains common render layers.
Contains all Cogs related functionality.
A cube with grids on the side faces.
glm::mat4 worldToLocal
Cached inverted local to world matrix.
glm::vec3 adjustedMinCorner
Minimum corner of the cube.
glm::vec3 autoAdjustMargin
A margin applied to the bounding box of the encased Entity, this property only works alongside autoNo...
glm::vec3 corners[8]
Local-space positions of the eight corners.
float tickProtrusion
Distance the grid lines protrude through the edge.
glm::vec3 unitScales
Size of unit coordinate axis in unitname-units.
glm::vec3 minCorner
Minimum corner of the cube.
float annotationGap
Distance between axis annotations.
std::vector< std::string > unitNames
Name of the x,y,z-axis units.
glm::vec3 maxCorner
Maximum corner of the cube.
int maxAxisValues
The maximum number of axis annotation values to use.
bool useAxisAnnotations
If the axis cube should create axis annotation text.
std::vector< WeakEntityPtr > autoNodes
Entities(Nodes) that are to be encased by this AxisCube.
glm::vec4 textColor
Color of text, to be forwarded to children.
glm::vec3 adjustedMaxCorner
Maximum corner of the cube.
glm::bvec3 markerFaces
False if wall-marker should lie on min-face, true if max-face.
glm::vec3 tickSizes
Size of axis ticks (in unit-units):
bool autoAdjustToLargestDimension
If the auto adjustment should make the box equal in size along all axes.
float zScale
Amount to scale the z-axis.
std::vector< std::string > axisTitles
Titles for the x,y,z-axises.