ホーム › UI.Input.GameInput › GameInputForceFeedbackRampParams
GameInputForceFeedbackRampParams
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| envelope | GameInputForceFeedbackEnvelope | 48 | +0 | +0 | エフェクトの時間包絡を指定するエンベロープである。 |
| startMagnitude | GameInputForceFeedbackMagnitude | 28 | +48 | +48 | ランプ開始時の力の大きさである。 |
| endMagnitude | GameInputForceFeedbackMagnitude | 28 | +76 | +76 | ランプ終了時の力の大きさである。 |
各言語での定義
#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;
// GameInputForceFeedbackRampParams (x64 104 / x86 104 バイト)
typedef struct GameInputForceFeedbackRampParams {
GameInputForceFeedbackEnvelope envelope;
GameInputForceFeedbackMagnitude startMagnitude;
GameInputForceFeedbackMagnitude endMagnitude;
} GameInputForceFeedbackRampParams;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 GameInputForceFeedbackRampParams
{
public GameInputForceFeedbackEnvelope envelope;
public GameInputForceFeedbackMagnitude startMagnitude;
public GameInputForceFeedbackMagnitude endMagnitude;
}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 GameInputForceFeedbackRampParams
Public envelope As GameInputForceFeedbackEnvelope
Public startMagnitude As GameInputForceFeedbackMagnitude
Public endMagnitude As GameInputForceFeedbackMagnitude
End Structureimport 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 GameInputForceFeedbackRampParams(ctypes.Structure):
_fields_ = [
("envelope", GameInputForceFeedbackEnvelope),
("startMagnitude", GameInputForceFeedbackMagnitude),
("endMagnitude", 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 GameInputForceFeedbackRampParams {
pub envelope: GameInputForceFeedbackEnvelope,
pub startMagnitude: GameInputForceFeedbackMagnitude,
pub endMagnitude: 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 GameInputForceFeedbackRampParams struct {
envelope GameInputForceFeedbackEnvelope
startMagnitude GameInputForceFeedbackMagnitude
endMagnitude 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;
GameInputForceFeedbackRampParams = record
envelope: GameInputForceFeedbackEnvelope;
startMagnitude: GameInputForceFeedbackMagnitude;
endMagnitude: 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 GameInputForceFeedbackRampParams = extern struct {
envelope: GameInputForceFeedbackEnvelope,
startMagnitude: GameInputForceFeedbackMagnitude,
endMagnitude: 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
GameInputForceFeedbackRampParams {.bycopy.} = object
envelope: GameInputForceFeedbackEnvelope
startMagnitude: GameInputForceFeedbackMagnitude
endMagnitude: GameInputForceFeedbackMagnitudestruct 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 GameInputForceFeedbackRampParams
{
GameInputForceFeedbackEnvelope envelope;
GameInputForceFeedbackMagnitude startMagnitude;
GameInputForceFeedbackMagnitude endMagnitude;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputForceFeedbackRampParams サイズ: 104 バイト(x64)
dim st, 26 ; 4byte整数×26(構造体サイズ 104 / 4 切り上げ)
; envelope : GameInputForceFeedbackEnvelope (+0, 48byte) varptr(st)+0 を基点に操作(48byte:入れ子/配列)
; startMagnitude : GameInputForceFeedbackMagnitude (+48, 28byte) varptr(st)+48 を基点に操作(28byte:入れ子/配列)
; endMagnitude : GameInputForceFeedbackMagnitude (+76, 28byte) varptr(st)+76 を基点に操作(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 GameInputForceFeedbackRampParams
#field GameInputForceFeedbackEnvelope envelope
#field GameInputForceFeedbackMagnitude startMagnitude
#field GameInputForceFeedbackMagnitude endMagnitude
#endstruct
stdim st, GameInputForceFeedbackRampParams ; NSTRUCT 変数を確保