Win32 API 日本語リファレンス
ホームUI.Input.GameInput › GameInputForceFeedbackConstantParams

GameInputForceFeedbackConstantParams

構造体
サイズx64: 80 バイト / x86: 80 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
envelopeGameInputForceFeedbackEnvelope48+0+0エフェクトの時間包絡を指定するエンベロープである。
magnitudeGameInputForceFeedbackMagnitude28+48+48定常力の大きさを指定するマグニチュードである。

各言語での定義

#include <windows.h>

// GameInputForceFeedbackEnvelope  (x64 48 / x86 48 バイト)
typedef struct GameInputForceFeedbackEnvelope {
    ULONGLONG attackDuration;
    ULONGLONG sustainDuration;
    ULONGLONG releaseDuration;
    FLOAT attackGain;
    FLOAT sustainGain;
    FLOAT releaseGain;
    DWORD playCount;
    ULONGLONG repeatDelay;
} GameInputForceFeedbackEnvelope;

// GameInputForceFeedbackMagnitude  (x64 28 / x86 28 バイト)
typedef struct GameInputForceFeedbackMagnitude {
    FLOAT linearX;
    FLOAT linearY;
    FLOAT linearZ;
    FLOAT angularX;
    FLOAT angularY;
    FLOAT angularZ;
    FLOAT normal;
} GameInputForceFeedbackMagnitude;

