Win32 API 日本語リファレンス
ホームGraphics.Direct3D12 › D3D12_RAYTRACING_AABB

D3D12_RAYTRACING_AABB

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

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

フィールド

フィールドサイズx64x86説明
MinXFLOAT4+0+0軸平行境界ボックスのX最小値。
MinYFLOAT4+4+4軸平行境界ボックスのY最小値。
MinZFLOAT4+8+8軸平行境界ボックスのZ最小値。
MaxXFLOAT4+12+12軸平行境界ボックスのX最大値。
MaxYFLOAT4+16+16軸平行境界ボックスのY最大値。
MaxZFLOAT4+20+20軸平行境界ボックスのZ最大値。

各言語での定義

#include <windows.h>

// D3D12_RAYTRACING_AABB  (x64 24 / x86 24 バイト)
typedef struct D3D12_RAYTRACING_AABB {
    FLOAT MinX;
    FLOAT MinY;
    FLOAT MinZ;
    FLOAT MaxX;
    FLOAT MaxY;
    FLOAT MaxZ;
} D3D12_RAYTRACING_AABB;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_RAYTRACING_AABB
{
    public float MinX;
    public float MinY;
    public float MinZ;
    public float MaxX;
    public float MaxY;
    public float MaxZ;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_RAYTRACING_AABB
    Public MinX As Single
    Public MinY As Single
    Public MinZ As Single
    Public MaxX As Single
    Public MaxY As Single
    Public MaxZ As Single
End Structure
import ctypes
from ctypes import wintypes

class D3D12_RAYTRACING_AABB(ctypes.Structure):
    _fields_ = [
        ("MinX", ctypes.c_float),
        ("MinY", ctypes.c_float),
        ("MinZ", ctypes.c_float),
        ("MaxX", ctypes.c_float),
        ("MaxY", ctypes.c_float),
        ("MaxZ", ctypes.c_float),
    ]
#[repr(C)]
pub struct D3D12_RAYTRACING_AABB {
    pub MinX: f32,
    pub MinY: f32,
    pub MinZ: f32,
    pub MaxX: f32,
    pub MaxY: f32,
    pub MaxZ: f32,
}
import "golang.org/x/sys/windows"

type D3D12_RAYTRACING_AABB struct {
	MinX float32
	MinY float32
	MinZ float32
	MaxX float32
	MaxY float32
	MaxZ float32
}
type
  D3D12_RAYTRACING_AABB = record
    MinX: Single;
    MinY: Single;
    MinZ: Single;
    MaxX: Single;
    MaxY: Single;
    MaxZ: Single;
  end;
const D3D12_RAYTRACING_AABB = extern struct {
    MinX: f32,
    MinY: f32,
    MinZ: f32,
    MaxX: f32,
    MaxY: f32,
    MaxZ: f32,
};
type
  D3D12_RAYTRACING_AABB {.bycopy.} = object
    MinX: float32
    MinY: float32
    MinZ: float32
    MaxX: float32
    MaxY: float32
    MaxZ: float32
struct D3D12_RAYTRACING_AABB
{
    float MinX;
    float MinY;
    float MinZ;
    float MaxX;
    float MaxY;
    float MaxZ;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3D12_RAYTRACING_AABB サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; MinX : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MinY : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MinZ : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; MaxX : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; MaxY : FLOAT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; MaxZ : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global D3D12_RAYTRACING_AABB
    #field float MinX
    #field float MinY
    #field float MinZ
    #field float MaxX
    #field float MaxY
    #field float MaxZ
#endstruct

stdim st, D3D12_RAYTRACING_AABB        ; NSTRUCT 変数を確保
st->MinX = 100
mes "MinX=" + st->MinX