跳到主要内容
知仓学习社ZHICANG

game-smooth-curves-and-motion

Design smooth game motion with splines, Bezier curves, interpolation, derivative continuity, path parameterization, and speed control. Use when impl…

不碰外部(只输出文字)无严重或高危命中hashgraph-online/awesome-codex-plugins

它会碰到什么

扫了多少1 个文本文件,4 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Game Smooth Curves And Motion

Use this skill to design path and curve systems where continuity, control, and

game feel matter more than exact mathematical purity.

Primary source: Geometry for Programmers by Oleksandr Kaleniuk

(https://www.manning.com/books/geometry-for-programmers), transformed and

paraphrased, especially chapters 5-7. Additional source: A Primer on Bezier

Curves by Pomax (https://pomax.github.io/bezierinfo/).

Core Workflow

  1. Identify what must be smooth: position, tangent direction, speed, curvature,

camera orientation, banking, or animation value.

  1. Choose the curve family that gives the needed controls with the least state:

linear segments, cubic Hermite, Catmull-Rom, Bezier, B-spline, NURBS, or a

custom polynomial piece.

  1. Define continuity targets:
  • C0: pieces meet at positions.
  • C1: tangents match for visually smooth direction.
  • C2: curvature changes smoothly.
  1. Decide parameterization: uniform t, chord length, centripetal, explicit

timing, or arc-length lookup.

  1. Separate authoring controls from runtime samples. Designers may edit points

and handles; the game may use baked lookup tables.

  1. Test extreme control points, sharp turns, closed loops, repeated points, and

speed variation.

Curve Selection

  • Use linear segments for grid motion, debug paths, and intentionally sharp

routes.

  • Use cubic Hermite when you know endpoint positions and tangent vectors.
  • Use Bezier curves when control handles are the natural authoring interface.
  • Use Catmull-Rom-style splines when paths should pass through waypoints with

minimal handle authoring.

  • Use B-splines or NURBS when many control points, high continuity, or exact

conic sections matter.

  • Avoid one high-degree global polynomial through many points. Split into

pieces to avoid oscillation and poor local control.

Motion Rules

  • Smooth position does not imply smooth speed. Check derivative length along

the path.

  • Constant t increments rarely produce constant world-space speed.
  • For nearly constant speed, precompute an arc-length table and map distance

traveled back to curve parameter.

  • Tangent length affects both speed and curve shape in Hermite-like systems.
  • Normalize tangent direction only when speed should be controlled separately.
  • Keep gameplay collision separate from visual smoothing when curves are only

a presentation layer.

Implementation Checklist

  • Curve type and continuity target are documented.
  • Parameter range and units are explicit.
  • Closed paths handle first/last continuity deliberately.
  • Runtime evaluation is bounded and allocation-free in hot paths.
  • Baked samples include position, tangent, optional normal/binormal, and

cumulative distance when needed.

  • Debug view shows control points, handles, samples, tangents, and speed heat.

Common Mistakes

  • Using interpolation that passes through every point when approximation would

be smoother and more stable.

  • Assuming Bezier handles are points on the curve.
  • Letting repeated or near-repeated points create undefined tangents.
  • Moving a camera at constant parameter speed and calling the result constant

motion.

  • Adding more control points to fix a curve that needs a different

parameterization or continuity target.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。