2D and 3D interpolation: the current implementation
A complete 3D example and verified local-hierarchy, visual-transform and particle distinctions.
Shared rules
Both dimensions have a global setting, an Entity mode and history resets after discontinuities. Ordinary transform properties describe entity state while rendering can draw an intermediate pose. Parents affect the final image too, so inspect the entire moving branch.
Current Reckfell 3D uses EntityTreeFTI: it interpolates local transforms and composes the resulting world hierarchy. An Off child's own local transform is not smoothed, but an interpolated parent's motion still contributes to its world transform. A running-render test specifically checks this case.
Run the 3D comparison
Enable physics/common/physics_interpolation, temporarily choose 10 physics ticks/s and render more frequently. Add the file below to a C# project, attach it to an Entity3D root in a separate level, build and press F6. Use a 640×420 or larger window and a stationary unscaled root. Code creates the camera and visible meshes; no external materials/lighting are required.
Blue and white receive the same physics X coordinate; blue uses On and white Off. The image captures one frame; compare smoothness by running it. Boundary wrapping resets history rather than drawing a sweep across the whole world.
InterpolationDemo3D.cs
using System;
using Reckfell;
public partial class InterpolationDemo3D : Entity3D
{
public MeshInstance3D Smooth { get; private set; } = null!;
public MeshInstance3D Stepped { get; private set; } = null!;
public Camera3D Camera { get; private set; } = null!;
public float Speed { get; set; } = 1.5f;
public int Warps { get; private set; }
private float _x = -2;
private float? _warp;
public override void _Ready()
{
Smooth = Marker(new Vector3(_x,1,0),new Color(.25f,.45f,1),PhysicsInterpolationModeEnum.On);
Stepped = Marker(new Vector3(_x,-1,0),Colors.White,PhysicsInterpolationModeEnum.Off);
Camera = new Camera3D { Position = new Vector3(0,0,8), Projection = Camera3D.ProjectionType.Orthogonal, Size = 7, Current = true, PhysicsInterpolationMode = PhysicsInterpolationModeEnum.Off }; AddChild(Camera);
AddChild(new Label { Text = "On", Position = new Vector2(24,56), Modulate = new Color(.6f,.6f,.6f) });
AddChild(new Label { Text = "Off", Position = new Vector2(24,226), Modulate = new Color(.6f,.6f,.6f) });
ResetPhysicsInterpolation();
}
private MeshInstance3D Marker(Vector3 position,Color color,PhysicsInterpolationModeEnum mode)
{
var marker = new MeshInstance3D { Position = position, PhysicsInterpolationMode = mode, Mesh = new BoxMesh { Size = Vector3.One*.4f }, MaterialOverride =
new StandardMaterial3D { AlbedoColor = color, ShadingMode = BaseMaterial3D.ShadingModeEnum.Unshaded } };
AddChild(marker); return marker;
}
public void RequestWarp(float x)
{
if (!float.IsFinite(x)) throw new ArgumentOutOfRangeException(nameof(x));
_warp = x;
}
public override void _PhysicsProcess(double delta)
{
bool reset = _warp.HasValue;
_x = _warp ?? (_x + Speed * (float)delta); _warp = null;
if (_x > 3) { _x = -2; reset = true; }
Smooth.Position = new Vector3(_x,1,0); Stepped.Position = new Vector3(_x,-1,0);
if (reset) { ResetPhysicsInterpolation(); Warps++; }
}
}Read position for visual use
In 3D, GetGlobalTransformInterpolated supplies a visual world transform to consumers such as a camera. In a physics callback or with the global system disabled it does not provide a separate future simulation. Do not use it for authoritative collision calculations. Entity2D has no same-named SDK method. For screen coordinates, separately reconcile Canvas, camera and viewport.
TopLevel and reparenting change spatial hierarchy; they are not merely smoothing-quality switches. Check local/world coordinates and history after reparenting. Off not canceling parent motion does not imply a broken local mode.
Particles and other systems
The C# types GpuParticles2D/GpuParticles3D have their own FixedFps, Interpolate and LocalCoords. These concern particle simulation/rendering, not Entity.PhysicsInterpolationMode itself. Separately test emitter motion, existing particle trails, restarting and teleporting. One global setting does not prove identical results for every GPU/CPU particle setup.
For a per-frame camera, use the separate follow example. MultiMesh requires consistent instance histories, and skeletal animation has its own timing. This article's tests cover simple Entity/MeshInstance motion and hierarchy, not every particle/skeleton/renderer combination.