ConditionForceEffect.SetParameters 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
조건부 힘 피드백 효과에 대한 매개 변수를 설정합니다.
public:
virtual void SetParameters(float3 direction, float positiveCoefficient, float negativeCoefficient, float maxPositiveMagnitude, float maxNegativeMagnitude, float deadZone, float bias) = SetParameters;
void SetParameters(float3 const& direction, float const& positiveCoefficient, float const& negativeCoefficient, float const& maxPositiveMagnitude, float const& maxNegativeMagnitude, float const& deadZone, float const& bias);
public void SetParameters(Vector3 direction, float positiveCoefficient, float negativeCoefficient, float maxPositiveMagnitude, float maxNegativeMagnitude, float deadZone, float bias);
function setParameters(direction, positiveCoefficient, negativeCoefficient, maxPositiveMagnitude, maxNegativeMagnitude, deadZone, bias)
Public Sub SetParameters (direction As Vector3, positiveCoefficient As Single, negativeCoefficient As Single, maxPositiveMagnitude As Single, maxNegativeMagnitude As Single, deadZone As Single, bias As Single)
매개 변수
각 축에 미치는 영향의 방향과 크기를 설명하는 벡터입니다. 각 개별 축의 범위는 -1.0~1.0이며 다른 축과 독립적입니다. 축에 음수 값을 지정하면 축에서 입력 값이 반전됩니다.
- positiveCoefficient
-
Single
float
입력이 지정된 축을 따라 양수 방향으로 중심점에서 멀어질 때 힘이 얼마나 빠르게 증가하는지 설명하는 선의 기울기입니다. 범위는 -infinity에서 +infinity까지입니다.
- negativeCoefficient
-
Single
float
입력이 지정된 축을 따라 음수 방향으로 중심점에서 멀어질 때 힘이 얼마나 빠르게 증가하는지 설명하는 선의 기울기입니다. 범위는 -infinity에서 +infinity까지입니다.
- maxPositiveMagnitude
-
Single
float
입력이 지정된 축을 따라 양수 방향으로 중심점에서 멀어질 때의 힘 피드백의 최대 크기입니다. 범위는 0에서 1.0까지입니다.
- maxNegativeMagnitude
-
Single
float
입력이 지정된 축을 따라 음수 방향으로 중심점에서 멀어질 때의 힘 피드백의 최대 크기입니다. 범위는 0에서 1.0까지입니다.
- deadZone
-
Single
float
힘 피드백이 적용되지 않는 아래 값을 지정합니다. 범위는 0.0에서 1.0까지이며 중심점 주위에 비대칭적으로 적용됩니다.
- bias
-
Single
float
효과 계산의 중심점에 대한 오프셋입니다. 범위는 -1.0에서 1.0까지입니다.
예제
// Create a spring effect and load it into the device. This is an async operation
// since it might take a brief amount of time for the driver to complete this.
ConditionForceEffect ^ springEffect = ref new ConditionForceEffect(ConditionEffectKind::Spring);
if (springEffect)
{
IAsyncAction ^ action = motor->LoadEffectAsync(springEffect);
concurrency::create_task(action).then([=]()
{
// Make sure the effect was loaded successfully. There is a finite amount
// of storage available for effects in the hardware, so this is expected
// to fail if there is not enough room. Alternatively, the motor might
// not support the requested effect (although this is rare).
if (action->Status == AsyncStatus::Completed)
{
// Set the parameters for the spring effect. Note how the parameters
// can be modified after the effect has been loaded into the hardware.
springEffect->SetParameters(
{ 1.0f, 0.0f, 0.0f }, // Unit vector indicating the effect applies to the X axis
1.0f, -1.0f, // Full strength when the wheel is turned to its maximum angle
0.3f, -0.3f, // Limit the maximum feedback force to 30%
0.025f, // Apply a small dead zone when the wheel is centered
0.0f); // Equal force in both directions
// Go ahead and start the effect, since we want this running all the time
springEffect->StartEffect();
}
});
}
설명
다음 이미지는 SetParameters에 대한 인수의 효과를 보여 줍니다.
![매개 변수가 힘에 미치는 영향.](windows.gaming.input.forcefeedback/images/conditionalforceeffect_parameters.png?view=winrt-26100)