⚓ Advanced Buoyancy & River Physics in Oceanology Pro 2.0
· 5 min read
Oceanology Pro 2.0 introduces a completely overhauled buoyancy system with async physics, river-specific forces, and downstream rotation. Perfect for boats, debris, characters, and any floating objects.
🎯 What's New in Buoyancy?
| Feature | NextGen 1.x | NextGen 2.0 |
|---|---|---|
| Physics Thread | Game thread | Async physics thread |
| River Forces | Basic | Full current simulation |
| Shore Push | None | Configurable push/pull |
| Downstream Rotation | None | Spring-based alignment |
| Drag Forces | Limited | Velocity-based drag |
| Pontoon Data | Basic | Full water velocity & normal |
⚓ Pontoon System
Buoyancy is calculated at pontoon points - spheres that sample water data:
struct FOceanologySphericalPontoon
{
// Configuration
FName CenterSocket; // Attach to skeleton socket
FVector RelativeLocation; // Or use relative position
float Radius; // Sphere radius
bool bFXEnabled; // Enable splash FX
// Runtime - automatically populated
FVector CenterLocation; // World position
FQuat SocketRotation; // Current rotation
float WaterHeight; // Surface Z at pontoon
float WaterDepth; // Depth below surface
float ImmersionDepth; // How deep pontoon is
FVector WaterPlaneNormal; // Surface normal
FVector WaterVelocity; // Current at this point
FVector WaterSurfacePosition;
bool bIsInWater; // Submerged state
};
Setting Up Pontoons
For a boat, place pontoons at key buoyancy points:
// Bow pontoon
Pontoon_Bow.CenterSocket = "BowSocket";
Pontoon_Bow.Radius = 150.0f;
// Stern pontoons (port/starboard)
Pontoon_SternPort.RelativeLocation = FVector(-200, -100, 0);
Pontoon_SternPort.Radius = 120.0f;
Pontoon_SternStarboard.RelativeLocation = FVector(-200, 100, 0);
Pontoon_SternStarboard.Radius = 120.0f;
🌊 Core Buoyancy Parameters
struct FOceanologyBuoyancyData
{
// Pontoon configuration
TArray<FOceanologySphericalPontoon> Pontoons;
bool bCenterPontoonsOnCOM = true;
// Buoyancy force
float BuoyancyCoefficient = 0.1f; // Force multiplier
float MaxBuoyantForce = 5000000.0f; // Force cap
// Damping (prevents oscillation)
float BuoyancyDamp = 1000.0f; // Linear damping
float BuoyancyDamp2 = 1.0f; // Quadratic damping
// Velocity ramping (smoother entry)
float BuoyancyRampMinVelocity = 20.0f;
float BuoyancyRampMaxVelocity = 50.0f;
float BuoyancyRampMax = 1.0f;
};