添加插件
This commit is contained in:
23
Assets/Obi/Resources/Compute/InertialFrame.cginc
Normal file
23
Assets/Obi/Resources/Compute/InertialFrame.cginc
Normal file
@@ -0,0 +1,23 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user