mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
|
||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
// Created : 2010-09-16
|
||
|
// Updated : 2010-09-16
|
||
|
// Licence : This source is under MIT licence
|
||
|
// File : test/gtx/simd-vec4.cpp
|
||
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#include <glm/glm.hpp>
|
||
|
#include <glm/gtx/simd_vec4.hpp>
|
||
|
#include <cstdio>
|
||
|
|
||
|
int main(int argc, char* argv[])
|
||
|
{
|
||
|
glm::simd_vec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
|
||
|
glm::simd_vec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
|
||
|
glm::simd_vec4 C1 = A1 + B1;
|
||
|
glm::simd_vec4 D1 = A1.swizzle<glm::X, glm::Z, glm::Y, glm::W>();
|
||
|
|
||
|
printf("A1(%2.3f, %2.3f, %2.3f, %2.3f)\n", A1.x, A1.y, A1.z, A1.w);
|
||
|
printf("B1(%2.3f, %2.3f, %2.3f, %2.3f)\n", B1.x, B1.y, B1.z, B1.w);
|
||
|
printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w);
|
||
|
printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w);
|
||
|
|
||
|
return 0;
|
||
|
}
|