Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Infinity::Types::Spatial Namespace Reference

Classes

class  Spline2D
 Two-dimensional spline curve for procedural path and shape generation. More...
 
class  Spline3D
 Three-dimensional spline curve for procedural 3D path generation. More...
 
class  Spline4D
 Four-dimensional spline curve for extended parameter space interpolation. More...
 
class  SplineImplBase
 
struct  Transform
 Complete 3D spatial transformation combining position, rotation, and scale. More...
 
struct  Volume
 Axis-aligned bounding box (AABB) representing a rectangular 3D region. More...
 

Typedefs

using Point2D = Core::Value< Math::Vector2 >
 Two-dimensional point in space.
 
using Point = Core::Value< Math::Vector3 >
 Three-dimensional point in space.
 

Functions

INFINITY_API_TEMPLATE std::ostream & operator<< (std::ostream &out, const Transform &t)
 Stream output operator for Transform.
 
INFINITY_API_TEMPLATE std::istream & operator>> (std::istream &in, Transform &t)
 Stream input operator for Transform.
 
INFINITY_API_PUBLIC std::ostream & operator<< (std::ostream &out, const Volume &v)
 Stream output operator for Volume.
 
INFINITY_API_PUBLIC std::istream & operator>> (std::istream &in, Volume &v)
 Stream input operator for Volume.
 

Variables

enum INFINITY_API_TEMPLATE SplineKind
 
enum INFINITY_API_TEMPLATE CatmullRom = 1
 Catmull-Rom spline interpolation.
 
enum INFINITY_API_TEMPLATE BSpline = 2
 B-Spline (Basis spline) interpolation.
 
enum INFINITY_API_TEMPLATE Linear
 Linear interpolation.
 

Typedef Documentation

◆ Point

Three-dimensional point in space.

Point represents a position in 3D space using Vector3 coordinates wrapped in a Value<T> for type system integration. It serves as a semantic alias to distinguish spatial positions from directional vectors, normals, or other uses of Vector3 in procedural generation.

This is the primary type for representing spatial positions throughout the Infinity Engine's procedural generation systems, particularly for:

  • 3D geometry vertex positions
  • Control points for 3D curves and surfaces
  • Sample positions for 3D noise and density field evaluation
  • Placement coordinates for procedural object distribution
  • Waypoints and path nodes in procedural navigation
  • Particle and instancing positions
Note
This is a type alias to Value<Vector3>, not a distinct class.
Supports all Vector3 operations (addition, scaling, distance, dot/cross products, etc.).
Use Array<Point> for collections of 3D positions (point clouds, vertex buffers, etc.).

Example usage:

// Create control points for 3D spline
Array<Point> pathPoints;
pathPoints.push_back(Point{Vector3{0.0f, 0.0f, 0.0f}});
pathPoints.push_back(Point{Vector3{10.0f, 5.0f, 0.0f}});
pathPoints.push_back(Point{Vector3{20.0f, 0.0f, 5.0f}});
// Generate procedural point cloud
Array<Point> pointCloud;
for (int i = 0; i < 1000; ++i) {
Vector3 pos = generateProceduralPosition(i);
pointCloud.push_back(Point{pos});
}
// Use with ProceduralSystem
system->setIn("scatter_points", std::move(pointCloud));
// Sample points for marching cubes terrain
Array<Point> sampleGrid;
for (int z = 0; z < depth; ++z) {
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
sampleGrid.push_back(Point{Vector3{
static_cast<float>(x),
static_cast<float>(y),
static_cast<float>(z)
}});
}
}
}
Template wrapper for primitive types to integrate with the Infinity type system.
Definition Value.hpp:89
t_Vector3< float > Vector3
Alias for t_Vector3<float>, the default 3D vector type.
Definition Vector3.hpp:580
Core::Value< Math::Vector3 > Point
Three-dimensional point in space.
Definition Point.hpp:106

◆ Point2D

Two-dimensional point in space.

