بنقرة واحدة
smooth-interpolation
Animate values smoothly using exponential decay instead of linear interpolation.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Animate values smoothly using exponential decay instead of linear interpolation.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Poll for changes to any value and trigger React re-renders when it changes.
Day-to-day coding style and patterns for R3F game development with Miniplex ECS.
Verekia's preferred project setup with Next.js Pages Router, Tailwind 4, oxfmt, oxlint, and TypeScript.
Use Zustand as a simple state store for entity management (not a true ECS).
Attach meshes to bones of a skinned mesh, such as attaching a sword to a character's hand.
Shake the camera when the player takes damage or on impacts for visual feedback.
| name | smooth-interpolation |
| description | Animate values smoothly using exponential decay instead of linear interpolation. |
Animate values smoothly using exponential decay instead of linear interpolation.
Use exponential smoothing formulas to interpolate between current and target values. This creates a natural easing effect that's frame-rate independent.
(target - current) * (1 - Math.exp(-speed * dt))target + (current - target) * Math.exp(-decay * dt)const addSmoothExp = (current: number, target: number, speed: number, dt: number) =>
(target - current) * (1 - Math.exp(-speed * dt))
const expDecay = (current: number, target: number, decay: number, dt: number) =>
target + (current - target) * Math.exp(-decay * dt)
useFrame((_, delta) => {
mesh.position.x += addSmoothExp(mesh.position.x, targetX, 3, delta)
// or
mesh.position.x = expDecay(mesh.position.x, targetX, 3, delta)
})
This skill is part of verekia's r3f-gamedev.