Ocean
Loading...
Searching...
No Matches
OrientationInterpolator.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_SCENEDESCRIPTION_SDX_X3D_ORIENTATION_INTERPOLATOR_H
9#define META_OCEAN_SCENEDESCRIPTION_SDX_X3D_ORIENTATION_INTERPOLATOR_H
10
13
14namespace Ocean
15{
16
17namespace SceneDescription
18{
19
20namespace SDX
21{
22
23namespace X3D
24{
25
26/**
27 * This class implements an orientation interpolator node.
28 * @ingroup scenedescriptionsdxx3d
29 */
30class OCEAN_SCENEDESCRIPTION_SDX_X3D_EXPORT OrientationInterpolator : virtual public X3DInterpolatorNode
31{
32 private:
33
34 /**
35 * Definition of a vector holding quaternion rotation values.
36 */
37 typedef std::vector<Quaternion> QuaternionValues;
38
39 public:
40
41 /**
42 * Creates a new orientation interpolator node.
43 * @param environment Node environment
44 */
45 explicit OrientationInterpolator(const SDXEnvironment* environment);
46
47 protected:
48
49 /**
50 * Specifies the node type and the fields of this node.
51 * @return Unique node specification of this node
52 */
54
55 /**
56 * Event function to inform the node that it has been initialized and can apply all internal values to corresponding rendering objects.
57 * @see SDXNode::onInitialize().
58 */
59 void onInitialize(const Rendering::SceneRef& scene, const Timestamp timestamp) override;
60
61 /**
62 * Event function to inform the node about a changed field.
63 * @see SDXNode::onFieldChanged().
64 */
65 void onFieldChanged(const std::string& fieldName) override;
66
67 /**
68 * Event function for single value 'interpolates'.
69 * @see X3DInterpolationNode::onSingleValue().
70 */
71 void onSingleValue(const size_t index, const Timestamp eventTimestamp) override;
72
73 /**
74 * Event function to interpolate between two values.
75 * @see X3DInterpolationNode::onInterpolate().
76 */
77 void onInterpolate(const size_t leftIndex, const size_t rightIndex, const Scalar interpolationFactor, const Timestamp eventTimestamp) override;
78
79 /**
80 * Returns the address of the most derived object.
81 * @see Node::objectAddress().
82 */
83 size_t objectAddress() const override;
84
85 protected:
86
87 /// KeyValue field.
89
90 /// Value_changed field.
92
93 /// Vector holding the quaternion rotation values of the key values.
95};
96
97}
98
99}
100
101}
102
103}
104
105#endif // META_OCEAN_SCENEDESCRIPTION_SDX_X3D_ORIENTATION_INTERPOLATOR_H
This class implements a node specification object.
Definition scenedescription/Node.h:77
This class implements an orientation interpolator node.
Definition OrientationInterpolator.h:31
void onInterpolate(const size_t leftIndex, const size_t rightIndex, const Scalar interpolationFactor, const Timestamp eventTimestamp) override
Event function to interpolate between two values.
NodeSpecification specifyNode()
Specifies the node type and the fields of this node.
void onSingleValue(const size_t index, const Timestamp eventTimestamp) override
Event function for single value 'interpolates'.
void onFieldChanged(const std::string &fieldName) override
Event function to inform the node about a changed field.
OrientationInterpolator(const SDXEnvironment *environment)
Creates a new orientation interpolator node.
size_t objectAddress() const override
Returns the address of the most derived object.
std::vector< Quaternion > QuaternionValues
Definition of a vector holding quaternion rotation values.
Definition OrientationInterpolator.h:37
QuaternionValues quaternionRotations_
Vector holding the quaternion rotation values of the key values.
Definition OrientationInterpolator.h:94
SingleRotation valueChanged_
Value_changed field.
Definition OrientationInterpolator.h:91
void onInitialize(const Rendering::SceneRef &scene, const Timestamp timestamp) override
Event function to inform the node that it has been initialized and can apply all internal values to c...
MultiRotation keyValue_
KeyValue field.
Definition OrientationInterpolator.h:88
This class implements an abstract x3d interpolator node object.
Definition X3DInterpolatorNode.h:33
This class implements a node environment container.
Definition SDXNode.h:62
This class implements a timestamp.
Definition Timestamp.h:36
float Scalar
Definition of a scalar type.
Definition Math.h:129
The namespace covering the entire Ocean framework.
Definition Accessor.h:15