Point2D represents a position in 2D space using Vector2 coordinates wrapped in a Value<T> for type system integration. It serves as a semantic alias to distinguish spatial positions from directional vectors or other uses of Vector2 in procedural generation.

Common use cases:

  • Control points for 2D splines and curves
  • Sample positions for 2D noise evaluation
  • Vertex positions in 2D polygon generation
  • Grid coordinates in procedural pattern generation
  • Anchor points for 2D shape placement
Note
This is a type alias to Value<Vector2>, not a distinct class.
Supports all Vector2 operations (addition, scaling, distance, etc.).

Example usage:

// Create 2D points for a spline
Array<Point2D> controlPoints;
controlPoints.push_back(Point2D{Vector2{0.0f, 0.0f}});
controlPoints.push_back(Point2D{Vector2{50.0f, 100.0f}});
controlPoints.push_back(Point2D{Vector2{100.0f, 0.0f}});
// Use with ProceduralSystem
system->setIn("spline_points", std::move(controlPoints));
// Generate random sample points
Array<Point2D> samples;
for (int i = 0; i < 100; ++i) {
samples.push_back(Point2D{Vector2{randomFloat(), randomFloat()}});
}
t_Vector2< float > Vector2
Alias for t_Vector2<float>, the default 2D vector type.
Definition Vector2.hpp:487
Core::Value< Math::Vector2 > Point2D
Two-dimensional point in space.
Definition Point.hpp:49

Function Documentation

◆ operator<<() [1/2]

INFINITY_API_TEMPLATE std::ostream & Infinity::Types::Spatial::operator<< ( std::ostream &  out,
const Transform t 
)
inline

Stream output operator for Transform.

Writes the transform to an output stream in the format: "position rotation scale"

Parameters
outOutput stream.
tTransform to output.
Returns
Reference to the output stream.

◆ operator<<() [2/2]

INFINITY_API_PUBLIC std::ostream & Infinity::Types::Spatial::operator<< ( std::ostream &  out,
const Volume v 
)
inline

Stream output operator for Volume.

Writes the volume to an output stream in the format: "width height depth position"

Parameters
outOutput stream.
vVolume to output.
Returns
Reference to the output stream.

◆ operator>>() [1/2]

INFINITY_API_TEMPLATE std::istream & Infinity::Types::Spatial::operator>> ( std::istream &  in,
Transform t 
)
inline

Stream input operator for Transform.

Reads a transform from an input stream in the format: "position rotation scale"

Parameters
inInput stream.
tTransform to read into.
Returns
Reference to the input stream.

◆ operator>>() [2/2]

INFINITY_API_PUBLIC std::istream & Infinity::Types::Spatial::operator>> ( std::istream &  in,
Volume v 
)
inline

Stream input operator for Volume.

Reads a volume from an input stream in the format: "width height depth position"

Parameters
inInput stream.
vVolume to read into.
Returns
Reference to the input stream.

Variable Documentation

◆ BSpline

enum INFINITY_API_TEMPLATE Infinity::Types::Spatial::BSpline = 2

B-Spline (Basis spline) interpolation.

Approximating spline that provides local control - moving a control point only affects a local region of the curve. Does not necessarily pass through control points. Offers excellent smoothness and stability for shape design and surface modeling.

◆ CatmullRom

enum INFINITY_API_TEMPLATE Infinity::Types::Spatial::CatmullRom = 1

Catmull-Rom spline interpolation.

Interpolating spline that passes through all control points. Provides smooth curves with automatic tangent calculation based on neighboring points. Excellent for keyframe animation and paths that must hit specific positions.

◆ Linear

enum INFINITY_API_TEMPLATE Infinity::Types::Spatial::Linear
Initial value:
= 3
}

Linear interpolation.

Simple straight-line segments between control points. No smoothing - produces piecewise linear paths. Useful for polygonal paths and when sharp corners are desired.

◆ SplineKind

enum INFINITY_API_TEMPLATE Infinity::Types::Spatial::SplineKind
strong