ConditionForceEffect.SetParameters Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Imposta i parametri per l'effetto di feedback della forza condizionale.
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)
Parametri
Vettore che descrive la direzione e la grandezza dell'effetto su ogni asse. Ogni singolo asse ha un intervallo compreso tra -1,0 e 1,0 ed è indipendente dagli altri assi. Specificando un valore negativo per un asse inverte i valori di input dall'asse.
- positiveCoefficient
-
Single
float
La pendenza della linea che descrive come aumenta rapidamente la forza quando l'input si allontana dal punto centrale nella direzione positiva lungo l'asse specificato. L'intervallo è compreso tra -infinito e +infinito.
- negativeCoefficient
-
Single
float
La pendenza della linea che descrive come aumenta rapidamente la forza quando l'input si allontana dal punto centrale nella direzione negativa lungo l'asse specificato. L'intervallo è compreso tra -infinito e +infinito.
- maxPositiveMagnitude
-
Single
float
La grandezza massima del feedback della forza quando l'input si allontana dal punto centrale nella direzione positiva lungo l'asse specificato. L'intervallo è compreso tra 0 e 1,0.
- maxNegativeMagnitude
-
Single
float
La grandezza massima del feedback della forza quando l'input si allontana dal punto centrale nella direzione negativa lungo l'asse specificato. L'intervallo è compreso tra 0 e 1,0.
- deadZone
-
Single
float
Specifica il valore riportato di seguito al quale non viene applicato il feedback di forza. L'intervallo è compreso tra 0,0 e 1,0 e viene applicato asimmetricamente intorno al punto centrale.
- bias
-
Single
float
Offset al punto centrale nei calcoli di effetto. L'intervallo è compreso tra -1,0 e 1,0.
Esempio
// 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();
}
});
}
Commenti
L'immagine seguente illustra gli effetti degli argomenti in SetParameters:
![Effetti dei parametri sulla forza.](windows.gaming.input.forcefeedback/images/conditionalforceeffect_parameters.png?view=winrt-26100)