SPATIAL ENGINE

Spatial Engine

Physics, particles, animation, and spatial audio. Everything you need for immersive 3D worlds, optimized for XR.

1M
GPU Particles
Full IK
FABRIK + TwoBoneIK Pipeline
HRTF
Advanced Spatial Audio
60 Hz
Physics Tick Rate
PHYSICS

Physics Engine

Full 3D rigid body simulation with collision detection, raycasting, joints, and layered collision filtering.

  • Rigidbodies: dynamic, kinematic, and static with mass and inertia
  • Collision shapes: box, sphere, capsule, mesh, and compound
  • Raycasting and shape-casting with layer masks
  • Joints: hinge, ball, slider, spring, fixed, and 6-DOF
  • Collision layers and masks for fine-grained filtering
Key benefit: Deterministic physics at 60 Hz. Objects interact naturally in both VR and desktop modes.
// Create a dynamic rigidbody raku_physics_body_create(entity, RAKU_BODY_DYNAMIC); raku_physics_body_set_mass(entity, 2.5f); // Add collision shape raku_physics_shape_add_box(entity, 1.0f, 1.0f, 1.0f); raku_physics_set_layer(entity, RAKU_LAYER_PROPS); // Raycast with layer mask RakuHit hit; if (raku_physics_raycast(origin, dir, 100.0f, mask, &hit)) { apply_damage(hit.entity, 10); } // Create a hinge joint raku_physics_joint_hinge(door, frame, anchor, axis); raku_physics_joint_set_limits(joint, 0.0f, 1.57f);
VFX

Particle System

GPU-accelerated particle system capable of 1 million particles at 90 FPS. Force fields, trails, sub-emitters, and custom emitter shapes.

  • GPU particles with compute shader simulation
  • Force fields: gravity, wind, vortex, turbulence, attractor
  • Emitter shapes: point, sphere, cone, box, mesh surface, edge
  • Particle trails with width curves and gradient colors
  • Sub-emitters triggered on birth, death, or collision
Key benefit: Cinematic VFX at XR frame rates. Fire, smoke, magic, rain, and explosions without frame drops.
// Create GPU particle emitter RakuEmitter em = raku_vfx_emitter_create(RAKU_VFX_GPU); raku_vfx_emitter_set_rate(em, 50000); raku_vfx_emitter_set_shape(em, RAKU_SHAPE_CONE, 30.0f); // Lifetime, size, color over life raku_vfx_set_lifetime(em, 1.0f, 3.0f); raku_vfx_set_color_gradient(em, fire_gradient); raku_vfx_set_size_curve(em, grow_then_shrink); // Add force fields raku_vfx_force_add(em, RAKU_FORCE_TURBULENCE, 2.5f); raku_vfx_force_add(em, RAKU_FORCE_GRAVITY, -9.8f); // Enable trails raku_vfx_trail_enable(em, 0.3f); // trail time raku_vfx_trail_set_width(em, width_curve); // Sub-emitter on particle death raku_vfx_sub_emitter(em, RAKU_ON_DEATH, spark_em);
ANIMATION

Animation System

Production-grade animation with blend trees, state machines, inverse kinematics, and animation retargeting across different skeletons.

  • Blend trees with 1D, 2D freeform, and direct blending
  • State machines with transitions, conditions, and interrupts
  • IK solvers: FABRIK (multi-joint), TwoBoneIK (arms/legs)
  • Animation retargeting across different skeleton proportions
  • Additive layers, animation masking, and root motion
Key benefit: Animate any character naturally. IK makes hands reach doorknobs and feet match terrain automatically.
// Create animation state machine RakuAnimFSM fsm = raku_anim_fsm_create(entity); raku_anim_fsm_add_state(fsm, "idle", idle_clip); raku_anim_fsm_add_state(fsm, "walk", walk_blend_tree); raku_anim_fsm_add_state(fsm, "run", run_clip); // Transition: idle -> walk when speed > 0.1 raku_anim_fsm_transition(fsm, "idle", "walk", "speed", RAKU_GT, 0.1f, 0.2f); // TwoBoneIK for hand placement raku_anim_ik_two_bone(entity, "UpperArm_R", "LowerArm_R", "Hand_R", target_pos); // FABRIK chain for tentacle/tail raku_anim_ik_fabrik(entity, chain_bones, 6, target); // Retarget animation to different skeleton raku_anim_retarget(src_skeleton, dst_skeleton, clip);
AUDIO

Spatial Audio

True 3D audio with HRTF rendering, ambisonics, reverb zones, and occlusion. Sound that lives in the world.

  • HRTF (Head-Related Transfer Function) for binaural 3D positioning
  • Ambisonics encoding and decoding for immersive soundscapes
  • Reverb zones with room geometry estimation
  • Occlusion and obstruction modeling through walls and objects
  • Mixer groups with send/return routing and effects chains
Key benefit: Sound you can locate with your ears. Players hear enemies behind them, echoes in caves, muffled voices through doors.
// Create spatialized audio source RakuAudioSrc src = raku_audio_source_create(entity); raku_audio_source_set_clip(src, footstep_clip); raku_audio_source_set_spatial(src, true); // Enable HRTF raku_audio_set_hrtf_enabled(true); raku_audio_set_hrtf_profile(RAKU_HRTF_DEFAULT); // Add reverb zone RakuReverb rev = raku_audio_reverb_create(); raku_audio_reverb_set_preset(rev, RAKU_REVERB_CAVE); raku_audio_reverb_set_bounds(rev, cave_box); // Occlusion: sound through walls raku_audio_source_set_occlusion(src, true); raku_audio_occlusion_set_layers(RAKU_LAYER_WALLS); // Mixer group routing raku_audio_mixer_set_group(src, "SFX"); raku_audio_mixer_set_send("SFX", "Reverb", 0.4f);

Built for 90 FPS in XR

Every subsystem is optimized for the demanding frame budgets of VR and AR headsets. No compromises at 90 Hz.

Compute Shader Particles

Particle simulation runs entirely on the GPU. Spawn 1 million particles without touching the CPU. Sort, collide, and trail in parallel.

Multithreaded Physics

Physics broadphase, narrowphase, and constraint solving run across all available cores. Deterministic results regardless of thread count.

Streaming Audio Engine

Zero-allocation audio mixer with lock-free ring buffers. HRTF convolution runs on a dedicated thread. No audio glitches, ever.

Explore the SDK XR Features