// GameInputForceFeedbackConstantParams  (x64 80 / x86 80 バイト)
typedef struct GameInputForceFeedbackConstantParams {
    GameInputForceFeedbackEnvelope envelope;
    GameInputForceFeedbackMagnitude magnitude;
} GameInputForceFeedbackConstantParams;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputForceFeedbackEnvelope
{
    public ulong attackDuration;
    public ulong sustainDuration;
    public ulong releaseDuration;
    public float attackGain;
    public float sustainGain;
    public float releaseGain;
    public uint playCount;
    public ulong repeatDelay;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputForceFeedbackMagnitude
{
    public float linearX;
    public float linearY;
    public float linearZ;
    public float angularX;
    public float angularY;
    public float angularZ;
    public float normal;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputForceFeedbackConstantParams
{
    public GameInputForceFeedbackEnvelope envelope;
    public GameInputForceFeedbackMagnitude magnitude;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputForceFeedbackEnvelope
    Public attackDuration As ULong
    Public sustainDuration As ULong
    Public releaseDuration As ULong
    Public attackGain As Single
    Public sustainGain As Single
    Public releaseGain As Single
    Public playCount As UInteger
    Public repeatDelay As ULong
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputForceFeedbackMagnitude
    Public linearX As Single
    Public linearY As Single
    Public linearZ As Single
    Public angularX As Single
    Public angularY As Single
    Public angularZ As Single
    Public normal As Single
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputForceFeedbackConstantParams
    Public envelope As GameInputForceFeedbackEnvelope
    Public magnitude As GameInputForceFeedbackMagnitude
End Structure
import ctypes
from ctypes import wintypes

class GameInputForceFeedbackEnvelope(ctypes.Structure):
    _fields_ = [
        ("attackDuration", ctypes.c_ulonglong),
        ("sustainDuration", ctypes.c_ulonglong),
        ("releaseDuration", ctypes.c_ulonglong),
        ("attackGain", ctypes.c_float),
        ("sustainGain", ctypes.c_float),
        ("releaseGain", ctypes.c_float),
        ("playCount", wintypes.DWORD),
        ("repeatDelay", ctypes.c_ulonglong),
    ]

class GameInputForceFeedbackMagnitude(ctypes.Structure):
    _fields_ = [
        ("linearX", ctypes.c_float),
        ("linearY", ctypes.c_float),
        ("linearZ", ctypes.c_float),
        ("angularX", ctypes.c_float),
        ("angularY", ctypes.c_float),
        ("angularZ", ctypes.c_float),
        ("normal", ctypes.c_float),
    ]

class GameInputForceFeedbackConstantParams(ctypes.Structure):
    _fields_ = [
        ("envelope", GameInputForceFeedbackEnvelope),
        ("magnitude", GameInputForceFeedbackMagnitude),
    ]
#[repr(C)]
pub struct GameInputForceFeedbackEnvelope {
    pub attackDuration: u64,
    pub sustainDuration: u64,
    pub releaseDuration: u64,
    pub attackGain: f32,
    pub sustainGain: f32,
    pub releaseGain: f32,
    pub playCount: u32,
    pub repeatDelay: u64,
}

#[repr(C)]
pub struct GameInputForceFeedbackMagnitude {
    pub linearX: f32,
    pub linearY: f32,
    pub linearZ: f32,
    pub angularX: f32,
    pub angularY: f32,
    pub angularZ: f32,
    pub normal: f32,
}

#[repr(C)]
pub struct GameInputForceFeedbackConstantParams {
    pub envelope: GameInputForceFeedbackEnvelope,
    pub magnitude: GameInputForceFeedbackMagnitude,
}
import "golang.org/x/sys/windows"

type GameInputForceFeedbackEnvelope struct {
	attackDuration uint64
	sustainDuration uint64
	releaseDuration uint64
	attackGain float32
	sustainGain float32
	releaseGain float32
	playCount uint32
	repeatDelay uint64
}

type GameInputForceFeedbackMagnitude struct {
	linearX float32
	linearY float32
	linearZ float32
	angularX float32
	angularY float32
	angularZ float32
	normal float32
}

type GameInputForceFeedbackConstantParams struct {
	envelope GameInputForceFeedbackEnvelope
	magnitude GameInputForceFeedbackMagnitude
}
type
  GameInputForceFeedbackEnvelope = record
    attackDuration: UInt64;
    sustainDuration: UInt64;
    releaseDuration: UInt64;
    attackGain: Single;
    sustainGain: Single;
    releaseGain: Single;
    playCount: DWORD;
    repeatDelay: UInt64;
  end;

  GameInputForceFeedbackMagnitude = record
    linearX: Single;
    linearY: Single;
    linearZ: Single;
    angularX: Single;
    angularY: Single;
    angularZ: Single;
    normal: Single;
  end;

  GameInputForceFeedbackConstantParams = record
    envelope: GameInputForceFeedbackEnvelope;
    magnitude: GameInputForceFeedbackMagnitude;
  end;
const GameInputForceFeedbackEnvelope = extern struct {
    attackDuration: u64,
    sustainDuration: u64,
    releaseDuration: u64,
    attackGain: f32,
    sustainGain: f32,
    releaseGain: f32,
    playCount: u32,
    repeatDelay: u64,
};

const GameInputForceFeedbackMagnitude = extern struct {
    linearX: f32,
    linearY: f32,
    linearZ: f32,
    angularX: f32,
    angularY: f32,
    angularZ: f32,
    normal: f32,
};

const GameInputForceFeedbackConstantParams = extern struct {
    envelope: GameInputForceFeedbackEnvelope,
    magnitude: GameInputForceFeedbackMagnitude,
};
type
  GameInputForceFeedbackEnvelope {.bycopy.} = object
    attackDuration: uint64
    sustainDuration: uint64
    releaseDuration: uint64
    attackGain: float32
    sustainGain: float32
    releaseGain: float32
    playCount: uint32
    repeatDelay: uint64

  GameInputForceFeedbackMagnitude {.bycopy.} = object
    linearX: float32
    linearY: float32
    linearZ: float32
    angularX: float32
    angularY: float32
    angularZ: float32
    normal: float32

  GameInputForceFeedbackConstantParams {.bycopy.} = object
    envelope: GameInputForceFeedbackEnvelope
    magnitude: GameInputForceFeedbackMagnitude
struct GameInputForceFeedbackEnvelope
{
    ulong attackDuration;
    ulong sustainDuration;
    ulong releaseDuration;
    float attackGain;
    float sustainGain;
    float releaseGain;
    uint playCount;
    ulong repeatDelay;
}

struct GameInputForceFeedbackMagnitude
{
    float linearX;
    float linearY;
    float linearZ;
    float angularX;
    float angularY;
    float angularZ;
    float normal;
}

struct GameInputForceFeedbackConstantParams
{
    GameInputForceFeedbackEnvelope envelope;
    GameInputForceFeedbackMagnitude magnitude;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputForceFeedbackConstantParams サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; envelope : GameInputForceFeedbackEnvelope (+0, 48byte)  varptr(st)+0 を基点に操作(48byte:入れ子/配列)
; magnitude : GameInputForceFeedbackMagnitude (+48, 28byte)  varptr(st)+48 を基点に操作(28byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GameInputForceFeedbackEnvelope
    #field int64 attackDuration
    #field int64 sustainDuration
    #field int64 releaseDuration
    #field float attackGain
    #field float sustainGain
    #field float releaseGain
    #field int playCount
    #field int64 repeatDelay
#endstruct

#defstruct global GameInputForceFeedbackMagnitude
    #field float linearX
    #field float linearY
    #field float linearZ
    #field float angularX
    #field float angularY
    #field float angularZ
    #field float normal
#endstruct

#defstruct global GameInputForceFeedbackConstantParams
    #field GameInputForceFeedbackEnvelope envelope
    #field GameInputForceFeedbackMagnitude magnitude
#endstruct

stdim st, GameInputForceFeedbackConstantParams        ; NSTRUCT 変数を確保