#![allow(dead_code, missing_docs)]
use std::mem;
use flense::prelude::*;
pub enum Position {}
impl Field for Position {
type Type = [f32; 3];
}
pub enum Color {}
impl Field for Color {
type Type = [f32; 3];
}
pub enum Normal {}
impl Field for Normal {
type Type = [u8; 2];
}
pub enum Other {}
impl Field for Other {
type Type = u64;
}
unsafe impl Adapter<Position> for [f32; 3] {
const OFFSET: usize = 0;
}
unsafe impl Adapter<Color> for [f32; 3] {
const OFFSET: usize = 0;
}
unsafe impl Adapter<Normal> for [u8; 2] {
const OFFSET: usize = 0;
}
unsafe impl Adapter<Other> for u64 {
const OFFSET: usize = 0;
}
#[derive(Default, Clone, Copy)]
pub struct Vertex {
pub position: [f32; 3],
pub color: [f32; 3],
pub normal: [u8; 2],
pub other: u64,
}
unsafe impl Adapter<Position> for Vertex {
const OFFSET: usize = mem::offset_of!(Self, position);
}
unsafe impl Adapter<Color> for Vertex {
const OFFSET: usize = mem::offset_of!(Self, color);
}
unsafe impl Adapter<Normal> for Vertex {
const OFFSET: usize = mem::offset_of!(Self, normal);
}
unsafe impl Adapter<Other> for Vertex {
const OFFSET: usize = mem::offset_of!(Self, other);
}