Navigation
API > API/Runtime > API/Runtime/GeometryCore
Simple custom attribute type for splines Demonstrates the requirements for a custom attribute type
Custom types need to provide certain operations for use with splines:
Basic arithmetic: operator-(const T&), operator+(const T&), operator*(float)
Optional helper methods that improve performance: Size(), SizeSquared(), Dot(), etc.
If your type doesn't provide some of these methods, spline operations will still work using fallback implementations, but may be less efficient.
| Name | FFoo |
| Type | struct |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Splines/CustomAttributeExample.h |
| Include Path | #include "Splines/CustomAttributeExample.h" |
Syntax
struct FFoo
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FFoo () |
Constructor. | Splines/CustomAttributeExample.h | |
FFoo
(
float InValue |
Constructor with value. | Splines/CustomAttributeExample.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Value | float | A simple float value attribute. | Splines/CustomAttributeExample.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
float Dot
(
const FFoo& Other |
Dot product with another FFoo (required for some operations) | Splines/CustomAttributeExample.h | |
FFoo GetSafeNormal() |
Get a normalized version (for when direction matters) | Splines/CustomAttributeExample.h | |
bool Serialize
(
FArchive& Ar |
Serialization support. | Splines/CustomAttributeExample.h | |
float Size() |
Size method that returns the "magnitude" of this type For a float-based type, we'll use absolute value | Splines/CustomAttributeExample.h | |
float SizeSquared() |
Square size (optimization to avoid square root) | Splines/CustomAttributeExample.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Add operator- for parameterization. | Splines/CustomAttributeExample.h | ||
FFoo operator*
(
float Scale |
Splines/CustomAttributeExample.h | ||
| Add operator+ for parameterization. | Splines/CustomAttributeExample.h | ||
bool operator==
(
const FFoo& Other |
Splines/CustomAttributeExample.h |