Attributes are used to attach auxilary data to each vertex in a spline. @description The elements of the attribute are of homogenous type. New elements can not be added or removed manually as the number of elements always matches the number of vertices in the spline.
More...
#include <SplineAttribute.h>
Inherits SplineComponentNotificationBus::Handler.
|
using | Interpolator = AZStd::function< AttributeType(AttributeType, AttributeType, float)> |
| Interpolation function.
|
|
|
static void | Reflect (AZ::SerializeContext &context) |
|
|
void | OnVertexAdded (size_t index) override |
|
void | OnVertexRemoved (size_t index) override |
|
void | OnVerticesSet (const AZStd::vector< AZ::Vector3 > &vertices) override |
|
void | OnVerticesCleared () override |
|
|
static const AZ::Edit::ElementData * | GetElementDynamicEditData (const void *handlerPtr, const void *elementPtr, const AZ::Uuid &elementType) |
|
|
AZ::EntityId | m_entityId |
|
AZStd::vector< AttributeType > | m_elements |
| The attribute data elements.
|
|
AZ::Edit::ElementData | m_elementEditData |
| Custom editContext description to apply to each element.
|
|
template<typename AttributeType>
class LmbrCentral::SplineAttribute< AttributeType >
Attributes are used to attach auxilary data to each vertex in a spline. @description The elements of the attribute are of homogenous type. New elements can not be added or removed manually as the number of elements always matches the number of vertices in the spline.
◆ GetElement()
template<typename AttributeType >
Gets an element in the attribute.
- Parameters
-
index | The index of the element to get. |
- Returns
- the value of the point at the index specified.
◆ GetElementDynamicEditData()
template<typename AttributeType >
const AZ::Edit::ElementData * LmbrCentral::SplineAttribute< AttributeType >::GetElementDynamicEditData |
( |
const void * |
handlerPtr, |
|
|
const void * |
elementPtr, |
|
|
const AZ::Uuid & |
elementType |
|
) |
| |
|
staticprotected |
Dynamic edit data provider function. We use this to dynamically override the edit context for each element in the SplineAttribute. This enables components to set component-specific ranges and UI controls. handlerPtr: pointer to the object whose edit data registered the handler (i.e. the class instance pointer) elementPtr: pointer to the sub-member of handlePtr that we are querying edit data for (i.e. the member variable) elementType: uuid of the specific class type of the elementPtr The function can either return a pointer to the ElementData to use, or nullptr to use the default one.
◆ GetElementEditData()
template<typename AttributeType >
Returns the custom edit context data that we're using for each element in the attribute
- Returns
- The custom edit context data that we're using for each element in the attribute.
◆ GetElementInterpolated() [1/2]
template<typename AttributeType >
Evaluates an interpolated value between two elements in the attribute.
- Parameters
-
address | The address along the spline. |
interpolator | A function to interpolate between the elements. |
- Returns
- the interpolated value.
◆ GetElementInterpolated() [2/2]
template<typename AttributeType >
Evaluates an interpolated value between two elements in the attribute.
- Parameters
-
index | The beginning index. |
fraction | The percentage between this index and the next. |
interpolator | A function to interpolate between the elements. |
- Returns
- the interpolated value.
◆ SetElement()
template<typename AttributeType >
Sets an element in the spline attribute.
- Parameters
-
index | The index of the element to set. |
value | The value of the element to set. |
◆ SetElementEditData()
template<typename AttributeType >
Sets custom edit context data to use for each element in the attribute. This can be used to set sliders, ranges, etc on the SplineAttribute that are custom to a specific component.
- Parameters
-
elementData | The ElementData for us to copy and use for this instance of the SplineAttribute. |
◆ Size()
template<typename AttributeType >
Returns the number of elements in the attribute.
- Returns
- The number of elements in the attribute.
The documentation for this class was generated from the following files:
- Gems/LmbrCentral/Code/include/LmbrCentral/Shape/SplineAttribute.h
- Gems/LmbrCentral/Code/include/LmbrCentral/Shape/SplineAttribute.inl