Cogs.Core
Extensions
Drilling
Source
RiserTelescopicJointComponent.h
1
#include "EntityDefinition.h"
2
#include "Components/Core/DynamicComponent.h"
3
4
#include <glm/vec4.hpp>
5
6
namespace
Cogs
7
{
8
namespace
Core
9
{
10
class
Context;
11
12
class
RiserTelescopicJointComponent
:
public
DynamicComponent
13
{
14
public
:
15
bool
reverse
=
false
;
16
17
float
topLength
= 5.0f;
18
float
armLength
= 15.0f;
19
float
cylinderLength
= 15.0f;
20
21
float
armInnerRadius
= 0.7f;
22
float
armOuterRadius
= 0.8f;
23
24
float
cylinderOuterRadius
= 1.2f;
25
float
innerCylinderLength
= 10.0f;
26
27
float
pistonRadius
= 1.1f;
28
float
pistonLength
= 0.5f;
29
30
glm::vec4
armColor
= glm::vec4(0.5f, 0.5f, 0.5f, 1.0f);
31
32
float
connectorRadius
= 1.2f;
33
float
connectorLength
= 1.0f;
34
35
float
startDepth
= 0.0f;
36
float
endDepth
= 100.0f;
37
38
static
void
registerType();
39
40
void
initialize(
Context
* context);
41
void
update();
42
void
updateChildren();
43
44
private
:
45
void
updateBody
(
const
std::vector<float> & trajectoryDepths);
46
void
updateArm
(
const
std::vector<float> & trajectoryDepths);
47
void
updateTop
(
const
std::vector<float> & trajectoryDepths);
48
49
EntityPtr
body;
50
EntityPtr
arm;
51
EntityPtr
top;
52
};
53
}
54
}
55
56
template
<>
inline
Cogs::StringView
getName<Cogs::Core::RiserTelescopicJointComponent>() {
return
"RiserTelescopicJointComponent"
; }
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::DynamicComponent
Base class for components implementing dynamic behavior.
Definition:
DynamicComponent.h:31
Cogs::Core::RiserTelescopicJointComponent
Definition:
RiserTelescopicJointComponent.h:13
Cogs::Core::RiserTelescopicJointComponent::armOuterRadius
float armOuterRadius
Outer radius of the arm.
Definition:
RiserTelescopicJointComponent.h:22
Cogs::Core::RiserTelescopicJointComponent::updateBody
void updateBody(const std::vector< float > &trajectoryDepths)
Updates the extrusion profile for the cylinder.
Definition:
RiserTelescopicJointComponent.cpp:176
Cogs::Core::RiserTelescopicJointComponent::endDepth
float endDepth
End depth of the component.
Definition:
RiserTelescopicJointComponent.h:36
Cogs::Core::RiserTelescopicJointComponent::connectorRadius
float connectorRadius
Length of the connectors.
Definition:
RiserTelescopicJointComponent.h:32
Cogs::Core::RiserTelescopicJointComponent::pistonRadius
float pistonRadius
Piston radius.
Definition:
RiserTelescopicJointComponent.h:27
Cogs::Core::RiserTelescopicJointComponent::innerCylinderLength
float innerCylinderLength
Length of the inner cylinder (inner stroke length).
Definition:
RiserTelescopicJointComponent.h:25
Cogs::Core::RiserTelescopicJointComponent::updateTop
void updateTop(const std::vector< float > &trajectoryDepths)
Update the extrusion profile for the arm.
Definition:
RiserTelescopicJointComponent.cpp:140
Cogs::Core::RiserTelescopicJointComponent::cylinderOuterRadius
float cylinderOuterRadius
Outer radius of the cylinder part.
Definition:
RiserTelescopicJointComponent.h:24
Cogs::Core::RiserTelescopicJointComponent::reverse
bool reverse
If the joint profile should be reversed, i.e the arm after the cylinder.
Definition:
RiserTelescopicJointComponent.h:15
Cogs::Core::RiserTelescopicJointComponent::cylinderLength
float cylinderLength
Length of the cylinder.
Definition:
RiserTelescopicJointComponent.h:19
Cogs::Core::RiserTelescopicJointComponent::connectorLength
float connectorLength
Radius of the connectors.
Definition:
RiserTelescopicJointComponent.h:33
Cogs::Core::RiserTelescopicJointComponent::armInnerRadius
float armInnerRadius
Inner radius of the arm.
Definition:
RiserTelescopicJointComponent.h:21
Cogs::Core::RiserTelescopicJointComponent::armColor
glm::vec4 armColor
Arm color.
Definition:
RiserTelescopicJointComponent.h:30
Cogs::Core::RiserTelescopicJointComponent::topLength
float topLength
Length of the arm tip.
Definition:
RiserTelescopicJointComponent.h:17
Cogs::Core::RiserTelescopicJointComponent::armLength
float armLength
Length of the stroke arm.
Definition:
RiserTelescopicJointComponent.h:18
Cogs::Core::RiserTelescopicJointComponent::pistonLength
float pistonLength
Piston length.
Definition:
RiserTelescopicJointComponent.h:28
Cogs::Core::RiserTelescopicJointComponent::updateArm
void updateArm(const std::vector< float > &trajectoryDepths)
Update the extrusion profile for the arm.
Definition:
RiserTelescopicJointComponent.cpp:98
Cogs::Core::RiserTelescopicJointComponent::startDepth
float startDepth
Starting depth of the component.
Definition:
RiserTelescopicJointComponent.h:35
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:24
Cogs::Core::EntityPtr
std::shared_ptr< ComponentModel::Entity > EntityPtr
Smart pointer for Entity access.
Definition:
EntityPtr.h:12
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Generated by
1.9.6