定义力回馈效果的 API 支持的属性。
语法
typedef struct GameInputForceFeedbackParams {
GameInputForceFeedbackEffectKind kind;
union
{
GameInputForceFeedbackConstantParams constant;
GameInputForceFeedbackRampParams ramp;
GameInputForceFeedbackPeriodicParams sineWave;
GameInputForceFeedbackPeriodicParams squareWave;
GameInputForceFeedbackPeriodicParams triangleWave;
GameInputForceFeedbackPeriodicParams sawtoothUpWave;
GameInputForceFeedbackPeriodicParams sawtoothDownWave;
GameInputForceFeedbackConditionParams spring;
GameInputForceFeedbackConditionParams friction;
GameInputForceFeedbackConditionParams damper;
GameInputForceFeedbackConditionParams inertia;
};
} GameInputForceFeedbackParams
成员
kind
类型:GameInputForceFeedbackEffectKind
定义力回馈效果的种类。
constant
类型:GameInputForceFeedbackConstantParams
恒定的力回馈效果。 在效果的持续时间内以恒定级别施加的力。
ramp
类型:GameInputForceFeedbackRampParams
渐变的力回馈效果。 在效果的持续时间内通过增加或减少逐渐施加力。
sineWave
类型:GameInputForceFeedbackPeriodicParams
正弦波力回馈效果。 以正弦波模式施加力。
squareWave
类型:GameInputForceFeedbackPeriodicParams
方波力回馈效果。 以方波模式施加力。
triangleWave
类型:GameInputForceFeedbackPeriodicParams
三角波力回馈效果。 以三角波模式施加力。
sawtoothUpWave
类型:GameInputForceFeedbackPeriodicParams
向上锯齿波力回馈效果。 以向上锯齿波力模式施加力。
sawtoothDownWave
类型:GameInputForceFeedbackPeriodicParams
向下锯齿波力回馈效果。 以向下锯齿波力模式施加力。
spring
类型:GameInputForceFeedbackConditionParams
弹簧力回馈效果。 以与设定状态相对抗的方式施加力。
friction
类型:GameInputForceFeedbackConditionParams
摩擦力回馈效果。 施加力以模拟摩擦力。
damper
类型:GameInputForceFeedbackConditionParams
阻尼力回馈效果。 施加力以模拟阻尼效果。
inertia
类型:GameInputForceFeedbackConditionParams
惯性力回馈效果。 施加力以模拟惯性效果。
备注
力回馈效果是由其参数定义的。 这些效果存储在 GameInputForceFeedbackParams
结构中。 每种类型的力回馈效果的实际参数略有不同。 各种效果的参数定义了沿电机支持的轴的效果大小,并且大多数参数都允许包络随时间推移影响效果的强度。
要求
头文件:GameInput.h
支持平台:Windows、Xbox One 系列主机和 Xbox Series 主机
另请参阅
高级 GameInput 主题
GameInput 概述
GameInputForceFeedbackEffectKind
GameInput