Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
HairStructs.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2026 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#include "ShaderCore.h"
6
7// Prevent including this file multiple times unless we're generating bindings
8#if !defined(HAIR_STRUCTS_H) || defined(JPH_SHADER_GENERATE_WRAPPER)
9#ifndef JPH_SHADER_GENERATE_WRAPPER
10#define HAIR_STRUCTS_H
11#endif
12
15
16JPH_SHADER_CONSTANT(int, cHairPerVertexBatch, 64)
17JPH_SHADER_CONSTANT(int, cHairPerGridCellBatch, 32)
18JPH_SHADER_CONSTANT(int, cHairPerStrandBatch, 32)
19JPH_SHADER_CONSTANT(int, cHairPerRenderVertexBatch, 128)
20
21JPH_SHADER_CONSTANT(int, cHairNumSVertexInfluences, 3)
22
23JPH_SHADER_STRUCT_BEGIN(JPH_HairSkinWeight)
26JPH_SHADER_STRUCT_END(JPH_HairSkinWeight)
27
28JPH_SHADER_STRUCT_BEGIN(JPH_HairSkinPoint)
29 JPH_SHADER_STRUCT_MEMBER(JPH_uint, TriangleIndex)
33JPH_SHADER_STRUCT_END(JPH_HairSkinPoint)
34
35JPH_SHADER_STRUCT_BEGIN(JPH_HairGlobalPoseTransform)
38JPH_SHADER_STRUCT_END(JPH_HairGlobalPoseTransform)
39
40JPH_SHADER_STRUCT_BEGIN(JPH_HairSVertexInfluence)
42 JPH_SHADER_STRUCT_MEMBER(JPH_float3, RelativePosition)
44JPH_SHADER_STRUCT_END(JPH_HairSVertexInfluence)
45
46JPH_SHADER_STRUCT_BEGIN(JPH_HairPosition)
49JPH_SHADER_STRUCT_END(JPH_HairPosition)
50
51JPH_SHADER_STRUCT_BEGIN(JPH_HairVelocity)
53 JPH_SHADER_STRUCT_MEMBER(JPH_float3, AngularVelocity)
54JPH_SHADER_STRUCT_END(JPH_HairVelocity)
55
56JPH_SHADER_STRUCT_BEGIN(JPH_HairMaterial)
57 JPH_SHADER_STRUCT_MEMBER(JPH_float4, WorldTransformInfluence)
62 JPH_SHADER_STRUCT_MEMBER(JPH_float4, BendComplianceMultiplier)
63 JPH_SHADER_STRUCT_MEMBER(JPH_float4, GridVelocityFactor)
64 JPH_SHADER_STRUCT_MEMBER(JPH_uint, EnableCollision)
68 JPH_SHADER_STRUCT_MEMBER(JPH_float, ExpLinearDampingDeltaTime)
69 JPH_SHADER_STRUCT_MEMBER(JPH_float, ExpAngularDampingDeltaTime)
70 JPH_SHADER_STRUCT_MEMBER(JPH_float, BendComplianceInvDeltaTimeSq)
71 JPH_SHADER_STRUCT_MEMBER(JPH_float, StretchComplianceInvDeltaTimeSq)
72 JPH_SHADER_STRUCT_MEMBER(JPH_float, GridDensityForceFactor)
73 JPH_SHADER_STRUCT_MEMBER(JPH_float, InertiaMultiplier)
74 JPH_SHADER_STRUCT_MEMBER(JPH_float, MaxLinearVelocitySq)
75 JPH_SHADER_STRUCT_MEMBER(JPH_float, MaxAngularVelocitySq)
76JPH_SHADER_STRUCT_END(JPH_HairMaterial)
77
78JPH_SHADER_STRUCT_BEGIN(JPH_HairCollisionPlane)
81JPH_SHADER_STRUCT_END(JPH_HairCollisionPlane)
82
83JPH_SHADER_STRUCT_BEGIN(JPH_HairCollisionShape)
86 JPH_SHADER_STRUCT_MEMBER(JPH_float3, AngularVelocity)
87JPH_SHADER_STRUCT_END(JPH_HairCollisionShape)
88
89// Note: The order was chosen to match the struct between C++ and HLSL.
90JPH_SHADER_CONSTANTS_BEGIN(JPH_HairUpdateContext, gContext)
94 JPH_SHADER_CONSTANTS_MEMBER(JPH_uint, NumRenderVertices)
104 JPH_SHADER_CONSTANTS_MEMBER(JPH_uint, NumSkinVertices)
106 JPH_SHADER_CONSTANTS_MEMBER(JPH_uint, NumSkinWeightsPerVertex)
109 JPH_SHADER_CONSTANTS_MEMBER(JPH_Quat, DeltaTransformQuat)
110JPH_SHADER_CONSTANTS_END(JPH_HairUpdateContext)
111
112// Note: The order was chosen to match the struct between C++ and HLSL.
113JPH_SHADER_CONSTANTS_BEGIN(JPH_HairIterationContext, gIterationContext)
114 JPH_SHADER_CONSTANTS_MEMBER(JPH_float, AccumulatedDeltaTime)
115 JPH_SHADER_CONSTANTS_MEMBER(JPH_float, IterationFraction)
116JPH_SHADER_CONSTANTS_END(JPH_HairIterationContext)
117
119
120#endif // !defined(HAIR_STRUCTS_H) || defined(JPH_SHADER_GENERATE_WRAPPER)
#define JPH_SUPPRESS_WARNINGS
Definition Core.h:336
@ Position
Motor will drive to target position.
@ Velocity
Motor will drive to target velocity.
#define JPH_SHADER_CONSTANT(type, name, value)
Definition ShaderCore.h:54
uint JPH_uint
Definition ShaderCore.h:44
#define JPH_SHADER_STRUCT_MEMBER(type, name)
Definition ShaderCore.h:78
#define JPH_SHADER_STRUCT_BEGIN(name)
Definition ShaderCore.h:77
#define JPH_SHADER_CONSTANTS_BEGIN(type, name)
Definition ShaderCore.h:56
float4 JPH_Mat44[4]
Definition ShaderCore.h:52
#define JPH_SHADER_STRUCT_END(name)
Definition ShaderCore.h:79
float JPH_float
Definition ShaderCore.h:41
float3 JPH_float3
Definition ShaderCore.h:42
float4 JPH_Plane
Definition ShaderCore.h:51
float4 JPH_float4
Definition ShaderCore.h:43
#define JPH_SUPPRESS_WARNING_POP
Definition ShaderCore.h:38
#define JPH_SHADER_CONSTANTS_END(type)
Definition ShaderCore.h:58
#define JPH_SUPPRESS_WARNING_PUSH
Definition ShaderCore.h:37
#define JPH_SHADER_CONSTANTS_MEMBER(type, name)
Definition ShaderCore.h:57
float4 JPH_Quat
Definition ShaderCore.h:50
uint3 JPH_uint3
Definition ShaderCore.h:45
An infinite plane described by the formula X . Normal + Constant = 0.
Definition Plane.h:11