Files
Fishing2/Assets/Obi/Resources/Compute/InertialFrame.cginc
2026-01-22 22:08:21 +08:00

23 lines
431 B
HLSL

#ifndef INERTIALFRAME_INCLUDE
#define INERTIALFRAME_INCLUDE
#include "Transform.cginc"
struct inertialFrame
{
transform frame;
transform prevFrame;
float4 velocity;
float4 angularVelocity;
float4 acceleration;
float4 angularAcceleration;
float4 velocityAtPoint(float4 pnt)
{
return velocity + float4(cross(angularVelocity.xyz, (pnt - prevFrame.translation).xyz), 0);
}
};
#endif